CFAM
CFAM
INTRODUCTION
The main focus of Ms Access is the Tables otherwise known as files. Tables Consist
of Fields (attributes) and are used to store data e.g An Employees Table.
Database Terminology
Data
The material (Stuff) that Access stores, organises and manages for you
Fields
The place where data is placed within the database is called a field. One field holds one
piece of data. If you are storing student details, possible fields would include Name,
Admission number, Age…
Records
All the fields for one student constitute a record, Records ensure which name relates
to which admission number, age
Table
A collection of records that describe similar data is called a table. A database for
student details could have tables for admission information, fees, and exams…
Index
Internally, an index is implemented as a look up list much like the Index you use to
find information about a particular item in a book.
Primary Key
Primary keys are needed to aid in searching for records. This is because a field such
as the Employees Name is likely to contain similar names for different people. This
means that it is more prudent to invent a series of codes (Usually Numerical) to identify
the employees uniquely.
Starting MS Access
Start windows and then click Microsoft Access icon to run the application or Select
the program from the Program listing in the Start menu as shown below
Designing a database
1. Determine the purpose of the database. This helps in deciding the facts to be stored.
2. Determine the tables. Divide the information into separate subjects, such as employees
or orders. Each subject will be a table in the database.
3. Determine the fields. Decide what information to store in each table. Each field
is displayed as a column in the table.
NOTE
When you create a Microsoft Access database, you create one file that contains the
data and table structures as well as the queries, forms, reports, macros and modules.
CREATING A NEW DATABASE
Once you have loaded the Ms Access application, you will see a dialog similar to
the following: (If it is not visible: From ‘View’ Choose ‘Tool Bars’ then ‘Task Pane’)
A database file must be saved before it can be used and you will be prompted to save
the file first i.e
Alternatively:
Either way you will get the ‘Save’ dialog box as shown below. Type the name of
the Database and click on the ‘Create’ Button.
The database window is named after the name of the database that you have
created. Thus:
1.03 Exiting Ms Access
1. Before exiting Ms-Access, ensure that all your tables and other
database objects (new or ones to which you have made cahges) are
saved, if they are not saved you will get a dialog similar to the one below
2. You need to be sure of the choice that you will make since it may
have implications on the data that you have stored in the database
3. Once all database objects are closed, you may close the database window
by clicking on the exit ( ) button
4. Exit ms-Access by choosing “Exit” from the “File” menu
Databases and Tables
Opening an Existing Database
list of existing databases that you opened in the recent past will be different for
different system users (If you are using Windows XP or 2000). By clicking on either of
the names in the list, you will be able to open the chosen database.
To open a database that is not listed, you may choose ‘Open’ from the ‘File’ menu i.e.
You
may
also
use
the
‘Open
’ Icon
( )
A
Either way you will get the ‘Open’ dialog box from where you must choose the source
of the file i.e.
Choose the file you want to open and click on the ‘Open’ button
Creating
tables TABLES
Field Properties
Text
Stores text or combinations of text and numbers, such as addresses, numbers that do
not require calculations, such as phone numbers, part numbers, or postal codes of size
up to 255 characters.
Memo
Stores lengthy text and numbers, such as general notes or detailed descriptions.
Memo fields hold up to 64000 characters of information.
Number
Numeric data to be used for mathematical calculations, except calculations
involving money (use Currency type). Set the Field Size property to define the
specific Number type.
Currency
Currency values. Use the Currency data type to prevent rounding off during calculations.
Accurate to 15 digits to the left of the decimal point and 4 digits to the right.
AutoNumber
Unique sequential (incrementing by 1) or random numbers automatically inserted when
a record is added.
Yes/No
Fields that will contain only one of two values, such as Yes/No, True/False,
On/Off. OLE Object
Objects (such as Microsoft Word documents, Microsoft Excel spreadsheets, pictures,
sounds, or other binary data), created in other programs using the OLE protocol, that can
be linked to or embedded in a Microsoft Access table. You must use a bound object
frame in a form or report to display the OLE object.
Field properties
Depending on the nature of the contents of your field, a certain level of control can
be achieved such that a field will accept what it has been programmed to have.
The following options are offered:
FIELD SIZE
Allows entry of field size for Text data type For example, if the standard length of names
is 25 characters, you may use this property to limit the number of characters entered into
such a field to 25. In this case, if there are existing names longer than 25 characters then
they will be truncated to 25.
For numeric data types, you choose the field size by selecting from a drop-down list.
Field size does not apply to the Date/Time, Yes/No, Currency, Memo or OLE object data
type.
FORMAT
Allows selection of a predefined format in which to display the values in the field
from the drop-down combo list applicable to the data type that you chose (Except
Text). One can also customise a form of presentation of data. E.g. to have a code
appearing before
every telephone number you wish to enter, select the relevant field and set the
format: “02-”000000 (This gives the code for Nairobi)
DECIMAL PLACES
Can select specific number of decimal places from the drop-down combo list, and applies
only to number and currency fields.
INPUT MASK
Helps put a mask for controlling the entry e.g. setting a limit especially to the entry of
numeric fields:
000000 Will allow a six digit number no more than that or less.
999999 Will allow six or less digits.
CAPTION
This is a name used (other than the field name) to appear in the field name header
button in Table datasheet view.
DEFAULT VALUE
Allows setting of a value, which will automatically be entered into the field when a new
record is added to a field. E.g. Setting default date as current date: =Date()
VALIDATION RULE
Validation rules test the value entered in a field against set criteria. E.g.
Like “Jordan” : Will only accept the word Jordan
<10000 : Any value less than 10000
>=5000 AND <=10000 : Entry of between 5000 and 10000
VALIDATION TEXT
Provides a message. It appears in response to violation of validation rule. It must be
typed in earlier.
REQUIRED
Controls the entry of important fields. A YES option ensures a field is not left blank and is
equivalent of typing IS NOT NULL as a field validation rule (Not necessary for
primary keys since Access does not allow null value in primary key fields).
NEW VALUES
Applies only to AutoNumber fields. Access can increment the Autonumber field by one
for each new record, or fill in the field with a randomly generated number, depending
on the new values property setting that you choose.
NB For more details on fields and Field properties, press F1 to access help.
In this view you can make changes to the database design e.g. adding new fields,
changing field types and or/ attributes
Once you finish designing the table, click on the save icon ( ), the following
dialog comes up
Type an appropriate name e.g. ‘Customers’ then click on the ‘Ok’ Button ensure that the
new name is not given to an existing table. You will be prompted to define a primary key
IF you have not already defined one i.e
1. If you answer ‘Yes’ the table will be saved but Access will add a new
field named ‘ID’,‘ID1’…. Of type ‘AutoNumber’ and make it to be the
primary key.
2. If you answer ‘No’ the table will be saved with no primary key defined
i.e. ‘As it is’
3. If you answer ‘cancel’ the new table will not be saved.
In this view you can add new records, delete edit or existing records
a b c d e
a) Moves to the FIRST record.
b) Moves to the PREVIOUS record.
c) Moves to the NEXT record.
d) Moves to the LAST record.
e) Creates a NEW record.
CREATING FORMS
Ms Access has a form wizard which asks you questions about the form you want
to create, then creates a form based on your responses.
STEPS
1. In the Database window, click the Form button, and then choose the New button
2. In the Select A Table/Query box, type the name of the form’s source table or query,
or select one from the list.
3. Choose the Form Wizards button
4. Answer the questions in the Form Wizards dialog boxes. From the last dialog
box, you can display the form in Design view or Form view.
NOTE: If the Form Wizard doesn’t create the exact form you want, you can change the
form yourself in design view, or you can use the Form Wizard again and choose different
option as you answer the questions.
1. In the Database window, click the Form button, and then choose the New button.
The new form dialog box appears.
2. In the Select A Table/Query box, type the name of the form’s source table or query,
or select one from the list. (To create an Unbound form, leave this box empty).
3. Click ‘Ok’. A new blank form is shown as indicated below.
4. Drag the fields that you would like to see in the form arrange and edit them as
appropriate using the properties window which is activated/deactivated by clicking
on the icon as shown.
Caption Box
5. To adjust the size of a control, click on it and use the fill handles to adjust it. This
is done by achieving the double headed arrow by positioning the mouse over any one
of the ‘Fill Handles’, clicking and holding the left mouse button then dragging
inwards or outwards as required.
NB. You may also use the ‘Properties box’ to set other properties e.g. Change the colour
display by changing the entry in the ‘Fore Color’ text box.
Fill Handles
Once the form has been created, you may open it for data entry. You may do this by
double clicking on it in the database widow
OR
1. Click on the form to highlight it.
2. Click on the ‘Open’ button in the database window
Open button
customising a
form CREATING
A CONTROL
As you design a form or a report, you place controls on it. The controls you create
in design view are the title, fields and pictures you see in form view.
1. From the menu bar select ‘View’ option, then ‘field list’ (in case it is not active)
Field List
2. Drag the required fields from the list to the form, where they appear both the label
and the control field. By clicking inside the label, the user can delete and type a
label of choice.
All the fields can be dragged at once to the form by double clicking the headings of the
field lists and all the fields will be shaded blue. Point and drag them at once.
POSITIONING THE CONTROLS
Click to select the control to move, and then move the control by use of mouse pointers
with the following shapes:
One finger: moves one part at a time
Five fingers: moves both the label and the control field
Re-sizing can be done by pointing and dragging the dark spots.
DELETING A CONTROL
Click on the control to select it and then press the delete key
Microsoft Word Basics
Microsoft Word has a completely redesigned user interface. The standard menus along the top
have been removed and replaced with a series of toolbars Microsoft calls “The Ribbon.” These tool
bars are changed using tabs at the top and try to automatically adjust themselves to the content you
are working with. If you select an image it will automatically switch to the picture tools. The new
layout seems to offer easier access to most of the features of Word allowing for more complex
documents to be created quicker.
Save as
The save as option will provide you with the
most common file formats to save your
document in. The common ones are Word
Document, Word Template, and Word 97-
2003 document. The last
one is the option most people should be using currently, especially if they wish to share documents with
others who do not have the new version of Office.
Print
Here you can choose from Print, Quick Print and Print Preview. Print brings up the standard print dialog
box, quick print will print one copy without any dialog box coming up and print preview will bring up the
print preview screen.
Prepare
The prepare menu’s most common options are Properties, Inspect Document, Mark as Final and
Run Compatibility Checker. The properties option allows you to setup metadata for the document
like Author, Title, keywords, comments and others. Inspect Document will scan the document for
any hidden data like comments and annotations, and any hidden collaboration data. This is very
useful when making a previously private document public. It will help you find any comments or
changes made previously that should not be made public. Mark as Final will mark the document
as a final copy and make it read only so changes cannot be made. The last common item, Run
Compatibility Checker will scan the document for new features that were used and show you these.
This is recommended if you where creating a document in the new file format but now need to
convert it back to the Office 2003 format to share with someone who does not have Office 2007.
The home tab the basic formatting tools found in Word 2007. You will find five sections,
Clipboard, Font, Paragraph, Styles and Editing. Clicking the down arrow beside any of the icons
here will drop down more options for that tool. Each section also contains an arrow in the bottom
right corner which will open a window containing the options found in that section.
Clipboard
The Clipboard allows you to cut, copy, paste and copy formatting from one place to
another.
Font
The font section of the ribbon provides a section to
handle the basic text formatting. Items such as bold,
underline, strikethrough, highlight and font type can be
changed here. Some items from this section and some
items from the paragraph section are also available by
highlighting text and moving your cursor slightly above
the highlighted text. This saves having to move your
cursor all the way to the top of the screen for some
common formatting items.
Paragraph
The paragraph section provides icons for bullets, lists,
justify, line spacing, indents and borders.
Styles
The styles section allows you to quickly
change the formatting of a section of text
by choosing one of the predefined styles.
You
can also create a new style based on the formatting of your selected text for use later in other
sections of your document.
Editing
The Editing section of the toolbar allows you to find, replace and select items.
The select option gives you the ability to select all, select objects or select text
with similar formatting. This last option gives you the ability to quickly change
everything in your
document with one style to another style without having to manually find all of that text
and change each area separately.
Insert Tab
The insert tab has seven sections for inserting most types of objects. The sections are pages, tables,
illustrations, links, header and footer, text and symbols.
Pages
The pages section is where you can go to insert an cover page, blank page or page
break. The cover page drop down offers a selection of predefined cover pages for
your document that have sections for title, date and author. You can also select
text in your document and choose to save the selected text to the cover page
gallery for use in future documents.
Table
The table section only has a drop down menu which offers a grid to create a new
table, insert table, draw table, convert text to table for selected text, Excel
spreadsheet, and some predefined “Quick Tables” that have formatting already setup for
you. When working on a
table you will have two additional tabs along the top of the ribbon, the design and
layout tabs. There are screenshots of both directly below.
Table Design
Table Layout
Illustrations
The Illustrations section allows you to insert pictures, clipart, shapes,
SmartArt and charts. After inserting or selecting a picture you are
provided with a new toolbar along the top shown here. This toolbar gives you the ability to change the
brightness, contrast, shape, position, text wrapping and other options for the picture. Clicking off
the picture or on one of the other tabs will take you back to the standard toolbars. The Shapes
option of the
Illustrations section allows you to insert lines, arrows, boxes, basic flowchart shapes and a number of
others. The SmartArt option provides features like org charts, flow charts, illustrated lists and processes.
The Chart option is similar to Word 2003 but it offers more options for your charts.
Links
The links section provides options for inserting hyperlinks, bookmarks and
crossT references. Cross-references can link to figures, tables, equations,
endnotes, footnotes, headers and numbered items.
Text
Options in the text section include text box, drop cap, WordArt and
a number of predefined text blocks like a signature line the date
and time, and document properties like abstract, author, and title.
There are a lot of option in here to setup on your own or you can use Words predefined options.
Symbols
The last option in the insert toolbar is symbols. Here you can insert a large number of special
characters and symbols. Choosing the “more symbols” option from the drop down will also allow you
to setup shortcut keys for commonly used symbols. One of the improved features of Word 2007 is
the equation editor. You can now insert more complicated mathematical and statistical equations.
Here there are some standard equations to chose from or you can create your own. Standards like
while creating your own equation. The equations can be edited in the new
Word 2007 file format however, once they are converted to a Word 2003 format they will
become images which cannot be edited.
The page layout tab has five sections, Themes, Page Setup, Page Background, Paragraph, and Arrange.
Themes
The themes section provides a quick way to format your document. By choosing
a theme you will have a set colour scheme, font combinations, and effects. You
can choose one of the provided themes, modify a provided them or create your
own. You can also go online in this section and browseMicrosoft.comfor additional
themes. Be
aware that changing your theme after creating a document may require you to reformat some items
as themes also include some layout options.
Page Setup
Page setup provides you with the tools to change
margins, size, orientation, columns, breaks, line numbers
and hyphenation in the document.
Page Background
The page background section allows you to change the background colour of
the document, watermark and draft or confidential document or add borders to
your document.
Paragraph
The paragraph section in the page layout tab allows changes to
a paragraphs spacing and indentation.
Arrange
The arrange section is also found in the image toolbar when
an image is selected. Here you can change an images position,
how text moves around the image, the alignment, grouping and
rotation or
the image.
References Tab
The references tab contains six sections, Table of Contents, Footnotes, Citations &
Bibliography, Captions, Indexes and Table of Authorities.
Table of Contents
The table of contents section allows you to insert and modify the table
of contents. You can insert automatic or manual table of contents and
change
what styles will be included in the table of contents, if any. You can also
add text to the table and update the table of contents after adding or removing items from your
document.
Footnotes
This section allows you to insert footnotes and endnotes and move through your existing footnotes
quickly.
Captions
Insert captions, table of figures, or cross-references in this section. Once
you have created a table of figures you can also update the table at
the click of a button.
Index
This section allows you to create an index, update the index and mark and item
for inclusion in the index.
Table of Authority
This section allows you to create a table of authorities, update the table and mark
and citations for inclusion in the table of authorities.
Mailings Tab
The mailings tab contains five sections, create, start mail merge, write & insert fields, preview
results and finish.
Create
The create section provides a window to create envelopes or labels. This is mostly for
creating single envelopes, labels or a sheet of the same label.
Preview Results
This section allows you to preview your merge before completing it.
Make sure all your recipients fit onto one page, the formatting remained
the same after merging, look for specific recipients and even have
Word auto
check for common errors.
Finish
The final section in the mailings tab completes your mail merge.
Review Tab
The review tab offers six sections which include proofing, comments, tracking, changes, compare and
protect.
Proofing
The proofing section provides the standard spelling and grammar check,
a thesaurus, word count, research tools that include MSN search and
Microsoft
Encarta encyclopedia. You will also find translation tools to help with
single words or the whole document. The translation of the entire document is done by an online
service called Wordlingo.
Comments
The comments section allows you to add comments to a document for
easier collaboration. You can cycle through the comments to find out what
notes you left
for yourself or others and you can delete a comment that was made when it is
no longer relevant.
Tracking
The tracking section can be very helpful with a document that
changes a lot while composing it. You can track the changes made,
who made them and show the changes in balloons off to the side. Be aware that you must turn this
on before it will start to work. Tracking changes does not occur on every document automatically.
You should also be aware that unless you clear the changes once the document is final they may be
visible to others who receive the document even though older changes were not intended for others to
view. You can find all the revisions by turning on the balloons for revisions and checking each on and
accepting or rejecting it by right clicking on the balloon and choosing the correct option. You can also
clear them with the options in the next section of the review tab.
Changes
The changes section allows you to cycle through and accept or reject changes made to
the document and tracked using the track changes feature. This should be done
before the document is considered final so any changes can be cleared and no longer
visible if the document is distributed to anyone who should not have access to the revisions and
comments.
Compare
This section can be used to compare two versions or a document or help
you combine two versions of a document. This can be very helpful when
you find you
have accidentally been working on one version on your local drive and another
on the network. You can take the two documents and step through them combining them instead
of redoing work that was already done.
Protect
The protect section gives you options to add a password and protect the document. You
can restrict changes to formatting and editing or the whole document. If you use
Windows Live you can also manage permissions for specific users who also have Windows
View Tab
The view tab offers five sections which include document views, show/hide, zoom, window and macros.
Document Views
The document views section switches you between print layout, full
screen reading, web layout, outline and draft views. Print layout is
the default view. Full screen view removes all but a couple of
tools from the top of the screen and the rest of the screen is your document. Web layout will take
away the empty space on either side of the document if there is any and fill the window as if it were a
web page. Outline view changes the look of your document into an almost point form style which may
help with reviewing main points. Draft view takes away most of your formatting and images and just
shows the text. It also fills the window with your text similar to web layout.
Show/Hide
The show/hide section will toggle certain tools on or off the
screen including rulers, gridlines, message bar, document map and
thumbnails.
The rulers will show along the top and left side of the screen. Gridlines
will cover your entire document inside the margins. They will be visible on screen but don’t print.
The message bar can only be displayed when there is a message to be displayed. One common
reason for
the message bar to display is when macros have been enabled or disabled. The document map
and thumbnails will show along the left hand side of the screen.
Zoom
The zoom section provides tools to zoom into or out of the document.
You can choose your own zoom factor or use one of the predefined
zoom factors of
100%, one page, two pages(side by side), or page width which causes
the document to zoom in or out so it fills your window.
Window
The new window button will open your
current document in a new window. The
arrange all
button will take your currently open windows
and stack them one on top of the other. The split button will take your current document and show
it in two frames within the window one on top of the other. This will allow you to look at something
you wrote on page one while working on page twenty. View side by side allows you to view two
windows side by side, once in side by side view you can turn on synchronous scrolling so both side
scroll at the same time. Also while in side by side mode if you resized either window you can
click the reset window position button to have them share the screen equally again. The
switch window drop down will allow you to switch between open windows.
Macros
The macros section provides the tools required to work with and create basic macros. You
can view existing macros or record your own. Choose record macro from the drop down and
then perform the functions you do often, like change the page layout, and style of the
document.
Once you have done those tasks then stop recording. You will be able to use that macro over again
to shorten the steps you need to take every time you need to perform that set of tasks.
Introduction to Microsoft Excel
Basics of Excel
What is Microsoft Excel?
Microsoft Excel is a spreadsheet developed by Microsoft for Windows, macOS, Android and
iOS. It features calculation, graphing tools, pivot tables, macros, and a macro programming
language called Visual Basic for Applications
Microsoft Excel is a spreadsheet program that is used to record and analyse numerical data.
Think of a spreadsheet as a collection of columns and rows that form a table. Alphabetical letters
are usually assigned to columns and numbers are usually assigned to rows. The point where a
column and a row meet is called a cell. The address of a cell is given by the letter representing
the column and the number representing a row. Let's illustrate this using the following image.
Understanding the Ribbon
The ribbon provides shortcuts to commands in Excel. A command is an action that the user
performs. An example of a command is creating a new document, printing a documenting, etc.
The image below shows the ribbon used in Excel 2013.
Ribbon start button - it is used to access commands i.e. creating new documents, saving
existing work, printing, accessing the options for customizing Excel, etc.
Ribbon tabs – the tabs are used to group similar commands together. The home tab is used for
basic commands such as formatting the data to make it more presentable, sorting and finding
specific data within the spreadsheet.
Ribbon bar – the bars are used to group similar commands together. As an example, the
Alignment ribbon bar is used to group all the commands that are used to align data together.
A worksheet is a collection of rows and columns. When a row and a column meet, they form a
cell. Cells are used to record data. Each cell is uniquely identified using a cell address. Columns
are usually labelled with letters while rows are usually numbers.
Excel Shortcuts
F2 Edit None
F4 Repeat last action Edit, Repeat. Works while not in Edit mode.
Ctrl+" Copy Value from Cell Above Edit, Paste Special, Value
5. Check Transpose.
6. Click OK.
Transpose Function
To insert the TRANSPOSE function, execute the following steps.
Note: The formula bar indicates that this is an array formula by enclosing it in curly braces {}. To
delete this array formula, select the range E2:E4 and press Delete.
CARBON COPY
Click Format on Excel’s Home menu.
Choose Move or Copy Sheet.
At this point the Move or Copy dialog box appears:
1. Copying within the same workbook: Click Create a Copy and then click OK.
2. Copying to another workbook: Select the workbook name from the To Book list,
click Create a Copy, and then click OK.
3. Moving a sheet to another workbook: Select the workbook name from the To
Book list, and then click OK.
Formula Result
Take care to observe these rules when creating your own formulae.
=3+2*4 11
Incorrect syntax will result in error.
=(3+2)*4 20
Editing a formula
1. Double-click on the cell containing the formula. The cell will switch from displaying the
result of the formula to the formula itself.
2. Click the mouse over the part of the formula you wish to change to insert the cursor there.
Type any new character or use the Backspace or Delete keys to remove characters.
3. Press Enter to confirm your changes, or Esc to exit the cell without saving your changes.
or
1. Move to the cell containing the formula you wish to change.
2. The formula will be displayed in the formula bar.
3. Click into the formula bar and make the necessary changes.
4. Click on the green tick to the left of the formula to confirm your change, or the red cross to
close the formula without saving your changes.
or
1. Move to the cell containing the formula you wish to change and press the F2 key.
2. Use the arrow keys to move the cursor to the edit position. Make your changes and exit the
cell as explained above.
Copying formulae
Formulae can be copied using the Copy and Paste buttons in the same way as data can be copied
in a worksheet.
1. Select the cell containing the formula to be copied.
2. From the Edit menu choose Copy (or use the Copy icon).
3. Move the cursor to the new location.
4. From the Edit menu choose Paste (or use the Paste icon).
Note how the cell references change as we copy the formula from cell A2 to cell B2 below left.
=A1 becomes =B1
Note how the cell references change as we copy the formula from cell A2 to cell A3 below right.
=A1 becomes =A2
Notice how the
Notice how the reference reference
changes by one column changes by one
relative to its starting row relative to its
position. starting position.
Functions are usually written with the equals sign (=) followed by the function name and then
parentheses containing the argument. Usually the argument just contains the range of cells which
the function will operate on. For example, the Average function is written as:
= AVERAGE(A1:A4)
function
name argument
The argument of a function is placed in brackets. To specify a range of cells a colon is used
between the first and the last cell address. For example, (A1:A4) will specify cells A1, A2, A3
and A4.
The Sum function is a useful function. It simply adds together a range of cell values. The
formula:
=A1+A2+A3+A4+A5+A6+A7+A8
can be replaced by:
=SUM(A1:A8)
This adds up the contents of the cells A1 to A8.
The function can be typed at the keyboard like any other formula.
The function can be created with the Insert Function.
The SUM function can be created using the AutoSum button (this is the easiest method).
AutoSum
The AutoSum feature allows you to add all numbers in a contiguous row or column.
To use AutoSum:
1. Click a cell below the column of numbers or to the right of the row of numbers.
2. Click the AutoSum button on the Standard toolbar, and then press Enter.
Excel automatically guesses the range of cell references that you wish to sum (these can be
amended if necessary).
Note: Always check automatically generated formulae before accepting them, as Excel doesn’t
always guess correctly.
Some Basic Functions
Returns the
absolute
ABS =ABS(number)
value of a
number
Multiplies its
PRODUCT =PRODUCT(number1,number2,…)
arguments
Rounds a
number to a
ROUND =ROUND(number,num_digits) specified
number of
digits
Rounds a
ROUNDDOW number
=ROUNDDOWN(number,num_digits)
N down, toward
zero
Rounds a
number up,
ROUNDUP =ROUNDUP(number,num_digits)
away from
zero
Adds its
SUM =SUM(number1,number2,…)
arguments
Adds the
cells
SUMIF =SUMIF(range,criteria,[sum_range]) specified by
a given
criteria
Returns the
sum of the
SUMPRODUC =SUMPRODUCT(array1,array2,[array3], products of
T …) correspondin
g array
components
Rounds a
number to
the nearest
CEILING =CEILING(number,significance) integer or to
the nearest
multiple of
significance
Returns the
average of
AVERAGE =AVERAGE(number1,number2,…)
its
arguments
Returns the
average
(arithmetic
mean) of all
AVERAGEIF =AVERAGEIF(range,criteria,[average_range]) the cells in
a range that
meet a
given
criteria
Counts how
many
COUNT =COUNT(value1,value2,…) numbers are
in the list of
arguments
Counts how
many
COUNTA =COUNTA(value1,value2,…) values are
in the list of
arguments
Counts the
number of
COUNTIF =COUNTIF(range,criteria) cells within
a range that
meet the
given
criteria
Returns the
maximum
MAX =MAX(number1,number2,…) value in a
list of
arguments
Returns the
median of
MEDIAN =MEDIAN(number1,number2,…)
the given
numbers
Returns the
minimum
MIN =MIN(number1,number2,…) value in a
list of
arguments
Formats a
number and
TEXT =TEXT(value,format_text)
converts it
to text
Type a $ sign before both the column letter and the row number of the cell reference. E.g. the
relative reference A1 becomes the absolute reference $A$1.
Or use the keyboard shortcut, F4.
1. In the Formula bar, highlight the cell reference for the cell which is to be made absolute.
2. Press F4.
$ signs are automatically placed in front of the column and row references.
Common Errors
The following are some errors that may appear in a spreadsheet (there are others too).
#######
Cell is too narrow to display the results of the formula. To fix this simply make the column wider
and the “real” value will be displayed instead of the ###### signs. Note that even when the
###### signs are being displayed, Excel still uses the “real” value to calculate formulas that
reference this cell.
#NAME?
You used a cell reference in the formula that is not formed correctly (e.g. =BB+10 instead of
=B3+10)
#VALUE!
Usually the result of trying to do math with a textual value. Example: =A1*3 where A1 contains
the word “hello”
#DIV/0!
Trying to divide by zero. Example: =3/A1 where A1 contains 0 (zero)
Circular Reference
Using a formula that contains a reference to the cell that the formula “lives in”. Example: putting
the formula =A1+1 in cell A1 or putting the formula =SUM(A1:B2) in any of the cells A1, B1,
A2, B2
Sorting
Sorting lists is a common spreadsheet task that allows you to easily reorder your data. The most
common type of sorting is alphabetical ordering, which you can do in ascending or descending
order.
You can sort in reverse numerical order by choosing From Largest to Smallest in the list.
Choose what to sort on. In this example, we'll leave the default as Value.
Choose how to order the results. Leave it as A to Z so it is organized
alphabetically.
Click Add Level to add another item to sort by.
Select an option in the Column Then by field. In this example, we chose Unit
Cost.
Choose what to sort on. In this example, we'll leave the default as Value.
Choose how to order the results. Leave it as smallest to largest.
Click OK.
The spreadsheet has been sorted. All of the categories are organized in alphabetical order, and
within each category the unit cost is arranged from smallest to largest.
Remember that all of the information and data is still here—it's just in a different order.
Grouping is a useful Excel feature that gives you control over how the information is displayed.
You must sort before you can group. In this section, we will learn how to create groups using
the Subtotal command.
Filtering cells
Filtering, or temporarily hiding, data in a spreadsheet is simple. This allows you to focus on
specific spreadsheet entries.
To filter data:
Click the Filter command on the Data tab. Drop-down arrows will appear beside
each column heading.
Click the drop-down arrow next to the heading you would like to filter. For
example, if you would like to only view data regarding Flavors, click the drop-
down arrow next to Category.
Filtering may look a little like grouping, but the difference is that now you can filter on another
field if you want to. For example, let’s say you want to see only the vanilla-related flavors. Just
click the drop-down arrow next to Item, then select Text Filters. From the menu,
choose Contains because you want to find any entry that has the word vanilla in it. A dialog box
appears. Type vanilla, then click OK. Now we can see that the data has been filtered again and
that only the vanilla-related flavors appear.
Use the Inventory workbook or any workbook you choose to complete this challenge.
Charts and graphs elevate your data by providing an easy-to-understand visualization of numeric
values. While the terms are often used interchangeably, they are slightly different. Graphs are
the most basic way to represent data visually, and typically display data point values over a
duration of time. Charts are a bit more complex, as they allow you to compare pieces of a data
set relative to the other data in that set. Charts are also considered more visual than graphs, since
they often take a different shape than a generic x- and y-axis.
People often use charts and graphs in presentations to give management, client, or team members
a quick snapshot into progress or results. You can create a chart or graph to represent nearly any
kind of quantitative data — doing so will save you the time and frustration of poring through
spreadsheets to find relationships and trends.
It’s easy to create charts and graphs in Excel, especially since you can also store your data
directly in an Excel Workbook, rather than importing data from another program. Excel also has
a variety of preset chart and graph types so you can select one that best represents the data
relationship(s) you want to highlight.
When to Use Each Chart and Graph Type in Excel
Excel offers a large library of chart and graph types to help visually present your data. While
multiple chart types might “work” for a given data set, it’s important to select a chart type that
best fits with the story you want the data to tell. Of course, you can also add graphical elements
to enhance and customize a chart or graph. In Excel 2016, there are five main categories of
charts or graphs:
Column Charts: Some of the most commonly used charts, column charts, are best used
to compare information or if you have multiple categories of one variable (for example,
multiple products or genres). Excel offers seven different column chart types: clustered,
stacked, 100% stacked, 3-D clustered, 3-D stacked, 3-D 100% stacked, and 3-D, pictured
below. Pick the visualization that will best tell your data’s story.
Bar Charts: The main difference between bar charts and column charts are that the bars
are horizontal instead of vertical. You can often use bar charts interchangeably with
column charts, although some prefer column charts when working with negative values
because it is easier to visualize negatives vertically, on a y-axis.
Pie Charts: Use pie charts to compare percentages of a whole (“whole” is the total of the
values in your data). Each value is represented as a piece of the pie so you can identify
the proportions. There are five pie chart types: pie, pie of pie (this breaks out one piece of
the pie into another pie to show its sub-category proportions), bar of pie, 3-D pie, and
doughnut.
Line Charts: A line chart is most useful for showing trends over time, rather than static
data points. The lines connect each data point so that you can see how the value(s)
increased or decreased over a period of time. The seven line chart options are line,
stacked line, 100% stacked line, line with markers, stacked line with markers, 100%
stacked line with markers, and 3-D line.
Scatter Charts: Similar to line graphs, because they are useful for showing change in
variables over time, scatter charts are used specifically to show how one variable affects
another. (This is called correlation.) Note that bubble charts, a popular chart type, is
categorized under scatter. There are seven scatter chart options: scatter, scatter with
smooth lines and markers, scatter with smooth lines, scatter with straight lines and
markers, scatter with straight lines, bubble, and 3-D bubble.
There are also four minor categories. These charts are more use case-specific:
Area: Like line charts, area charts show changes in values over time. However, because
the area beneath each line is solid, area charts are useful to call attention to the
differences in change among multiple variables. There are six area charts: area, stacked
area, 100% stacked area, 3-D area, 3-D stacked area, and 3-D 100% stacked area.
What is an Excel Pivot Table and Chart?
A pivot table is a program tool, that is a built-in feature of MS Excel, allowing you to organize
and summarize selected columns and rows of data in a spreadsheet to obtain a desired report,
helping in visualization of data. A Pivot Chart is therefore, a pictorial representation, that too, is
a built-in feature of MS Excel and is a visual representation of a Pivot Table.
A pivot chart is especially useful for user when dealing with tremendous amounts of data. For
example, a society having a large number of employees is maintaining the working hours of each
pupil through Excel, such that at the end of each month, the employee with the highest number
of working hours, would be provided a bonus, due to the sincerity and devotion to the society.
While dealing with the complete list of society members would be very time consuming and may
even be erroneous, a pivot table, or a pivot chart, for that matter, would allow quickly
reorganizing and visualizing data in an understandable manner and facilitate the entire process.
Note: It is a built-in feature of both, Microsoft Excel and Microsoft Access. While in case of MS
Excel, a pivot chart can easily be copied or pasted within MS Excel as well as amongst other MS
Office Software, a pivot chart cannot be copied and pasted in MS Access.
Inserting Pivot Chart in MS Excel:
The following steps need to be performed sequentially in order to insert Pivot Chart in MS
Excel:
Note: Any changes or modifications that a user makes in the pivot chart are automatically and
immediately reflected in pivot table or vice versa; that is, they are interdependent Excel tools.
2. Remove the Country filter and add the Category Field as a filter to create a filtered Pivot Table,
and thus, a Pivot Chart by category.
VLOOKUP
VLOOKUP
VLOOKUP is an Excel function to look up data in a table organized vertically. VLOOKUP
supports approximate and exact matching
=VLOOKUP (value, table, col_index, [range_lookup])
value - The value to look for in the first column of a table.
table - The table from which to retrieve a value.
col_index - The column in the table from which to retrieve a value.
range_lookup - [optional] TRUE = approximate match (default). FALSE = exact matc
HLOOKUP
HLOOKUP is an Excel function to lookup and retrieve data from a specific row in table. The
"H" in HLOOKUP stands for "horizontal", where lookup values appear in the first row of the
table, moving horizontally to the right. HLOOKUP supports approximate and exact matching,
and wildcards (* ?) for finding partial matches.
Conditional formatting is a feature in many spreadsheet applications that allows you to apply
specific formatting to cells that meet certain criteria. It is most often used as color-based
formatting to highlight, emphasize, or differentiate among data and information stored in a
spreadsheet.
Conditional formatting enables spreadsheet users to do a number of things. First and foremost, it
calls attention to important data points such as deadlines, at-risk tasks, or budget items. It can
also make large data sets more digestible by breaking up the wall of numbers with a visual
organizational component. Finally, conditional formatting can transform your spreadsheet (that
previously only stored data) into a dependable “alert” system that highlights key information and
keeps you on top of your workload.
Originally a powerful feature of Excel, other spreadsheet applications have also adopted this
functionality.
Conditional Formatting Basics
Before we walk you through creating and applying conditional formatting, you should
understand the basics of how it works. The following structural aspects of Excel conditional
formatting will guide how you create and apply rules:
If-Then Logic: All conditional formatting rules are based on simple if-then logic: if X
criteria is true, then Y formatting will be applied (this is often written as p → q, or if p is
true, then apply q). You won’t have to hard-code any logic, though - Excel and other
spreadsheet apps have built-in parameters so you can simply select the conditions you
want the rules to meet. Advanced users can also apply the program’s built-in formulas to
logic rules.
Preset Conditions: Excel has a huge library of preset rules encompassing nearly all
functions that beginner users will want to apply. We’ll familiarize you with several of the
most popular ones in the next section.
Custom Conditions: For situations where you want to manipulate a preset condition,
you can create your own rules. If appropriate, you can use Excel formulas in the rules you
write.
Applying Multiple Conditions: You can apply multiple rules to a single cell or range of
cells. However, be aware of rule hierarchy and precedence - we’ll show you how to
manage stacked rules in the walkthrough.
Overall, applying conditional formatting is an easy way to keep you and your team members up
to date with your data - calling visual attention to important dates and deadlines, tasks and
assignments, budget constraints, and anything else you might want to highlight. When applied
correctly, conditional formatting will make you more productive by reducing time spent
manually combing data and making it easier to identify trends, so you can focus on the big
decisions.
Tip: You can only apply conditional formatting in the desktop version of Excel. Excel for Office
365, the cloud-based web application, allows you to view conditional formatting, but not edit or
apply new rules.
Highlight rules apply color formatting to cells that meet specific criteria that you define. They
are the most basic type of conditional formatting rule, and Excel provides a variety of preset
highlight functions.
1. Open an existing spreadsheet in Excel, or start from scratch and manually enter new data.
In this example, we’re using an inventory list that tracks the number of each item
currently in stock, as well as some additional information about each product.
2. To apply highlight rules, select the range of values you want to apply a rule to. For this
example, we want to highlight any product that’s quantity is less than 100 units. So,
select the values in the Qty. column (C4:C26).
3. From the Home tab, click Conditional Formatting on the right side of the toolbar, and
click Highlight Cells Rules from the dropdown menu. Click Less than.
4. A box will appear. Type 100 in the empty field. Click OK.
5. Your spreadsheet will now reflect this highlight rule, with the quantities less than 100
highlighted red with red text.
Tip: You can change the color of the highlighted cell by clicking on the Format
with: dropdown menu and selecting on another option.
6. To highlight text cells, repeat step 2. This time, we want to highlight certain model types
(M compatible), so we’ll select the cells in the Item name column.
7. Click Conditional Formatting > Highlight Cells Rules > Text that Contains…
8. Type M compatible in the text box. To differentiate from our previous highlight rule,
select green fill with dark green text from the Format with: dropdown menu. Click OK.
9. Now, cells containing the text M compatible are highlighted.
Using these same steps and menu options, you can apply highlight rules to find Duplicate
Values, Dates, or values that are Greater than…, Equal to…, or Between… values that you
select. All of these possibilities are available through the menu options.
Top/Bottom rules are another useful preset in Excel. These rules allow you to call attention to the
top or bottom range of cells, which you can specify by number, percentage, or average.
1. In this example, we’ll highlight the bottom five total stock values. Click the top of
the Total value of stock column to select these cells.
2. Click Conditional Formatting > Top/Bottom Rules > Bottom 10 Items… (The default
number and percent in Top/Bottom rules in Excel is 10, but you can change that number
in the New Formatting Rule box.)
3. In the box that appears, change 10 to 5, since we only want the bottom five values. Since
we already have a red fill highlight rule, click the dropdown menu and select yellow fill
with dark yellow text. Click OK.
4. Your sheet will now highlight the bottom five values in the Total value of stock column,
and update as you add to your data set.
Step 3: Apply Data Bars
Data bars apply a visual bar within each cell. The length of the bar relates the value of the cell to
other cell values in the selected range.
1. We’ll apply data bars to the Qty. column so we can easily assess the ratios of items in
stock. Click the top of the Qty. column to select this range of cells.
2. Click Conditional Formatting > Data Bars. You’ll see two options - one for Gradient
Fill and one for Solid Fill. They function identically; just select the option and color you
prefer.
3. Your sheet will now reflect the added rule.
Color scales are similar to data bars in that they relate a cell’s values in a selected range.
However, instead of representing this relationship by the length of a bar, color scales do so with
color gradients. One color is assigned the “lowest” value and another the “highest,” with a range
of colors in between.
1. We’ll apply color scales to our Selling price column. Click the top of column D to select
this range.
2. Click Conditional Formatting > Color Scales. You’ll see a variety of different color
ranges; select the one you want.
3. Your spreadsheet now shows the selling prices by color - red cells are the most
expensive, and green cells are the least expensive.
Step 5: Apply Icon Sets
Icon sets apply colorful icons to data. They are simply another way to call attention to important
data, and relate cells to one another.
1. We’ll apply icon sets to the Purchase price column to show low, middle, and high priced
items. Click the top of the Purchase price column to select the range of values.
2. Click Conditional Formatting > Icon Sets. You’ll see a variety of options
for Directional, Shapes, Indicators, and Ratings icons. You can choose any of these to fit
the needs of your data. In this example, we’ll choose the first Directional option: red,
yellow, and green arrows that indicate high, middle, or low priced items.
3. Your sheet reflects this new formatting rule.
Now you’ve learned the most common conditional formatting presets in Excel, your spreadsheet
provides a lot of information at a glance. However, you might want to edit some of these rules
later on, or delete them completely.
1. Click Conditional Formatting and select Manage Rules… from the dropdown list.
2. The Manage Rules box will appear. Click the dropdown menu at the top of the box and
click This Sheet to list the conditional formatting rules you have applied to the current
sheet.
3. To edit a rule, click the rule you want to change. In this example, we want to highlight
the bottom ten values in the Total value of stock column, rather than the bottom five that
we currently have highlighted. Click the Bottom 5 row. Then, click Edit Rule… at the
bottom of the box.
4. A new box opens where you can adjust the conditions of the rule. Type 10 in the number
field and click OK.
5. Excel will bring you back to the Manage Rules box. You must click OK to save the
changes you made to the original rule.
`
6. To delete a rule, return to the Manage Rules box and choose This Sheet. Click the rule
you want to delete - in this case, the color grading on Selling price. Click the - symbol
(next to Edit Rule…) in the lower left hand corner. Click OK.
7. The conditional formatting on the Selling price column is now deleted.
Macro
A macro is a code written in VBA (Visual Basic for Applications) that allows you to run a chunk
of code whenever it is executed.
Often, you will find people (including myself) refer to a VBA code as a macro – whether it’s
generated by using a macro recorder or has been written manually.
When you record a macro, Excel closely watches the steps you’re taking and notes it down in a
language that it understands – which is VBA.
And since Excel is a really good note taker, it creates a very detailed code (as we will see later in
this tutorial).
Now, when you stop the recording, save the macro, and run it, Excel simply goes back to the
VBA code it generated and follows the exact same steps.
This means that even if you know nothing about VBA, you can automate some tasks just by
letting Excel record your steps once and then reuse these later.
The first step to record a macro is to get the Developer tab in the ribbon.
If you can already see the developer tab in the ribbon, go to the next section, else follow the
below steps:
Right-click on any of the existing tabs in the ribbon and click on ‘Customize the Ribbon’
option. It will open the Excel Options dialogue box.
In the Excel Options dialogue box, you will have the Customize the Ribbon options. On
the right, within the Main Tabs pane, check the Developer option.
Click OK.
The above steps would make the Developer tab available in the ribbon area.
Let’s record a very simple macro – one that selects a cell and enters the text ‘Excel’ in it. I am
using the text ‘Excel’ while recording this macro, but feel free to enter your name or any other
text that you like.
2. In the Code group, click on the Macro button. This will open the ‘Record Macro’ dialog
box.
3. In the Record Macro dialog box, enter a name for your macro. I am using the
name EnterText. There are some naming conditions that you need to follow when
naming a macro. For example, you can not use spaces in between. I usually prefer to keep
my macro names as a single word, with different parts with a capitalized first alphabet.
You can also use underscore to separate two words – such as Enter_Text.
4. (Optional Step) You can assign a keyboard shortcut if you want. In this case, we will use
the shortcut Control + Shift + N. Remember that the shortcut you assign here would
override any existing shorcuts in your workbook. For example, if you assign the shortcut
Control + S, you will not be able to use this for saving the workbook (instead, everytime
you use it, it will execute the macro).
5. In the ‘Store macro in’ option, make sure ‘This Workbook’ is selected. This step ensures
that the macro is a part of the workbook. It will be there when you save it and reopen
again, or even if you share it with someone.
6. (Optional Step) Enter a description. I usually don’t do this, but if you’re extremely
organized, you may want to add what the macro is about.
7. Click OK. As soon as you click OK, it starts to record your actions in Excel. You can see
the ‘Stop recording’ button in the Developer tab, which indicates that the macro
recording is in progress.
9. Enter the text Excel (or you can use your name).
10. Hit the Enter key. This will select cell A3.
1. Delete the text in cell A2. This is to test if the macro inserts the text in cell A2 or not.
2. Select any cell – other than A2. This is to test whether the macro selects cell A2 or not.
8. Now, this may all happen in a split second, but in reality, the macro – just like an
obedient elf – followed the exact steps you showed it while recording the macro.
9. So the macro first selects the cell A2, then enters the text Excel in it, and then selects the
cell A3.