You are on page 1of 44

MS EXCEL LABS

You are required to download the Excel Labs 2014-15 file and the Salesperson
Data file from the course website. Please make sure you have a USB stick for the
course. You are strongly encouraged to work ahead.

IMPORTANT: IF YOU MISS A SCHEDULED LAB, IT IS YOUR


RESPONSIBILITY TO CATCH UP! LABS WILL PROCEED AS PER THE
WEEKS AND EXERCISES IN THIS HANDOUT.

EXERCISE I (WEEK 1)
The figure below points out the main features of the Excel window.

The following list describes each of the features:

 Ribbon: This is the multi-tabbed toolbar system that contains buttons and other controls for
issuing commands.
 Microsoft Office Button: Opens the only real "menu" in Excel 2007 -- the Office menu -- which
contains commands for saving, opening, and printing files.
 Tabs: A tab is an individual page of the Ribbon. For example, the Home tab.
 Groups: Each Ribbon tab has named sections called groups. For example, the Home tab has the
following groups: Clipboard, Font, Alignment etc.
 Quick Access Toolbar: This is a highly customizable portion of the interface; you can place
shortcuts to your favourite buttons and commands here. By default, it contains Save, Undo, and
Redo buttons.
 Insert Function button: You can click this button to get help creating functions.
 Formula bar: This is where the contents of a cell appear and where you can type or edit those
contents.
 Column headers: Each column's letter is a header for that column. You can click the column
letter to select the entire column.

1
 Microsoft Office Excel Help button: You can click this (?) button to open the Excel Help
system, from which you can look up any topic. This is an invaluable tool, and you are
encouraged to use it for problem solving and self-learning.
 Scroll bars: You can use these to scroll within the active worksheet.
 Zoom controls: These buttons, and the slider, control the magnification at which you view the
active worksheet.
 Insert Worksheet tab: You can click this tab to insert another worksheet.
 Worksheet tabs: You can click one of these tabs to switch between worksheets.
 Row headers: Each row's number is a header for that row. You can click the row number to
select the entire row.

Notice that the main part of the spreadsheet is composed of Rows (Labeled 1, 2, 3, 4, etc.) and
Columns (Labeled A, B, C, D, etc.). There are hundreds of columns and thousands of rows in a
spreadsheet. The intersection of each row and column is called a cell. In the image above, the
cursor is on the “home” cell – A1. Notice Row 1 and Column A are bold, and colored orange.
Notice right above cell A1, that A1 is displayed in a small box called the Name Box. This indicates
what is called the “address of the cell. Whenever you click on a cell the address of that cell will be
shown in the Name Box.

If you have used previous versions of Microsoft Excel you will quickly notice that the above image is
very different from what you are used to seeing. In Excel 2007 you will now use Tabs, Ribbons and
Groups, as well as special Tabs/Ribbons. These replace the Menu Bar and Tool bars in older
versions.

In this tutorial, whenever we indicate that you need to click the mouse, it will
mean to click the left mouse button – unless it is indicated that you should click
the RIGHT mouse button. So, always “left click” unless you are told otherwise.
The general setup of the Excel window is similar to that of a WORD window. You will notice
however, the new bar in the EXCEL window – namely the Formula bar, that was not there in the
WORD window.

Using an Excel worksheet - Basic terminology

Worksheets – An Excel file is called a workbook. An Excel workbook is made up of several


sheets. Excel starts you off with three sheets. You can add more sheets when you have used up the
first three.

Cells - Rectangles in a spreadsheet are called cells. Cells are designated by the column and row in
which it is located. By default, the top left cell, A1, is highlighted.

You can move around the spreadsheet/cells by clicking your mouse on various cells, or by using the
up, down, right and left arrow movement keys on the keyboard. Or, you can move up and down
by using the scroll bars on the right and bottom of the spreadsheet.

Recognizing cursor styles - There are four common cursor styles used in Excel.

2
Click and drag to highlight Click and drag with this
multiple cells with this cursor, cursor to fill cell contents
or click in a cell to select the into cells below or to the
single cell right.

Click to place the cursor


Click and drag the contents of
into the Formula bar so that
the selected cell to any other
you can edit an equation or
cell.
function.

Entering data - Move to the cell where you want to enter data and enter words or numbers. If data
is already in the cell it will be replaced without having to cut or delete the previous data.

Editing entered data - If incorrect information has been entered into a cell, one easy way to edit
that is to click on the cell and enter the correct information. You do not need to highlight or delete.
Typing replaces whatever is in the cell.

If you do not want to replace the data, but simply need to correct some part of it, move your cursor
into the Formula bar

When your cursor turns into an I-Beam, click and edit within the formula bar.

Excel’s Delete vs. Clear Options


Excel provides you with two options that are similar but differ in an important way: “Delete” and
“Clear”.
If you select a cell and press the delete key, it will erase the contents of the cell. However, any
formatting options that you may have applied to the cell are NOT erased. For eg., shading, borders,
percentage, bold etc.
If you wish to remove the formatting options you have applied to the cell, click on Clear – Clear
Formats from the Editing group on the Home tab of the Ribbon.

Formulas
Formulas are equations that perform calculations on values in your worksheet. A formula starts with
an equal sign (=). For example, the following formula multiplies 2 by 3 and then adds 5 to the result.
=5+2*3

A formula can also contain any or all of the following: functions, cell addresses, constants and
operators. A function is a built-in formula that takes a value or values, performs an operation, and
returns a value or values. A constant is a value that does not change. An operator specifies the type
of calculation to perform within an expression. There are mathematical, comparison, and logical
operators.

Working with multiple Worksheets


A single data file (a workbook) can have many tabbed
sheets in it. Each sheet is its own separate row-and-column
grid.

Changing the name of the worksheets - The name of the sheet may be changed by double-
clicking the name of the sheet in the tab at the bottom, and typing the new name. Renaming the
worksheet can also be accomplished by right-clicking the tab containing the sheet name and clicking
on Rename.

Inserting additional worksheets - If you need additional worksheets, you can


insert a worksheet by right-clicking on a sheet tab and selecting Insert...

3
You can also add a new worksheet by clicking the Insert
Worksheet tab to the right of the existing sheet tabs.

Deleting worksheets - To delete a sheet, right-click its tab, and


then select Delete. If anything's on that sheet, a warning box appears; if the sheet was empty, it just
goes away. (NOTE: Undo does NOT work on sheet deletions.)

Scrolling through Sheet tabs – When you have a lot of


worksheets, you may not be able to see all the worksheet tabs at
once. You can use the arrow buttons at the left of the tabs to scroll through the worksheet tabs.

Hiding and Redisplaying Sheets - To hide a sheet, right-click its tab, and then select Hide.
To redisplay a hidden sheet, right-click any of the displayed tabs, and then select Unhide. In the
Unhide dialog box, select the sheet to unhide, and then click OK.

Changing a sheet tab color - All tabs start out white by default; however, you can color-code
your workbook by changing the tab colors. To select a tab color, right-click the tab, and then select
Tab Color. On the palette of colors that appears, select the color you want.

Copying and Moving Sheets - To rearrange the sheet order, drag a sheet's tab to the right or left.
If you want to copy a sheet rather than move it, hold down the Ctrl key as you drag it.

Another way to move or copy a sheet is with the Move or Copy command. It's more powerful than
the drag-and-drop method because you can use it to move or copy a sheet from one workbook to
another if desired. To use this command, just select one or more sheets, right-click a selected sheet
tab, and then select Move or Copy from the shortcut menu. (To select multiple sheets, hold down the
Ctrl key as you click each tab, or click the first tab in a contiguous range, and then hold down Shift
while clicking the last tab.) The Move or Copy dialog box opens, in which you can select a
destination workbook and a sheet position within that workbook.

Exercise 1a: Sheet Handling


1. Start a new blank workbook. Save the workbook as File1.
2. Rename the sheets as Sales, Marketing, and Accounting.
3. Add a new sheet at the end. Name this new sheet as Operations.
4. Delete the Marketing sheet.
5. Hide the Operations sheet and the Accounting sheet.
6. Redisplay the Operations sheet and the Accounting sheet.
7. Change the Operations sheet's tab color to red. Set the Sales tab to yellow and set the Accounting
tab to blue.
8. Use the drag-and-drop method to move the Operations sheet to the leftmost position as the very
first sheet.
9. Use the Move or Copy feature to create another copy of the Sales sheet to the right of the
original, and then rename the copy to Marketing. Change the color of the new copy's tab to
green.
10. Use the Move or Copy feature to copy the Accounting and Operations sheets into a new
workbook.
11. Save the new workbook as File2.
12. Use the Move or Copy feature to move the Sales and Marketing sheets from File 1 to the File 2
workbook.
13. Click the Insert Sheet tab to add 10 new worksheets to the File 2 workbook. Practice scrolling
through the worksheets using the arrow buttons to the left of the sheet tabs.
14. Save and close the workbooks.

Exercise 1b:
In a new workbook, set up the spreadsheet as shown below (DO NOT type the letters A, B,….
They are there to indicate the column headings under which data is to be entered). Use the Arrow
Keys on your keyboard to move through the spreadsheet. Note that the Label entries are by default
4
aligned with the left margin of the cell, while the numeric entries are by default aligned with the right
margin of the cell.

A B C D E
NAME TEST 1 TEST 2 TEST 3 TOTAL
John 25 30 12
Henry 20 40 15
Kathy 22 45 18
Simon 25 25 20
Berry 25 30 15

Now follow the given instructions:

1. Move your mouse pointer to cell A3 of your worksheet and select it by single clicking using the
left button of your mouse. Note how the cell A3 becomes the active cell, indicated by the dark
border around it. Note also that the contents of the cell appear in the Formula bar, in this case,
Henry. The address of the cell, A3, appears in the Name Box to the left of the Formula Bar.

NOTE: Selecting a cell involves clicking the mouse button on the desired cell or by moving to
the desired cell using the arrow keys on your keyboard. Once a cell is selected, it becomes the
active cell and (you should see the dark border around it) you can then type in some data into the
cell or make modifications to the existing data in the cell.

2. Now move your mouse pointer to cell C6 and select it. Note the new contents of the Formula Bar
and the Name Box.

3. Select the range of cells C1:C4 by dragging the mouse pointer across these cells.

4. Select the range of cells D2:D5.

5. Now select the range of cells B3:D5. So you see how you can select either single cells or a group
of cells, called a range.

6. Change the label entry TOTAL to TOTAL MARKS. You can do this in one of 2 ways: a)
Double click in the cell E1. You will see the cursor in the cell, indicating that you can edit the
contents. Now, as in WORD, simply position the cursor after the word TOTAL and type in the
required text. You can erase characters by using the Delete or Backspace keys on your keyboard,
or insert text in the position shown by the cursor. Press the ENTER key when you have finished
editing the cell. OR b) Single click the cell E1. Click in the Formula Bar, and position the
cursor in the appropriate location for editing. Press the ENTER key when you have finished
making the changes.

7. Increase the width of the column to accommodate the change in a). To do this move the mouse
pointer to the right vertical edge of the column heading for the column whose width you want to
change. You will notice that the pointer changes shape to a double line with double arrows. Drag
the pointer either left or right to decrease or increase the column width respectively.

8. Put in a formula =B2+C2+D2 for TOTAL MARKS in cell E2. Note how the formula shows up
in the Formula bar, and the result of the calculation appears in the cell. NOTE: You must use the
= sign in front of a formula. If you forget to do this, the entry will be treated as a Label entry, and
you will not see the calculated result in the cell. (You are NOT to manually calculate the totals
and type the results into the cells)

Similarly you can put in formulas for TOTAL MARKS in cells E3 through to E6, carefully noting
the cell addresses. However, instead of typing in the formulas for each row, which can be very
tedious, we will learn to copy the formula to the other cells. Of course, this can be done only if
the basic structure of the formula is the same for all the other rows.

Before copying the formula to the other cells, you should verify the result in the cell where you
have typed in the formula. Since this is the formula that you are going to be copying to the other
cells, if there is an error in this formula, this error will be carried across to all the other cells to
which you are copying it. (GIGO – Garbage In Garbage Out)

5
Having satisfied yourself that the original formula is correct, you can now proceed to copy it to
the other cells. You can do this in one of 2 ways. Try both the ways given. Do it the first way,
and then, delete cells E3:E6, using the Delete key on your keyboard, and then do it the second
way.

Method #1: Select cell E2 – that is, the cell containing the formula that you are going to copy to
the other cells. Click on the Copy button in the Standard toolbar. Next, select the range of cells
that you want to copy the formula to – E3:E6. Click on the Paste button in the Standard toolbar.
(This method is useful when the location you are copying to is not adjacent to the cell
containing the original formula). Press the Esc key on your keyboard to get out of the Copy
operation.

Method #2: Select cell E2. Move your mouse pointer to the lower right hand corner of the cell.
You will see your mouse pointer change to the + shape. At this point, drag your mouse pointer
down the cells that you are copying to – E3:E6. Release the mouse button. Presto! The results
appear as if by magic in all the cells that you selected! (This method is useful when the location
you are copying to is adjacent (vertically/horizontally) to the cell containing the original
formula).

Now that you have copied the formula in cell E2 to cells E3:E6, let us look at how EXCEL has
created these new formulas in cells E3:E6. Select cell E3. Read carefully the contents of the
formula bar. It should say =B3+C3+D3. Move to cell E4. What does the Formula Bar say?
=B4+C4+D4. And so on. So you see that even though the original formula =B2+C2+D2+ has
been replicated, the resulting formulas have their cell addresses automatically modified to suit
their row numbers. The column letters B, C and D have stayed the same in this case, but the row
numbers have changed.

9. Now change Simon’s TEST 2 mark to 40 and note that the TOTAL MARKS for Simon are
automatically recalculated. (You can delete the contents of a cell by simply selecting the cell and
typing in the new contents (this will overwrite the previous contents of the cell), OR by selecting
the cell and erasing the contents of the cell by pressing the DELETE key, and then typing in the
new contents.)

10. Name the worksheet tab Ex1. Do this by double clicking the left mouse button on the sheet tab
that is highlighted and typing in the name you are giving to the worksheet. Press the ENTER key
on your keyboard when you are done. NOTE that naming a worksheet is different from
naming a workbook. A workbook is the file that can hold any number of worksheets, each of
which has a different name. However, a workbook has only one name – the file name given to it
that appears in the Title Bar.

11. Color the Tab. To do this, right click on the tab for the desired worksheet. Click Tab Color.
Choose the desired color. Click OK.

12. Save (using SAVE AS) your workbook (file) to your storage medium under the filename YOUR
NAME EXCEL LABS. NOTE: During the course of this training, you should type each
Exercise that you do in a separate worksheet, but in the same workbook EXCEL LABS.
Therefore, you should have only one file YOUR NAME EXCEL LABS, and you would access
the different exercises in the different worksheets by simply clicking on the appropriate sheet
tabs.

*************************************

6
EXERCISE 2 (WEEK 2)
Set up the worksheet in sheet 2 of your workbook YOUR NAME EXCEL LABS as shown below.

A B C D E
EMPLOYEE NAME GROSS PAY TAXES INSURANCE NET PAY
Gary Smith 23000 5000 1000
Karen King 35000 7000 1400
John Adams 28000 5300 1200
Quincy Jones 40000 7500 1650
Carla Edwards 30000 6500 1100

Now follow the instructions given:

1. Type in the formula for Net Pay for Gary Smith. Hint: NET PAY = GROSS PAY – (the sum of
TAXES and INSURANCE.). NOTE the proper use of brackets in the formula.

2. Copy the formula in cell E2 to cells E3:E6.

3. Let us now format the number cells to display the $ sign in front of the numbers. Let us start with
cell B2. Make this cell the active cell. Then, on the Home tab of the Ribbon, click on the $ sign
on the Number group. You should now see $ 23,000.00 displayed in your cell.
Increase or decrease the number of decimal places displayed by clicking on the Increase
decimal or Decrease decimal button on the Number group. In this exercise, we will
format the cell to show no decimal places.

4. As in Step 2 above, format cells C2 and D2 to show the $ sign with no decimal places.

5. You can see that formatting each cell in the worksheet like this can be quite tedious work. We
can do it more efficiently by selecting at one go all the cells that we want to apply this format to,
and then applying the desired formats. To do this, select cells B2:E6, and then apply the $ format
with 0 decimal places. Presto! All the cells have been set to the desired format at one go! If you
have large numbers that are too wide for the current column width, you will see some ########
in the cells where these numbers are located. If this occurs in your spreadsheet, go ahead and
widen the columns.

6.
EMPLOYEE
NAME

We will wrap the text EMPLOYEE NAME in cell A1 so that it appears as shown above. To do
this, first decrease the column width for the cell so that it is less than what is required for the cell
entry. Then, from the Home tab, use the Wrap Text feature in the Alignment group to display
the label EMPLOYEE NAME as shown above. NOTE: this feature will not work if your column
is wide enough to hold the text.

7. We will now insert a new row in between the rows for Karen King and John Adams. To do this,
first click in cell A4 corresponding to the row for John Adams. Then, from the Cells group of the
Home tab, click on Insert – Insert Sheet Rows. You will notice that the row for John Adams
moves down one, becoming the 5th row, and a new 4th row is inserted above it.

8. Insert the following data in the new row. Michel Parry 30000 6500 1100. Calculate the Net
Pay for Michel.

9. Now format all the Label entries in the first row to Bold. Again, you can either do this the hard
way, by selecting each cell individually, and making it Bold, or by selecting the range of cells,
and then making them Bold at one go.

10. Center all the Label entries in the first row in their cells

11. Let us now format the cells in the table so that we put a border around them. To do this, select
the data that you wish to format, and right click on the selection. Left click on Format Cells
7
from the menu that appears. Click on the Border tab of the Format Cells dialog box. You must
set the Style/Color BEFORE you choose the Outline or Inside options. The Outline option sets
the outside border around the selection, while the Inside option sets the dividing lines within the
selection. Also experiment with Patterns in the same Format Cells box.

12. We will now delete Quincy Jones and all his related data from our worksheet. To do this, click
anywhere on the row for Quincy Jones, i.e., 6. Then, from the Cells group of the Home tab, click
on Delete – Delete Sheet Rows. You will notice that the row for Quincy Jones completely
disappears, while the row below it now moves up. The row for Carla Edwards now becomes the
6th row.

13. Name the worksheet tab as Ex2 and set a Tab color of your choice.

14. Click Save in the File menu to save your workbook.

************************************

EXERCISE 3 (WEEK 2)
Set up the spreadsheet as shown in Sheet 3 of your workbook YOUR NAME EXCEL LABS
A B C D E F
ITEM COST PER # OF TOTAL COST VAT TOTAL COST
ITEM ITEMS BEFORE VAT INCLUDING VAT
Corn Curls 20 5
Pringles 165 3
Cadbury’s 140 2
chocolate
Pepsi 500 ml 65 3
Del Monte 140 1
Tinned Corn
Noel Cookies 65 2

Follow the given instructions:

1. Use the wrap text feature to format the cells as shown above. To make life simpler for yourself,
select the range of cells in row 1 before applying the Wrap Text format. Use center alignment for
the cells in row 1.

2. Type in a formula for TOTAL COST BEFORE VAT in cell D2. (COST PER ITEM * # OF
ITEMS)

3. Having satisfied yourself that the formula in cell D2 is correct, copy it to cells D3:D7.

4. Calculate the VAT in E2 as 16%*TOTAL COST BEFORE VAT for that item.

5. Copy the formula in cell E2 to cells E3:E7.

6. Calculate the TOTAL COST INCLUDING VAT in cell F2 as TOTAL COST BEFORE VAT +
VAT.

7. Copy the formula in cell F2 to cells F3:F7.

8. We will now see how we can put a title for the worksheet. Insert a blank row before the 1st row.

9. In cell A1, type EAT FRESH GROCERY.

10. Now, select cells A1:F1, and click on the Merge and Center option from the
Alignment tab of the Home tab. The merge and center feature joins the selected cells
into one larger cell and centers the contents in the new cell. It is used to create labels

8
that span several columns.

11. Set the text ‘EAT FRESH GROCERY’ to Bold and increase its Font Size to 18 pts.

12. We will now calculate the COMBINED TOTAL COST AFTER TAXES for all the items sold.
However, in this exercise, instead of typing in =F4+F5+F6…., we will use a function called
AutoSum to calculate the sum total.
In cell A11, type in COMBINED TOTAL COST.

13. Select cell F11, where we want the summed TOTAL COST to appear. Click on the AutoSum
option from the Editing group of the Home tab. EXCEL displays the range to be summed. Look
carefully at the range to make sure it is the correct range of cells that you want to sum. Press the
ENTER key on your keyboard. Voila! Your result appears instantaneously! With F11 as your
active cell, note the formula that shows in the Formula Bar.

14. Name the worksheet tab as Ex3. Put in whatever formatting features you wish to make your
worksheet look attractive.

15. Click Save in the File menu to save your workbook.

****************************************

EXERCISE 4 (WEEK 2)
Open the YOUR NAME EXCEL LABS workbook. You will need to insert a new worksheet for this
exercise, since there are only 3 worksheets available by default.

You will find yourself in a new worksheet and you will see a new worksheet tab appear below. You
can move the worksheet tabs to put them in order by simply dragging the desired tab and depositing it
in the new location.

The following table shows cinema attendance over a seven-day period at 4 different cinemas. You are
required to enter this data into a worksheet.

Cinema Attendance
Cinema Mon Tue Wed Thu Fri Sat Sun TOTAL
WEEKLY
ATTENDANCE
Adelphi 178 216 252 222 362 348 127
Ambassador 145 209 276 302 415 405 90
Carlton 192 236 220 246 293 331 75
Classic 86 120 97 113 153 169 101
TOTAL DAILY
ATTENDANCE

Carry out the following tasks:

1. Insert a new row below the Ambassador data and enter the following details on a new cinema that
has opened.
Broadway 220 180 175 215 260 275 150

2. Due to falling attendance, the Carlton has decided to close. Delete the row containing the details
on the Carlton.

3. Insert a new row above the Adelphi data and enter the following details on a new cinema that has
opened:
Acrobat 176 170 215 221 239 233 120

5 Remember to copy the appropriate formulae to show the total weekly attendance at the Acrobat.
(IMPORTANT: Do the Total Daily Attendance figures update automatically? What should you
do to ensure correct results?)

9
6 Insert a new column before the very first column. To do this, select any cell in the Cinema
column. Click on Insert – Insert Sheet Columns from the Cells group of the Home tab. A new
column is inserted to the left of the column Cinema. Number the cinemas as 1, 2, 3, and 4.

7 It is found that the attendance on Sundays is very low, and it is not profitable operating on
Sunday. So, it has been decided to close down the cinemas on Sunday. Delete the column for
Sunday. To delete a column, simply click anywhere in the column to be deleted. Then select
Delete – Delete Sheet Columns from the Cells group of the Home tab.

8 Rename the worksheet tab as Cinema. Put in whatever formatting features you wish to make
your worksheet look attractive. Save the workbook.
***************************************

FUNCTIONS

Excel provides built-in formulas called functions that perform special calculations and make life a
whole lot easier for us. A function, like a formula must start with the = sign. Then we type the
function name. Following the function name are the arguments in ( ). The arguments identify the
data required to perform the desired function.

Excel has a large number of functions for mathematical, statistical, financial and logic operations. In
this course, we will look at some of the commonly used functions.

=SUM(A1:A7) Adds the values in a range of cells; in this case, cells A1:A7
=SUM(A1,A3,A7) adds the values in cells A1, A3 and A7

=MAX(A1:A7) Finds the highest value in a range of cells; in this case cells A1:A7
=MAX(A1,A3,A5:A7) finds the highest of the cells A1, A3, A5, A6 and A7

=MIN(A1:A7) Finds the lowest value in a range of cells; in this case cells A1:A7
=MIN(A1,A3,A5:A7) finds the lowest of the cells A1, A3, A5, A6 and A7

=AVERAGE(A1:A7) Finds the average value of a range of cells; in this case cells A1:A7
=AVERAGE(A1,A3,A5:A7) finds the average of the cells A1, A3, A5, A6 and A7

=COUNT(A1:A7) counts the number of numbers in the range A1:A7


=COUNTA(A1, A3, A5:A7) counts the number of alphanumeric values in the cells A1, A3 and
range A5:A7. Blank cells are not counted.
=COUNTBLANK(A1:A7) counts the number of blank cells in the range A1:A7

IF
The format of an IF function is
=IF(logical_test, value_if_True, value_if_False)
The IF function is used to perform conditional testing of information. Note that the IF function must
have 3 arguments which are separated by the comma.

=IF(A2>45, “PASS”, “FAIL”)


The formula above would test the value in cell A2 against the value 45. If the value in cell A2 is
greater than 45, the result PASS would be displayed in the cell containing the formula. If the value in
cell A2 is less than or equal to 45, the result FAIL would be displayed in the cell containing the
formula.

=TODAY()
This function returns the current date on the system

OR
The format of the OR function is
=OR(logical1, logical2, logical3……)
where logical1, logical2…..are the conditions to be tested.

=OR(1+1=1,2<5)

10
The formula above returns the value True. The OR function returns the value True if any argument is
True; returns the value False if all arguments are False.

AND
The format of the AND function is
=AND(logical1, logical2, logical3……)
where logical1, logical2…..are the conditions to be tested.

=AND(1+1=1,2<5) returns the value False. The AND function returns the value True only if all its
arguments are True; returns the value False if one or more arguments is False.

VLOOKUP
The format of the VLOOKUP function is
=VLOOKUP(lookup_value, table_array, col_index_number,[range_lookup])
The Vlookup function looks for the value specified in the Lookup Value in a specified table range,
and retrieves the value from the column specified.

lookup_value: What value do you want to look up? In this example, the product code is in cell A7,
and you want to find its product name.

table_array: Where is the lookup table? If you use an absolute reference ($A$2:$C$5), instead of a
relative reference (A2:C5), it will be easier to copy to formula to other cells. Or, name the lookup
table, and refer to it by name. In this example, the lookup table is in the Products sheet in the cell
range A2:C5.

col_index_num: Which column has the value you want returned? In this example, the product names
are in the second column of the lookup table.

[range_lookup]: Do you want an exact match? Is an approximate match okay? This is an optional
argument as indicated by the [ ].
If you use TRUE as the last argument, or omit the last argument, an approximate match can be
returned. This example has FALSE as the last argument, so if the product code is not found, the result
will be #N/A.

COUNTIF

The COUNTIF function combines the IF function and COUNT/COUNTA functions in Excel. This
combination allows you to count those values in a selected range of data that meets specific criteria.

The CountIf function has the format


=COUNTIF(range, criteria)

where range - the group of cells the function is to search for the condition.
Criteria - this value is compared with the data in the Range cells. If a match is found then the cell in
the Range is counted. Actual data or the cell reference to the data can be entered for this argument.

=COUNTIF(A1:A7, “PASS”)
For example, the formula above would count the number of cells containing Pass in the cells A1:A7

CONCATENATE

This function combines multiple strings and displays them as one text string. The CONCATENATE
function has the format
=CONCATENATE(text1, text2, …)

11
where text1, text2….are the strings to be joined together. You can use either cell references or
text strings or both as arguments.

MID
This function returns the characters from the middle of a text string, given a starting position and
length. The user defines the starting position and number of characters to extract. The MID function
has the format
=MID(text, start_num, num_chars)
where text is the text string, start_num is a number indicating the start position of the string to be
extracted, and num_chars is a number indicating the length of the string to be extracted.

Similarly, Excel also has the LEFT and RIGHT functions which return characters from the left/right
of a string.

SUMIF

The SUMIF function combines the IF function and SUM function in Excel. This combination allows
you to add up those values in a selected range of data that meets specific criteria. The IF portion of
the function determines what data meets the specified criteria and the SUM part does the addition.

The SUMIF function has the format


=SUMIF(range, criteria, [sum_range])

The function's arguments tell the function what condition we are testing for and what range of data to
sum when the condition is met.

range - the group of cells the function is to search.


criteria - this value is compared with the data in the cell range. If a match is found then the
corresponding data in the sum_range is added up. Actual data or the cell reference to the data can be
entered for this argument.
sum_range (optional) - the data in this range of cells is added up when matches are found between
the range argument and the criteria. If this range is omitted, the first range is summed instead.

=SUMIF(A1:A7, “=secretary”, B1:B7)


For example if you had a worksheet listing the salaries for employees in an organization, you could
total the sum of the salaries for secretaries only by using the above formula. In this case, the
designations would be in cells A1:A7, and the corresponding salaries would be in cells B1:B7.
SUMIF uses a running total.
You can leave the sum_range argument out if you want to sum the same range that you are testing.
For example, =SUMIF(B1:B7,”<=30000”) This formula calculates the total of all values in the
range B1:B7 that are less than or equal to 30000.

SUMIFS
SUMIF and COUNTIF test for a single condition or criteria. But what if you want to test 2 or more
criteria? New in Excel 2007 is the SUMIFS() function which extends the functionality of SUMIF()
by allowing the inclusion of multiple range/criteria pairs.

The SUMIFS function adds up the data in selected cells when specific criteria are met in two or more
ranges of data. The SUMIFS function works like the AND function in that it only sums the data if
the criterion for each range is true.

The format of the SUMIFS function is:

=SUMIFS ( Sum_range, Criteria_range1, Criteria1, Criteria_range2, Criteria2, ...)

Sum_range - the range of cells to be added.


Criteria_range - the range of cells the function is to search.
Criteria - determines whether a cell in the Sum_range is to be added or not.

12
COUNTIFS

The COUNTIFS function, similar to Excel's COUNTIF function, counts up the number of times data
in two or more cell ranges meets multiple criteria. The ranges must be of identical size, and the
function only counts instances where the criterion for each range is met simultaneously - such as in
the same row.

The format of the COUNTIFS function is:

=COUNTIFS( Criteria_range-1, Criteria-1, Criteria_range-2, Criteria-2, ...)

Criteria_range - the group of cells the function is to search.


Criteria - determines whether the cell is to be counted or not.

Note: Up to 127 range/criteria pairs can be entered into the SUMIFS and COUNTIFS functions.

EXERCISE 5 (WEEK 3)
Exercises 5 and 6 introduce you to the IF function.

The following table calculates the total entry prices for visitors to the zoo. The standard entry prices
are shown in cells B12 to B13. Groups of more than 9 persons are entitled to a 10% discount.

Set up the spreadsheet as shown in your workbook Excel Labs..


1. Set up formulas to calculate the Price for children and adults. (Use cell references only – do NOT
use the actual numbers themselves)
2. Calculate the total number of persons in the group in cell B5.
3. Calculate the Subtotal before discount in cell D5.
4. Using an IF function in cell D7, calculate if the group is entitled to a discount, and if so how
much. =IF(B5>9,10%*D5,0)
5. Calculate the final ticket price in cell D10. (Subtotal – Discount)
6. Rename the worksheet tab as Valley Zoo. Put in whatever formatting features you wish to make
your worksheet look attractive.

7. Save the workbook.


************************************************

13
EXERCISE 6 (WEEK 3)
Working with Dates

This exercise deals with a video rental store. The objective of this spreadsheet is to monitor overdue
videos, to calculate the number of days overdue, and to calculate the appropriate fine.

Videos are lent out for a duration of 7 days. Fines are calculated at $200/day.

Set up the spreadsheet as shown below. (Important Note: The dates in this exercise are in the
format mm/dd/yyyy. However, if the date format on your computer is in the format dd/mm/yyyy
then enter the dates in that format)

Now follow the instructions below:

1. Calculate the Date Due as Date Borrowed+7.

2. Status indicates whether the video is overdue or not. To calculate the Status, we will use the
TODAY() function. This function returns the current date. (Try typing in =TODAY() in an
empty cell. It should give you the current system date.)

NOTE: Keep in mind that the date inserted into a cell with the TODAY function is not static.
Whenever you open a worksheet that contains this function, Excel recalculates the function and
updates its contents to the current date. This means that you don’t usually use TODAY to input
the current date when you’re doing it for historical purposes (an invoice, for example) and never
want it to change.

Create an IF function for Status as follows:


=IF(E3<TODAY(),"Overdue","")

3. Calculate the # of days overdue as TODAY()-Date Due if the Status is Overdue. Otherwise the
cell should display 0.
(NOTE: To view the dates as numbers, do the following: From the Cells group, click on the
Format tab. Select Format cells. Click the Number tab, and then click Number in the Category
box.)

4. Calculate the Fine as # of Days Overdue*200. Display these cells with the $ sign.

*********************************************

14
Relative and Absolute Cell References
Relative Cell References
In all the exercises so far, we have used what is called Relative cell reference in formulas. This
means that when you copied a formula to other cells, the cell addresses referenced in the original
formula were automatically adjusted. For eg., a formula =B2+C2 in cell D2 automatically changes to
=B3+C3, =B4+C4 etc. when it is copied to cells D3, D4 etc. A formula =B2+B3 in cell B4 will
automatically change to =C2+C3 when it is copied to cell C4.
A relative cell reference, such as A1, in a formula, is based on the relative position of the cell that
contains the formula and the cell the reference refers to. If the position of the cell that contains the
formula changes, the reference is changed.

Absolute Cell References


We use absolute cell references when we want to reference a cell that is to remain constant in a
formula. That is, the cell address must not change even when we copy the formula to other cells. To
make a cell reference absolute, enter a $ sign before the column and the row in the cell address.
Example, $B$3. The formula =$B$3*C4 in cell D4 when copied to cell D5 will look like =$B$3*C5.
Notice that the cell address that we have indicated as absolute does not change, whereas the relative
cell reference changes according to the new formula location.
An absolute cell reference in a formula, such as $A$1, always refers to a cell in a specific location.
Even if the position of the cell that contains the formula changes, the absolute reference remains the
same. If you copy or fill the formula across rows or down columns, the absolute reference does not
adjust.

EXERCISE 7 (WEEK 4)
Exercises 7 introduces you to absolute cell references and range names.

Elegant Interiors Ltd is a store specialising in the sale of household furniture. The table below shows
6 customers who bought items at the store, the items purchased, the retail prices of the various items
and the distance that each customer lives from the store.

A B C
Customer Item Retail
Description Price

Burns Coffee table 5000


Evans TV/VCR cabinet 24000
Lawson Computer desk 20000
Moran Living room suite 70000
Palmer Hall table 10000
Robbins Living room suite 55000

The store is presently offering a 5% discount on all bills above $20,000. Purchases below $20000 are
not eligible to any discount.

You must now carry out the following tasks:


1. Enter the details given in the table above onto a spreadsheet titled Elegant Interiors Ltd - Sales.
Merge and Center the title across the worksheet. Format the Retail Price cells to show the $ sign
to zero decimal places.

2. Insert a new row below row 1 (title row). In cell A2 enter Discount. In cell B2, enter 5%.

3. Add 2 new columns to show:


a) The discount offered (if any) to each customer. (Use IF. The formula should use absolute cell
references. This will enable the store to easily change its Discount % by changing the value
in cell B2, without having to change anything in the formula).
Tip-How to Quickly Change a Formula Cell Reference to Absolute
An alternative to typing in the dollar signs is to
15
1. In the formula bar, position the mouse pointer on the cell reference you want to
make absolute.
2. Tap the F4 key once.

b) The actual amount payable by each customer.

Range Names

You can create Excel names that refer to cells, a range of cells, a constant value, or a formula. After
you define the Excel names, you can use those names in formulas, to replace values or cell
references.

Naming a Range

You can create an Excel named range quickly by typing in the Excel Name Box.

1. Select the cell(s) to be named


2. Click in the Excel Name box, to the left of the formula bar
3. Type a one-word name for the list, e.g. FruitList. (You cannot use special characters in the Range
name)
4. Press the Enter key.

Using Range Names

After creating a Range name, you can either type the Range name, or select a Range name in the
Name Box dropdown list, to select the Excel named range on the worksheet.

You can use Excel names in formulas. For example, you could have a group of cells with sales
amounts for the month of January. Name those cells JanSales, then use this formula to calculate the
total amount:

=SUM(JanSales)

3. Name the cell B2 containing the 5% as discount.

4. Change the Discount offered formula that previously used the absolute cell reference so that it
now uses the Range name.

5. Name the worksheet tab as Furniture. Put in whatever formatting features you wish to make
your worksheet look attractive. Save the workbook.

********************************************

16
EXERCISE 8 (WEEK 4)
Steve is conducting a survey to find out popular ice cream flavours. He wants to display the % of
persons who like each flavour.

Set up the spreadsheet as shown above.

1. In cell B11, set up a formula to calculate the Total number of persons surveyed.

2. In cell C4, calculate Persons (%) as the # of persons who like Strawberry flavour divided by
the Total number of persons surveyed in cell B11. (The formula MUST use either absolute
cell reference or range name)

3. Format the result in cell C4 to show the % sign to 1 d.p.

4. Copy the formula in C4 to the cells below.

********************************************

EXERCISE 9 (WEEK 4)
Exercises 9 introduces you to the Nested If statement and VLookup

BMI Calculator

Overweight and obesity are defined as abnormal or excessive fat accumulation that may impair
health. Body mass index (BMI) is a simple index of weight-for-height that is commonly used to
classify overweight and obesity in adults.

BMI is defined as a person's weight in pounds (lbs) divided by the square of his/her height in inches
multiplied by 703.

BMI = weight (lbs) * 703


-------------------------
height (inches)*height (inches)

17
Set up the spreadsheet as shown below:

1. In cell B6 create an Excel formula to calculate the BMI using the formula provided above. Display
the BMI to 1 decimal place.

2. Enter you height and weight in the appropriate cells.

The WHO definition for Body description based on BMI is:

Normal BMI is between 18.5 to 24.9

A BMI less than 18.5 is underweight


a BMI greater than or equal to 25 is overweight
a BMI greater than or equal to 30 is obese.
A BMI greater than or equal to 40 is morbidly obese

(Just as a matter of interest, women tend to believe they look their best at values between 20 to 22
and men are usually satisfied with a BMI of 23 to 25.)

Using the IF statement to compute Body description

3. In cell B8 create an Excel formula to calculate the Body description using the above definition
from the WHO:

The formula will involve a nested IF. The formula must be able to display whether the person is
Normal, Overweight or Obese. (You can leave out the Underweight and Morbidly Obese options as
considering these options as well will involve an even longer IF statement. You are free to attempt it
if you like).

=IF(B6<25,"Normal",IF(B6>30,"Obese","Overweight"))

1. Experiment with different values of Height and Weight. Have fun!!

2. Rename your worksheet as BMI Calculator.

18
Using VLOOKUP to compute Body description

Nested If statements can get very long and difficult. You can avoid writing Nested If statements by
using the VLOOKUP function.

The format of the VLOOKUP function is


=VLOOKUP(lookup_value, table_array, col_index_number,[range_lookup])

where

lookup_value: What value do you want to look up?


table_array: Where is the lookup table? If you use an absolute reference ($A$2:$C$5), instead of a
relative reference (A2:C5), it will be easier to copy to formula to other cells. Or, name the lookup
table, and refer to it by name. In this example, the lookup table is in the Products sheet in the cell
range A2:C5.
col_index_num: Which column has the value you want returned?
[range_lookup]: Do you want an exact match? Is an approximate match okay? This is an optional
argument as indicated by the [ ].
If you use TRUE as the last argument, or omit the last argument, an approximate match can be
returned. This example has FALSE as the last argument, so if the product code is not found, the result
will be #N/A. You can use 1 for TRUE and 0 for FALSE.

 Enter the Lookup table in cells F1:G5 of the worksheet as shown below.

 Name the range F1:G5 as BMI.

 Use the VLOOKUP function to compute the Body description as follows:

=VLOOKUP(B6,BMI,2)

Note that we are using an approximate match (range_lookup=True) so that values lying in
between the values of the Lookup table can be obtained.

 Experiment with different values of height and weight. Have fun!! (Note how easy it is now
to deal with 5 different criteria, as compared to using the IF statement which would have
required 4 IF functions to do the same thing)

 Save your workbook

******************************************

19
EXERCISE 10 (WEEK 5)
In this exercise, we will be calculating customers’ bills for a grocery store. The data below contains a
list of the Item Code, Product Description, the Unit Price, and whether the item is subject to VAT for
all the items in the store. This data is to be entered into an empty worksheet into your workbook.
Rename this sheet tab to ItemList.

Using the Name Box, name the cell range A2:D10 to Items. (DO NOT include the heading row)

In cell F1 of sheet ItemList, type VAT. In cell G1, type 16%. Name cell G1 to VAT. We do this so
that if at a later date, the government reduces the VAT, all we have to do is change the data in cell
G1.

The spreadsheet below is to be entered into another worksheet in your workbook. Rename this sheet
tab to Bill. You are going to use the VLOOKUP function to get the Item Description, the Unit Price,
and whether the item is taxable, from the ItemList worksheet.

Now, follow the given instructions:

1. Use the VLOOKUP function to get the Item Description and Price for 1st item..

2. Calculate the TOTAL BEFORE VAT as Qty*Price.

3. The formula for VAT will involve a combination of the VLOOKUP and IF functions. (The 16%
VAT should be applied only to those items that are subject to tax. All other items should have no
tax added.)

4. The VAT is added on to the TOTAL BEFORE VAT to get the Total. Copy the formulas to the
cells below for the other items.

5. The TOTALs in Row 8 are the totals for the TOTAL BEFORE VAT, VAT and the Total
columns.

6. Put in whatever formatting features you wish to make your worksheet look attractive. Save the
workbook EXCEL LABS.

****************************************
20
EXERCISE 11 (WEEK 6)
Set up the spreadsheet showing the marksheet in a new sheet of your workbook EXCEL LABS. If
you are attending labs at the CIT, you are required to enter this data before the lab session, as
data entry might otherwise consume the entire lab time.

We introduce Data Validation in this exercise. Data validation can be used to ensure a high level of
data correctness by controlling the type of data or the values that users enter into a cell. We will use
data validation in cells E2:E14, F2:F14 and H2:H14.

- Select cells E2:E14


- Click on the Data tab of the ribbon .
- Click on the Data Validation icon on the ribbon to open the drop down menu.
- Click on the Data Validation option in the menu to open the Data Validation dialog box.
- From the Allow drop down box, click on Decimal.
-

- Assume that our Test is marked out of 20. We set the Minimum to 0 and the Maximum to 20.
- Click on the Error Alert tab of the Data Validation dialog box.
- In the Error Message box, type “Please enter number between 0 and 20”.
- Click OK.

Now, if the user enters any number that is not between 0 and 20, they will see the error message and
will have to reenter the number.

Similarly, for cells F2:F14, set data validation with error message so as to accept numbers between 0
and 10 since the Assig1 is marked out of 10.

21
A B C D E F G H I J K
No. REG. NO. LAST FIRST TEST ASSIG1 COURSE FINALS TOTAL PASS/ Grade
NAME NAME (20%) (10%) WORK (60%) (100%) FAIL
(40%)
1 12/0809/1234 William Claude 5.5 5 35

12/0835/7634 Henry Joseph 20 0 37

13/0809/3490 Abrams John 18 9 55

12/0833/1202 Adams Joseph 15 10 ABS

12/0852/3456 King Natalie 0 5 20

12/0835/9057 Persaud Hema 10 6.7 ABS

11/0835/1038 Peck Gregory 12 7 35

13/0801/2000 Woods Tiger 21 0 24

12/0839/7505 Grant Hugh 15.2 8 40

12/0833/3478 Persaud Indira 0 7 42

13/0839/2156 Adams Laurie 19.5 8 48


11/0801/2400 Persaud Minnie 17 6 27

13/0801/9001 Lambert Adam 11.3 9 24

Do the following:

1. The first column No. counts the number of students… 1,2,3,4,5….. We can either type the
numbers in increasing order for each row, or we can do it more efficiently by having EXCEL do
it for us. This is how: Make cell A2 the active cell. Move the mouse pointer to the lower right
hand corner of the cell, and you see the pointer change to a + sign. Now pressing the left mouse
button, and holding down the Ctrl key on the lower left corner of your keyboard, drag the mouse
downwards. You will see the numbers incrementing as you do this. When you see the number
10 (that’s how many we need), release the mouse button first, and then let go of the Ctrl key. We
have the numbers 1..13 in column 1.

2. Use the AutoSum function for COURSE WORK in cell G2, and then copy it to the remaining
cells below. Care should be taken when using the AutoSum function to make sure that EXCEL is
using the correct range of cells in the totaling. You should always check to make sure that the
range is correct before pressing Enter.

3. Insert a new column titled ASSIG 2 (10%) between ASSIG 1 and COURSE WORK.
4. Type in the following data for ASSIG 2 for the students. 4, 6, 7, NS, 8, 6, 8, 7, 10, 5, 10, 4, NS.
Make sure the marks for this column are included in the COURSE WORK.

5. Put in a formula or use the AutoSum function for TOTAL in cell J2. Copy this formula to the
remaining cells below.

6. In cell K2, we will enter an IF function to automatically display Pass/Fail for each student. Each
student must obtain at least 27 marks in the Finals and at least 45 marks Total. (Please note that
the I in the cell address I2 is the letter I – not the number 1).

=IF(OR(I2<27,J2<45), “FAIL”, “PASS”)

Copy this formula to the cells below in the column.

7. To sort the data based on one column in ascending order (let’s say Last Name), click on in any
cell in the Last Name column. Click the Data tab. Click Ascending.

22
If you have records in your list that have identical entries in the column you are sorting, you can
specify additional sorting criteria to further organize your list. To sort a list based on more than one
column (let’s say Last Name and then by First Name for each Last Name). Select the range B2:K14.
(You must understand that if you only select the Last Names, ie., C2:C14 for sorting, the related data
for each student will not move along with their names. That is why we select the entire range
B2:K14). Note that we do not select column A, since we want to keep the numbers in the sequential
order they are currently in.

Now from the Data tab on the Ribbon, click on the Sort option from the Sort & Filter group. From
the Sort dialog box that comes up, click on the down arrow next to the box for Sort by, and select
Last Name or Column C. Use Order – Smallest to Largest for Ascending order, or Largest to
Smallest for Descending order.

Click on the Add Level option. Click on the down arrow next to the box for Sort by, and select
First Name or Column D. Click on OK.

8. Let us say that we are now told that the names of the students must be in one column, in the
format Last name, First name. If we have a large number of students, this would be a lot of work
if we do it manually. Instead we can make our life a lot easier by using the CONCATENATE
function. This function combines multiple values and strings and outputs them to a text string.

- Insert a new column between columns D and E.


- In the new cell E1, type Name
- In cell E2, enter the formula
=CONCATENATE(C2,“, ”,D2) [Note the comma and the space within the double quotes
to separate the last name and first name]
- Copy the formula down to the cells below

9. Assume that you want to identify students from each program who are in the class. We may at
want to count the number of students from each program. We can accomplish this in Excel by
using the MID function. This function extracts a substring from the middle of a defined string.
The user defines the starting and position and number of characters to extract.
- Insert a new column between columns B and C
- In the new cell C1, type Program
- In cell C2, enter the formula
=MID(B2,4,4)
- Copy the formula down to the cells below.

10. In cell B16, type the label Highest. In cell B17, type the label Lowest. In cell B18, type the label
Average.

11. In cell C16, enter a formula to calculate the highest or maximum of the Total marks.
=MAX(L2:L14) OR click on the down arrow next to the AutoSum option of the Editing group
of the Home tab, and choose Max.

12. In cell C17, enter a formula to calculate the lowest or minimum of the Total marks.
=MIN(L2:L14) OR click on the down arrow next to the AutoSum option of the Editing group of
the Home tab, and choose Min.

13. In cell C18, enter a formula to calculate the average of the Total marks. =AVERAGE(L2:L14)
OR click on the down arrow next to the AutoSum option of the Editing group of the Home tab,
and choose Average.

We would now like to know how many students passed and how many failed without having to
manually count them as this could be a painful process given a large class size. In cell E16 type
PASS; in cell E17 type FAIL; in cell E18 type TOTAL; in cell E19 type DID NOT WRITE
FINALS.

The COUNTIF function counts the number of cells in a range that satisfy the given condition.

14. In cell F16 type =COUNTIF(M2:M14,”PASS”) [NOTE: Instead of typing the range, it would be
easier to simply select the required range of cells M2:M14]

15. In cell F17 type =COUNTIF(M2:M14,”FAIL”)

23
16. In cell F18, enter a formula to compute the sum of cells E18 to E19. This number should be equal
to the number in cell A14 (the total number of students).

17. In cell F19 type=COUNTIF(K2:K14,”ABS”) to count the number of students who did not write
the final exam.

Let us say that we would now like to assign grades A, B, C, D, F to each of the students. One way to
do this is by using the Nested If statement as shown below:
=IF(OR(K2<27,L2<45),"F",IF(L2>=75,"A",IF(L2>=65,"B",IF(L2>=55,"C","D"))))

A much easier way to deal with multiple criteria is by using the VLOOKUP function.

 Set up the Lookup table containing the Ranges and the Grades in a separate worksheet.
 Give this table a Range Name using the Name Box.
 Set up the VLOOKUP function to display the grades for the students.

Freezing Panes

To keep an area of a worksheet visible while you scroll to another area of the worksheet, you can
lock specific rows or columns in one area by freezing panes.

When you freeze panes, you keep specific rows or columns visible when you scroll in the worksheet.
On the View tab, in the Window group, click Freeze Panes.
NOTE:
 To lock rows, select the row below the row or rows that you want to keep visible when you
scroll. To lock one row only, click Freeze Top Row.
 To lock columns, select the column to the right of the column or columns that you want to
keep visible when you scroll. To lock one column only, click Freeze First Column.
 To lock both rows and columns, click the cell below and to the right of the rows and
columns that you want to keep visible when you scroll. Click Freeze Panes.
When you freeze the top row, first column, or panes, the Freeze Panes option changes to
Unfreeze Panes so that you can unlock any frozen rows or columns. You can freeze rows at
the top and columns on the left side of the worksheet only. You cannot freeze rows and
columns in the middle of the worksheet.
For this exercise, we would like to freeze the first row and columns A to F. Click on cell G2, and
Freeze Panes.

18. Name the worksheet tab as Grade Sheet. Put in whatever formatting features you wish to make
your worksheet look attractive.

19. Save the workbook EXCEL LABS.

********************************************

24
EXERCISE 12 (Week 7)
Exercise 12 introduces you to Drop Down boxes and the SUMIF and COUNTIF functions.
The data in this spreadsheet shows the number of orders taken, and the sales figures for various Avon
salespersons in 3 different locations. We are interested in analyzing the data to generate various
summary figures.

Let us first look at Drop down boxes.


When a drop-down box is added to a cell, an arrow is displayed next to it. Clicking on the arrow will
open the list and allow you to select one of the list items to enter into the cell.

The benefits of using a drop down list for data validation include:

 making data entry easier


 preventing data entry errors

Excel's data validation options include creating a drop down list that limits the data that can be
entered into a specific cell to a pre-set list of entries.

For our exercise, we will use drop down lists for entering the Regions for cells A3:A11.
- Select cells A3:A11. This is where the drop down lists will be located.
- Click on the Data tab of the ribbon .
- Click on the Data Validation icon on the ribbon to open the drop down menu.
- Click on the Data Validation option in the menu to open the Data Validation dialog box.

There are a number of options for data validation in Excel in addition to a drop down list. Some of
the more commonly used options are Whole number, Decimal, Text, Date, and List.
In this step we will choose the List option as the type of data validation to be used for cells A3:A11
of the worksheet.
- Click on Settings tab in the dialog box
- From the Allow drop down box, choose List.

The list will contain the data that forms the choices in the drop down list.
One option for entering the list items is to just type the data for the list into the Source line in
the dialog box. This is fine if the list has only a few items.
Another method is to enter the data into a range of cells in the worksheet and then use the cell
references for this range as the source. This would be a better option if your list has a large number of
items.

In our exercise, since we have only 3 items in our list, we will simply enter them into the Source box
as shown in the figure above.

Once the Data Validation dialog box closes a down arrow should appear next to cell A3 indicating
that the cell contains a drop down list.

25
Entering data from the list into cell A3 is a simple matter of opening the drop down list and clicking
on the list item Region 4. Repeat the process for cells A4:A11 all of which will have a drop down
arrow visible when you click on the cell.

Complete the spreadsheet as shown below:

Now follow the instructions below:

1. Use the SUMIF function to calculate the TOTAL ORDERS for Region 4 in the Summary table as
shown below:

=SUMIF(A3:A11,"Region 4",C3:C11)

Copy the formulas down. (Do you notice anything odd when you copy the formulas down? Are
your answers correct? Do you need to alter your original formula slightly so that your results are
correct when you copy the formula down?)

2. Similarly, use the SUMIF function to calculate the TOTAL SALES for Region 4, 5 and 6 in the
Summary table.

3. Use the COUNTIF function to count the # OF SALESPERSONS for Region 4 in the Summary
table as shown below:

=COUNTIF(A3:A11,"Region 4")

Copy the formulas down. (Do you notice anything odd when you copy the formulas down? Are
your answers correct? Do you need to alter your original formula slightly so that your results are
correct when you copy the formula down?)

4. See if you can use the appropriate function (SUMIF or COUNTIF) to calculate the last 3 items.

5. Rename the worksheet as Avon Sales. Save the workbook.

********************************************

26
EXERCISE 13 (WEEK 7)
Exercise 13 introduces you to the SUMIFS and the COUNTIFS functions. These functions allow
you to work with multiple criteria, unlike the SUMIF and COUNTIF functions that allow you to use
only one criteria.

The data in the spreadsheet below shows the Name, Gender, Age, Department and Salaries for the
employees in a certain company. We are interested in getting summarized information from this
data.

Create the spreadsheet as shown below:

Now follow the instructions below:

1. Use the SUMIF function to calculate the SUM OF SALARIES for the Sales department in the
Summary table. Copy the formula down. (Do you notice anything odd when you copy the
formulas down? Are your answers correct? Do you need to alter your original formula slightly
so that your results are correct when you copy the formula down?)

2. Use the COUNTIF function to calculate the NUMBER OF SALES PERSONS in the Sales
department in the Summary table. Copy the formula down. (Do you notice anything odd when
you copy the formulas down? Are your answers correct? Do you need to alter your original
formula slightly so that your results are correct when you copy the formula down?)

3. Use the COUNTIFS function to calculate the NUMBER OF MALES in the Sales department as
shown below:

=COUNTIFS(B2:B11,"M",D2:D11,"Sales")

27
Copy the formula down. (Do you notice anything odd when you copy the formulas down? Are
your answers correct? Do you need to alter your original formula slightly so that your results are
correct when you copy the formula down?)

4. Similarly, use the COUNTIFS function to calculate the NUMBER OF FEMALES in the various
departments.

5. Use the SUMIFS function to calculate the TOTAL SALARIES OF MALES in the Sales
department as shown below:

=SUMIFS(E2:E11,B2:B11,"M",D2:D11,"Sales")

Copy the formula down. (Do you notice anything odd when you copy the formulas down? Are
your answers correct? Do you need to alter your original formula slightly so that your results are
correct when you copy the formula down?)

6. Similarly, use the SUMIFS function to calculate the TOTAL SALARIES OF FEMALES in the
various departments.

7. See if you can use the appropriate function (SUM, SUMIF, COUNT, COUNTA or COUNTIF)
to generate the other 9 pieces of information.

8. Rename the worksheet as Human Resources.

9. Save the workbook.

Please download the Salesperson Data file


from the course website for next week’s lab.

***********************************************

28
EXERCISE 14 (WEEK 8)

Using Filter to find Records


You will use the Salesperson Data file for this class.

When you want to hide all the records (rows) in your list except those that meet certain criteria, you
can use the Filter command. This command places a drop-down list at the top of each column in
your list. To display a particular group of records, select the criteria that you want in one or more of
the drop-down lists. For example, to display the sales history for all employees that had $1,000 orders
in January, you could select January in the Month column drop-down list and $1,000 in the Orders
drop-down list.

To use the Filter command to display records (rows) for UK in your original source data that you
used to create pivot tables:
 Go to the worksheet Filter
 Click any cell in the data.
 Click the Data tab and then click the Filter button in the Sort & Filter group. Click on Filter.
Each column header will now display a down arrow.
 Click the down arrow next to the header above the column that you want to use for the filter. In
our case - Country.
 A list that contains filter options will appear. Uncheck the (Select All) box, and click on UK
from the list.

Excel will hide the rows that don’t match the criteria you specified. You can apply more than one
filter to further narrow down your list. For example, selecting Buchanan from the drop down list for
the Salesperson column will display only rows containing Buchanan.

To remove the Filter drop down lists, unselect the Data – Filter command.

Creating a Custom Filter


When you want to customize a column filter, use the Number filters option. For example, you can
display all order amounts greater than $2000, or falling within a range.
Let us say you want to view all orders for King that are greater than $5000.

 Click any cell in the data.


 Click the Data tab and then click the Filter button in the Sort & Filter group. Click on Filter.
Each column header will now display a down arrow.
 Click the down arrow next to the header above the column Salesperson
 Uncheck the (Select All) box, and click on King from the list.
 Click the down arrow next to the header above the column Order Amount
From NumberFilters select Greater than. In the Custom AutoFilter dialog box, type 5000 in the
empty box next to ‘is greater than’. Click OK to apply the custom AutoFilter. The records selected
by the filter are displayed in your worksheet.

Analyzing a List with the Subtotals command


The Subtotals command in the Outline section of the Data menu helps you organize and analyze a list
by displaying records in groups and inserting summary information, such as subtotals, averages,
maximum values, or minimum values.

The Subtotals command can also display a grand total at the top or bottom of your list, letting you
quickly add up columns of numbers. As a bonus, Subtotals displays your list in Outline view so that
you can expand or shrink each section in the list simply by clicking.

Let us say we want to add subtotals by Salesperson to a list, follow these steps:

Go to the worksheet Subtotals.

29
Sort the list by Salesperson

Click the Data tab, then click the Subtotal button in the Outline section. Excel opens the Subtotal
dialog box and selects the list.

In the At each change in: list box, choose Salesperson. Each time this value changes, Excel inserts a
row and computes a subtotal for the numeric fields in this group of records.

In the Use function: list box, choose Sum.

In the Add subtotal to: list box, choose Order Amount, which is the column to use in the subtotal
calculation.

Click OK to add the subtotals to the list.

When you use the Subtotals command in Excel to create outlines, you can examine different parts of
a list by clicking buttons in the left margin. Click the numbers at the top of the left margin to choose
how many levels of data you want to see. Click the plus or minus button to expand or collapse
specific subgroups of data.
You can choose the Subtotals command as often as necessary to modify your groupings or
calculations. When you are finished using the Subtotals command, click Remove All in the Subtotal
dialog box.

PIVOT TABLES
Three key reasons for organizing data into a Pivot Table are:
 To summarize the data contained in a lengthy list into a compact format
 To find relationships within the data that are otherwise hard to see because of the amount of
detail
 To organize the data into a format that’s easy to chart

Below is a simple example of how putting data in a Pivot Table can be useful. (DO NOT type any data for
this exercise. The data is available in the Salesperson Data file on the website).

Region Year Product Units Sold


Southeast 1997 Cadbury 163
Northwest 1998 Hershey 251
Southwest 1998 Cadbury 187
Northeast 1998 Hershey 228
Southeast 1997 Hershey 172
Northeast 1998 Cadbury 210
Northwest 1997 Cadbury 237
Southeast 1998 Hershey 143
Northwest 1997 Cadbury 208
Northwest 1998 Hershey 149
Southwest 1997 Cadbury 200
Northeast 1997 Hershey 139

The table above is a simple list. Even looking at this simple, short list, it is difficult to discern patterns in the
data. For example, it takes a bit of study to see that the number of Units Sold in the Northeast region is much
greater than the number of Units Sold for the Southwest region. Or, to find out that Hershey outsells Cadbury
in the Northwest. Questions of this type that you might have about the data can be answered, but only with
some effort.

By contrast, the Pivot Table shown below simplifies and summarizes the data to make relationships and
patterns obvious. And, if you had much more data in the list (perhaps with many additional entries for each
region), you could still achieve a condensed Pivot Table summary the same size as the one below.

Sum of Units Sold


Region Product Total
Northeast Cadbury 210
Hershey 228
Northwest Cadbury 237

30
Hershey 251
Southeast Cadbury 163
Hershey 172
Southwest Cadbury 187
Grand Total 1,448

You can easily chart the data organized into a Pivot Table, while to chart the data in the list in the table, you
would first need to restructure the data and obtain the sum for each region. The Pivot Table simplifies the
process because it obtains subtotals automatically and puts them in a range you can immediately use for
charting. Using the Chart Wizard, it’s easy to get a summary, graphical view of your data using the Pivot
Table as your tool to organize and summarize the data.

300

250

200
Cadbury
150
Hershey
100

50

0
Northeast Northwest Southeast Southwest

What’s Required to Construct a Pivot Table?


To create a Pivot Table you need to identify these elements in your data:

 A data field, where the data field is the variable you want to summarize
 A row and/or column field, where the row and/or column fields are the variables that will “control”
the data summary.

Pivot Table Exercise I – Compare Your Salespeople


We will construct Pivot Tables for the source data in the Salesperson Data Excel file that you should
download from the course website and save onto your storage medium. You will not be able to do this
exercise without downloading the data file.

To set up your Pivot Table:

 Go to the Pivot worksheet.


 Click any cell in the source data.
 From the Insert tab on the Ribbon, click on Pivot Table from the Tables group.
 Click OK on the Create Pivot Table dialog box that pops up.

Now you’ll see the blank pivot table appear in a new worksheet of your workbook:

31
You build your pivot table by dragging and dropping fields from the Pivot Table field list into the
different sections of the pivot table: Report Filter, Column Labels, Row Labels, and Values. That
will enable us to extract meaningful information from the data, and find answers to questions like:

1. What are the order amounts for each salesperson?


2. What are the order amounts for salespeople in a specific country?
3. How are salespeople ranked by order amounts?
4. How did each salesperson’s performance vary by quarter?
5. How did each quarter’s sales vary by salesperson?
6. What are the details for a specific order amount?
7. What percent is a specific order of the total order amounts?

Let us start with the first question and use Pivot Tables to generate answers for each of the above
questions.

1. What are the order amounts for each salesperson?


 Drag the Salesperson field to the Row Labels area.
 Drag the Order Amount field to the Values area.

 Let us change Row Labels in cell A3 to Salesperson. To do this, simply click in cell A3 and
type Salesperson. Press the Enter key on your keyboard.

 To set the currency symbol for the numeric values, select the cells containing the values and
then click on the $ sign on the formatting toolbar.

 Rename the worksheet tab containing this Pivot Table to Order Amounts

32
If you want to compare total amounts by country instead of by salesperson, drag the salesperson field
out of the Row Labels area on the bottom right of the window and drag the Country field there
instead.

Set the Pivot Table back to displaying Salespersons by dragging the country field out of the Row
Labels area and drag the salesperson field there instead.

2. What are the order amounts for salespeople in a specific country?


 Set up a pivot table in a new worksheet.
 As for Question 1, drag the Salesperson field into the Row area, and Order Amount into the
Data area.

 Drag the Country field into the Report Filter area


 Rename the worksheet tab containing this Pivot Table to Orders by Country

You can then filter the data so as to view the data for each country.

You can use the Report Filter to display 3 different : individual pages for the 2 countries, and the (All) page
that summarizes data for both countries. Cell B1 contains the item currently displayed in the page field. To
change the page, click the drop down arrow in cell B1, click the item you want to view, and then click OK.

3. How are salespeople ranked by order amounts?


Let us say we want to see the top 5 salespersons. We would therefore need to display their order amounts in
descending order, from highest to lowest.

 In a new worksheet, create the Pivot table as for Question 2 (Orders by Country).
 Right Click anywhere in the cells showing the Salespersons in your pivot table report area.
 Left click on Filter – Top 10

33
 In the Top 10 Filter dialog box that pops up, change the value 10 to 5. Click OK. You should now see
the data for the 5 salespersons with the highest order amounts.
 We will now need to put the salesperson in order of decreasing order amounts. To do this, from the
Sort & Filter group under the Pivot Tools tab, click on Sort. Click the circle next to Descending,
and change Salesperson to Sum of Order Amount. Click OK.

 Rename the worksheet tab containing this Pivot Table to Orders Sorted

4. How did each salesperson’s performance vary by quarter?


 In a new worksheet, create a pivot table as for Question 2 (Orders by Country).
 Display the orders for UK.
 Click anywhere in the pivot table report area. Drag the Order Date field from the Pivot Table
Field List into the Row Labels area.

This report now has 2 fields in the Row Labels area. Order Date is an inner row field. Salesperson is
an outer row field. The report now shows all the order dates for each salesperson.

Note that the source data contains actual order dates, but it would be nice to group the dates by quarter.
To do this,

 Right Click in any of the Order Date cells and click on


Group.
 In the By box, uncheck Months and click on Quarters.

 Rename the worksheet tab containing this worksheet to Salesperson performance by Quarter

34
5. How did each quarter’s sales vary by salesperson?

 In a new worksheet, create a pivot table as in Question 4 (Quarter by Salesperson).


 Click on Order Date in the Row Labels area in the lower right of the window.
 From the menu that pops up, click on Move Up.
 You should now see the pivot table report showing the performance of the salespersons for each
quarter.

The report now breaks down each salesperson’s performance by quarter, instead of breaking down each
quarter’s sales by salesperson.

 Rename the worksheet tab containing this worksheet to Quarter sales by Salesperson

6. What are the details for a specific order amount?


Drilling down to underlying data

Double click a cell in the Pivot Table report from Question 5 (Quarter by Salesperson) to see the data
“behind” it. Here are the details for cell C5, Buchanan’s first quarter sales.

The report above shows the individual orders that contributed to Buchanan’s first quarter order amount.

 Rename the worksheet tab containing this report to Details

7. What percent is a specific order of the total order amounts?


In this case, you need to create a new data field and do a custom calculation. That way you can compare the
original data field (Summary) and the new calculated data field (% of Total).
35
 In a new worksheet, create a pivot table as in Question 2 (Orders by Country).
 Drag the Order Amount field into the Data area

 Right click anywhere in the new Sum of Order Amount2 column.


 From the menu that comes up, click on Value Field Settings
 Click on the Show Values As tab.
 Under Show Values As, click % of total (you will need to scroll down a bit). Click OK
 Click on cell C4 containing the Sum of Order Amount2 label, and type in % of Total
 Press Enter on your keyboard.

 Rename the worksheet tab containing this Pivot Table to Percent Orders

Pivot Charts
It is easy to create a Pivot Chart from a pivot table. Just select the pivot table, right click on Pivot
Chart (or click the Pivot Chart button on the Pivot Table toolbar). Generate a pivot chart for the pivot
table in the Orders by Country worksheet.

EXERCISE 15 (WEEK 9)
Set up the spreadsheet as shown below in a new Sheet of your workbook EXCEL LABS.
A B C D E F
SALES FIGURES FOR JAN – MAY 2010
Jan.
Aquafresh 100 60 85 90 95
Colgate 120 130 70 100 160
Crest 180 80 100 140 110

Now do the following:

1. Instead of typing the months Feb. – May, we will get EXCEL to put them in for us. Position the
mouse pointer on the lower right hand corner of the cell B2. Notice the + shape of the pointer.
Simply drag it now across till you get May.

2. We will now use the Chart Wizard to draw a graph of the data in the table. We would like a
column chart with the months on the X-axis and the sales figures on the Y-axis, with the names of

36
the toothpastes appearing in the legend. You must first HIGHLIGHT the data to be charted.
Highlight the range A2:F5

3. From the Insert tab on the Ribbon, click on Column in the Charts group. Click the very first
chart type under 2-D Column.

4. The chart now appears in the worksheet, showing the months on the X-axis, and the sales figures
on the Y-axis, with the names of the toothpastes in the legend. You can move the chart and size it
just as you do with an image in Microsoft Word. Note that if you make any changes in your data,
the chart will be automatically updated to reflect the changes.

5. There are 3 tabs on the Ribbon associated with charts. These are the Design, Layout and Format
tabs which are grouped under Chart Tools.

6. You can decide whether you want a variable plotted on the X-axis or Y-axis. For example, you
can change the chart design so as to have the names of the toothpastes on the X-axis, and the
months on the legend. To do this, click on Switch Row/Column from the Data group of the
Design tab.

7. Experiment with the Chart Layouts and Chart Styles options on the Design tab. Clicking on
Move Chart from the Location group allows you to move the chart from its current location as
an Object in the worksheet to a New Sheet. Click on the Chart tab for the new worksheet
created, and observe how this option creates a chart that takes up an entire sheet. This is a good
option to use if you wish to display a large sized chart on a page by itself.

8. Let us now label the title, X-axis and Y-axis as follows. Click on Chart Title of the Labels
group, select a suitable option and enter the Chart title as Toothpaste Sales.

9. Click on Axis Titles – Primary Horizontal Axis Title from the Labels group, and enter the X-
axis title as Months.

10. Click on Axis Titles – Primary Vertical Axis Title from the Labels group, and enter the Y-axis
title as Sales.

11. The Legend option of the Labels group gives you the option of not displaying the legend, or
specifying the location for the legend. The Data Labels option allows you to hide/label the
elements of the chart with their actual data values.

12. The Data Table option allows you to add a data table to the chart. You should make yourself
familiar with all these features.

13. If you need to delete a chart located in the same worksheet as your data, simply select it and click
on the Delete Key on your keyboard. If you need to delete a chart located in a separate sheet, you
must right click on the sheet tab for the chart and select the Delete option.

14. You can add formatting features to any part of your chart such as borders, font colors and fill
colors. To format any part of the chart, simply click on the desired area. Experiment with the
various options in the Shape Styles and WordArt Styles groups under the Format tab of the
Ribbon.

15. For the chart just created, we used a consecutive range of cells. But suppose that the data that we
want to chart is not in adjacent locations? How then do we choose only the required data without
choosing all the data in between as well? For example, let us say that we want to create another
chart comparing only the sales for Aquafresh and Crest. You note that the required data ranges
are not adjacent. To select these non-adjacent data ranges, first select A2:F3. Then, hold down
the Ctrl-key on the lower left of your keyboard, and select the range A5:F5. You notice that both
ranges are now selected. Proceed as before to create the chart showing the Months on the X-axis
and the Brands of toothpaste in the legend.

16. As further practice in dealing with non-adjacent data ranges, plot a chart comparing all three
brands of toothpastes only for the months of Jan, Feb, and May. The Brands of toothpastes
should appear on the X-axis and the Months should appear in the legend. Set the titles for your
charts appropriately.

37
17. Rename your worksheet tab as Toothpaste Sales. Save your workbook.

EXERCISE 16 (WEEK 9)
This exercise deals with combination charts. Excel lets you combine two or more different chart or
graph types to make it easier to display related information together.

One easy way to accomplish this task is by adding a secondary vertical or Y axis to the right side of
the chart. The two sets of data still share a common X or horizontal axis at the bottom of the chart.
By selecting complementary chart types - such as a column chart and line graph - the presentation of
the two data sets can be enhanced.

1. Set up the spreadsheet in a new worksheet of EXCEL LABS as shown below. The figure also
shows what our final product should look like.

2. Create a 2D Column chart showing the Months on the X-axis and the # of Homes sold and the
Average Price in the Legend.

3. Click on any one of the bars for Average Price, and use the Change Chart type option to change it
to a Line chart.

4. We’ll use the Primary Y-axis for the Number of Homes sold, and we’ll create a new Secondary
Y-axis (right of chart) for the Average Price. To do this:

- Click on the Line graph for the Number of Average Price.


- Click on Layout on the Chart Tools menu.
- Click on Format Selection from the Current Selection group (very first one)
- In Series Options, click on Plot Series On – Secondary axis
- Click Close

5. To put in Axis titles, we go to Axis Titles in Chart Tools – Layout. This time, you see a
Horizontal and Vertical axis title for both the Primary and Secondary Axes. Put in appropriate
titles for all axes (as shown in the figure above).

6. Create a Chart title, and move the Legend to the bottom of the chart.

7. Click on the Primary axis and change the color to match the color of the columns. Click on the
Secondary axis and change the color to match the color of the line.

8. Put in appropriate formatting options to make your chart attractive, and save your chart.

*********************************************************************************

38
EXERCISE 17 (WEEK 10)
1. Set up the spreadsheet in a new worksheet of EXCEL LABS as shown below:

NATIONWIDE SPORTING GOODS STORE


Product Projected Actual Sales Status Variance % Variance
Name Sales
Baseball Bats 1600 900
Golf Club Sets 3000 2500
Athletic Wear 2500 1750
Boxing Gloves 10000 9000
Cricket Bats 5200 6000

2. Create a formula for Status which will display “Good” if the Actual Sales is greater than the
Projected Sales; “Poor” otherwise.

3. Enter formulas for Variance and Variance%. The Variance is equal to the Actual sales minus
Projected sales. The % Variance is equal to the Variance divided by the Actual sales. Format the
results in the % Variance column to display the % sign. Display the results in this column to 2
decimal places.

4. Let us now format the cells data for Projected and Actual Sales so as to be displayed with a
comma. To do this, select the cells containing the data, and click on the comma (,) option from
the Number group of the Home tab.

5. Create on a separate sheet, a column chart comparing the Projected vs. the Actual Sales for each
product. The chart should show the Products on the X-axis and the Projected and Actual Sales in
the legend.

6. Produce a pie chart showing the Actual Sales of each Product expressed as a percentage of the
total sales. To do this, select the data containing the Product Names, press the Ctrl key and then
select the data for the Actual Sales. From the Insert tab on the Ribbon, select Pie from the
Charts group. Click on the first pie chart option.

7. Using the Chart Title option from the Labels group under the Layout tab, set an appropriate
chart title. Using the Legend, and Data Labels options from the Labels group of the Layout tab,
show the Legend, and Percentages. (You could also show the category and percentages in the
slices of the pie chart, in which case you would not show the Legend).

Conditional Formatting

Conditional formatting is a very powerful Excel feature that allows you to select one or more cells,
and create rules (conditions) for when and how those cells are formatted. The conditions can be based
on the selected cell's contents, or based on the contents of another cell.

You can control the following formats:

 Number format
 Font, font style, and font color (but not font size)
 Fill color and fill pattern
 Border color and border style (but not border thickness)

If the rules (conditions) that you specified are met, then the formatting is applied.

For example, you can set conditional formatting so that a cell background color turns red if its
value is less than 45, and turns green if its value is greater than 75.

Example 1:
8. Let us format the Variance value cells to automatically display the values in red if they are
negative. To do this, select the cells E3:E7 and click on Conditional Formatting from the Styles
group of the Home tab. Click on Highlight Cells Rules and select Less Than. Type 0 in the
box, and choose the option Red Text for the format.

39
To Edit or Delete rules in your worksheet, click on Manage Rules from the Conditional
Formatting command.

Example 2:
9. Let us say we would also like to color in Green fill with Dark green text all Actual Sales values
that are greater than 5000, and color in Light Red Fill all Actual Sales values that are less than
3000. Do this using Highlight Cells Rules in Conditional formatting.

Example 3:
10. If you wish to create a format that is not present in the list, you can use Custom Format in
Conditional formatting to create your own format. Use Custom Format to set all Projected Sales
greater than 5000 to Bold.

Example 4:
11. To set conditional formatting for Text values, use the Highlight Cell Rules, and the Text that
Contains option. Now, use this feature to set all Poor values in the Status column to Light Red
Fill with Dark Red Text format.

Example 5:
12. We can also format an entire row based on the value of one cell. Let us say, we want to format the
entire row if the Variance for that row is less than 0. To do this:
- Select the cells you want to format. In our exercise, let us select the range A3:F7.
- Click Conditional Formatting, and then click New Rule
- In the New Formatting Rule window, click Use a formula to determine which cells to format

- In the Rule box, enter the formula =$E3<0. We use an absolute reference to column E ($E), to
ensure that the conditional formatting in all columns refers to the value in column E. If we used a
relative reference (E3), the formula will be adjusted in each column, and won't work properly. Cells
in column A would refer to cells in column E, but the cells in column B would refer to cells in
column F and so on.

- Click the Format button below the Rule box.


- In the Format Cells dialog box, select the formatting options you want. In our exercise, we will
select a Yellow fill color.
- Click OK to close the Format Cells dialog box.
40
This same method could also be used if you want to highlight entire rows corresponding to text
values in cells in a column. In this case, you would make sure to enclose the text value in your
formula in uplifted commas. For example =$C2=”Overdue” to highlight entire rows where some
rental item is overdue. You could also use =$C2>Today() to accomplish this.

Example 6:
13. Let us say we want to highlight entire rows where the Actual Sales values are greater than the
average of all the Actual Sales values. This is similar to Example 5. Use the formula
=$E3>Average($E$3:$E$7)

Example 7:
14. Excel allows you to use conditional formatting to display data bars in cells. This makes it easy
to visually compare a list of numbers, just as you would in a graph or chart.
Let us use data bars in the cells for %Variance. To do this:
- Select the value cells in the %Variance column.
- From the Conditional Formatting option on the Ribbon, click Data Bars and then select one of
the Fill options.
- It’s a good idea to make the column wider so the bars look better

15. Name the worksheet tab containing the data as Sport. Use various formatting features to make
your data table and charts look attractive. Save the workbook.

EXERCISE 18 (WEEK 10)


Creating Gantt Charts with Excel

Excel does not offer Gantt as a chart type, but it is fairly easy to create such a chart by using a stacked
bar chart.

Start with a new worksheet and enter the data as shown below.

1. Create a formula in cell D2 to calculate the End Date. (Start Date + Duration)

2. Create a stacked horizontal bar chart by selecting the Insert tab, then choose the Bar button
in the Charts ribbon, and then the 2-D Stacked Bar Chart option.

3. A blank chart appears in your spreadsheet. To select the data, right-click anywhere inside the
blank chart, then choose Select Data.

4. Under the Legend Entries (Series) section, click on the Add button. The Edit Series dialog
box opens. The first series to add will be the label containing the start date. Under the Series
Name, select cell B1. Under the Series Values, select cells B2:B11, the range of cells
containing the various start dates. Click OK.
41
5. As for the previous instruction, add the series Duration.

6. Edit the labels by selecting the Edit button under the Horizontal (Category) Axis Labels
section. The Axis Label dialog opens. Select cells A2:A11, the various task names. Click OK.
Click OK again to close the Select Data Source dialog box.

7. Remove the chart’s legend by selecting it and pressing the Delete key or the Backspace key,
since the legend is not needed for a Gantt chart. You may need to adjust the chart’s height (or
change to a smaller font) so that all x-axis labels are visible.

8. Since you do not want to see the Start data series, select that series (by default it should be a
blue color) by clicking on any one of the data items, right-click, and select Format Data
Series. The Format Data Series dialog opens. Select the Fill tab on the left and select No Fill.
Then select the Border Color tab and select No Line. Click Close. The start dates are gone,
but the durations are visible.

9. You need to now reverse the order of the y-axis labels. Right-click on any one of the labels on
the y-axis, then select Format Axis. The Format Axis dialog opens. Under the Axis Options
tab, click on the Categories in reverse order. Click Close.

10. To get a better view of the actual dates, you need to adjust the date range. Excel does not view
(i.e., interpret) dates as we do. In other words, dates are displayed as 7/13/2015 to you, but
Excel interprets that date as 42198. Dates are in numerical value, simply formatted to look
like dates. Since the first task in the project is set to 7/13/2015, you need to convert that to a
numeric value. And the same is true for the last task; however, you can extend the date a few
days past the end date for visual effect.

11. To do this, find an empty cell, such as F4; enter 7/13/2015. Repeat the process for the end
date, select another empty cell, such as F5, and enter 11/02/2015. Choose both F4 and F5 and
select the Comma Style format from the Number ribbon. You will see that these dates are now
represented by their numerical value. You will use these numbers to set the Minimum and
Maximum values for the date range in the next step.

12. Right-click on any of the dates at the top of your chart, then select Format Axis. Using the
Axis Options tab, select Fixed for the Minimum, and type in 42198. (which is the numeric
value for 7/13/2015, the start date that you converted in the previous step). Select Fixed for
the Maximum, then type in 42310 (the numeric value for 11/02/2015). Click Close.

13. Apply other formatting as desired. For example, use a shortened form of the date. Right click
on any of the dates at the top of your chart, then select Format Axis. Click on Number, and
use the Date format m/d. Now, instead of displaying 7/13/2015 it will display 7/13.

14. To shorten the interval between the dates, right click on any of the dates at the top of your
chart, then select Format Axis. Using the Axis Options tab, select Fixed for the Major
Unit, and type in 5.

15. You can also add grid lines and a title. To add horizontal grid lines, right click on any of the
labels on the y-axis. Click on Format Major gridlines, then select Automatic.

16. Right click on one of the bars in the chart. Right click on Format Data Series and
experiment with the Series Overlap and Gap Width options. See how you can control the
spacing between the bars and the thickness of the bars with these options.

17. Click anywhere in the chart. Click on the Layout tab. Using Data Labels, display the value
of the bars on the chart.

If you adjust your project schedule, the chart will be updated automatically. If you use dates
outside the original date range, you will need to change the scaling for the y-axis.

You now have a very functional Gantt chart; you can clearly see when various tasks begin and end, as
well as when tasks overlap.

42
EXERCISE 19 (WEEK 10)
Referencing Cells in Other Worksheets
When you create a workbook containing several worksheets, you may sometimes want to reference
the data in one worksheet when you build a formula in another worksheet. For eg., if your workbook
contains a separate worksheet for each sales region in the country, you could create a summary
worksheet that includes the sales data from each of the supporting worksheets. When you change the
data in the source worksheet, Excel will automatically update the data in the dependent worksheet.

Scenario 1:
The Totals are created in the individual worksheets, and you want to display the totals in a Summary
sheet.
 In the Berbice Sales worksheet, calculate the Totals for each quarter in cells B10, C10, D10
and E10.
 To display the Total for Berbice 1st quarter, in cell B4 of the Summary Sales sheet,
o enter the formula =
o click on the worksheet tab that we want to use in our formula (in our example, Berbice
Sales)
o click on the cell B10
o press Enter
Complete the remaining cells in the Summary Sales worksheet for practice.

Scenario 2:
The Totals are not created in the individual worksheets, and you want to calculate and display the
totals in a Summary sheet.

In cell B4 of the Summary Sales worksheet, use the SUM function.


 To begin the formula, type =SUM(
 To specify a range for the Sum function, click the worksheet tab you want to include in the
formula, and then select the range of cells you want to use within the link. For example, to
add the five sales figures from the Qtr 1 column in the Berbice worksheet, click the Berbice
worksheet tab, and then select cells B4:B8. The formula will appear in the formula bar with
the worksheet name and cell range separated by an exclamation mark (Berbice!B4:B8)
 Press the Enter key to complete the formula. Excel will add a closing parenthesis to complete
the function.
 Repeat the above steps to add linking formulas for the remaining summation cells.

Use the AutoSum button to get the Totals for Qtr 1, Qtr 2 etc. in row 8 of the worksheet.

(Note: You could use any function to suit your requirement. For example, if you wanted to find the
Average of a range)

43
HOW TO PRINT
Let us now see how to print a worksheet. Click on File - Page Setup.

Under the Page tab, select Landscape if the number of columns is too many to fit in Portrait.

Under the Header/Footer tab, click on Custom Header or Custom Footer. You put text in a Header or
Footer that you want to appear at the top or bottom of every page in your document.

Under the Sheet tab, click Gridlines if you want dividing lines between the cells, and haven’t put a
border around the cells. Click on Rows to repeat at top. This will allow you to specify the row
headings that you want to appear at the top of the table in every page.

Click on Print Preview to view your worksheet before printing. In the Print dialog box, click on
Selection (if you want only certain ranges to be printed), Workbook (all the sheets in the workbook)
or Active Sheet (only the current worksheet).

44

You might also like