You are on page 1of 120

Ms Joanne Zarb

European
Computer
Driving
Licence

AM4 - Advanced
Spreadsheets

Courseware covers
ECDL Advanced Syllabus 2.0

Page 1 of 120
Ms Joanne Zarb

TABLE OF CONTENTS

FORMATTING ......................................................................................................................................... 5
Applying a Table Style to a Cell Range ................................................................................................. 5
Apply Conditional Formatting ............................................................................................................. 6
Creating & Applying Custom Number Formats .................................................................................... 8
Copying & Moving Worksheets between Workbooks ........................................................................ 10
Splitting a Window ............................................................................................................................ 11
Hiding & Showing Rows, Columns & Worksheets .............................................................................. 12

Activity 1 ........................................................................................................................................ 13
FUNCTIONS & FORMULAE..................................................................................................................... 15
Using the Date & Time Functions ...................................................................................................... 17
Using Mathematical Functions .......................................................................................................... 18

Activity 2 ........................................................................................................................................ 20
Using Statistical Functions ................................................................................................................. 21
Using Text Functions ......................................................................................................................... 23

Activity 3 ........................................................................................................................................ 25
Using Financial Functions .................................................................................................................. 26

Activity 4 ........................................................................................................................................ 29
Using Lookup Functions .................................................................................................................... 30
VLOOKUP Function ........................................................................................................................... 30
HLOOKUP Function ........................................................................................................................... 31

Activity 5 ........................................................................................................................................ 32
Using Database Functions ................................................................................................................. 33
DMIN Function.................................................................................................................................. 34
DMAX Function ................................................................................................................................. 35
DCOUNT Function ............................................................................................................................. 35
DAVERAGE Function ......................................................................................................................... 36

Activity 6 ........................................................................................................................................ 37
Using Logical Functions ..................................................................................................................... 38
IF Function ........................................................................................................................................ 38
AND Function.................................................................................................................................... 39
OR Function ...................................................................................................................................... 39
Creating Two-Level Nested Functions................................................................................................ 40

Page 2 of 120
Ms Joanne Zarb

Using a 3-D Reference within a Sum Function ................................................................................... 42



Activity 7 ........................................................................................................................................ 43
CHARTS................................................................................................................................................. 45
Creating a Combined Column & Line Chart ........................................................................................ 45
Adding a Secondary Axis to a Chart ................................................................................................... 46
Changing the Chart Type for a Defined Data Series............................................................................ 48
Adding & Deleting a Data Series in a Chart ........................................................................................ 50
Re-Positioning Chart Title, Legend & Data Labels .............................................................................. 52
Changing the Scale Value Axis ........................................................................................................... 53
Changing Display Units on Value Axis ................................................................................................ 54
Formatting Columns, Bars, Plot Area & Chart Area to Display an Image ............................................. 55

Activity 8 ........................................................................................................................................ 56
ANALYSIS .............................................................................................................................................. 58
Creating & Modifying a Pivot Table ................................................................................................... 58
Modifying the Data Source & Refreshing Pivot Tables ....................................................................... 62
Filtering & Sorting Data in a Pivot Table ............................................................................................ 63
Using One-Input & Two-Input Tables ................................................................................................ 65
One-input (or One-variable) Data Table ............................................................................................ 66

Activity 9 ........................................................................................................................................ 70
Sorting Data by Multiple Columns ..................................................................................................... 70
Creating Customised Lists & Performing Custom Sorts ...................................................................... 71
Automatic Filtering a List................................................................................................................... 74
Applying Advanced Filter Options ..................................................................................................... 77
Using Automatic Sub-Totalling Features ............................................................................................ 80

Activity 10 ...................................................................................................................................... 86
VALIDATING & AUDITING ...................................................................................................................... 88
Entering an Input Message & Error Alerts ......................................................................................... 90
Tracing Precedent or Dependent Cells .............................................................................................. 92
Showing Formulas in Cells ................................................................................................................. 93

Activity 11 ...................................................................................................................................... 94
ENHANCING PRODUCTIVITY.................................................................................................................. 96
Naming & Deleting Cell Ranges ......................................................................................................... 96
Using Named Cell Ranges in a Function ............................................................................................. 97
Using Paste Special Options .............................................................................................................. 97

Page 3 of 120
Ms Joanne Zarb

Creating a Spreadsheet based on an Existing Template ..................................................................... 99


Modifying a Template ....................................................................................................................... 99
Inserting, Editing & Removing a Hyperlink ....................................................................................... 100
Linking Data .................................................................................................................................... 101
Updating & Breaking a Link ............................................................................................................. 102
Importing Delimited Data from a Text File ....................................................................................... 103
Recording a Simple Macro .............................................................................................................. 106
Running a Macro ............................................................................................................................. 108

Activity 12 .................................................................................................................................... 109
COLLABORATIVE EDITING ................................................................................................................... 111
Turning On & Off Track Changes ..................................................................................................... 111
Comparing & Merging Worksheets ................................................................................................. 113
Adding & Removing Password Protection for a Spreadsheet ........................................................... 114
Protecting & Unprotecting Cells & Worksheets ............................................................................... 115
Hiding & Unhiding Formulas............................................................................................................ 119

Activity 13 .................................................................................................................................... 120

Page 4 of 120
Ms Joanne Zarb

FORMATTING

Applying a Table Style to a Cell Range

You can apply a table style to a cell range:


1. Click the Home tab.
2. In the Styles group, click Format as Table.

3. Click the table style to apply. The Create Table dialog box is displayed.
4. Highlight the range of cells to apply the style to.

5. Click OK button.

To remove the table style:


1. Click a cell in the range of cells.
2. In the Design tab below Table Tools, click More in the Table Styles group.
3. Click Clear.

Page 5 of 120
Ms Joanne Zarb

Apply Conditional Formatting

A conditional format is a format such as cell shading or font colour that MS Excel
automatically applies to cells if a specified condition is true. For example, you can apply red
text colour to the cells where the sales are below €100.

To add conditional formatting:


1. Click the Home tab.
2. Highlight the cells to add conditional formatting to.
3. In the Styles group, click Conditional Formatting.
4. Choose Highlight Cells Rules.

5. Click the appropriate rule to use e.g. Between… The Between dialog box is
displayed.
6. Enter the appropriate values.

7. Click in the with drop-down arrow.


8. Click Custom Format… The Format cells dialog box is displayed.
9. Apply the appropriate options.
10. Click OK button to return to the Between dialog box.
11. Click OK button.

Page 6 of 120
Ms Joanne Zarb

Note that:
 
You can add more conditions by repeating the above steps.

To modify the conditional formatting:


1. Click the Home tab.
2. Highlight the cells to modify their conditional formatting.
3. In the Styles group, click Conditional Formatting.
4. Click Manage Rules… The Conditional Formatting Rules Manager dialog box is
displayed.

Page 7 of 120
Ms Joanne Zarb

5. Click the rule to modify.


6. Click Edit Rule… button. The Editing Formatting Rule dialog box is displayed.

7. Modify the condition/s and formatting as necessary.


8. Click OK button to return to the Conditional Formatting Rules Manager dialog box.
9. Click OK button.

Creating & Applying Custom Number Formats

MS Excel comes with several built-in number formats, but at times you may need to use a
number format that is not available in Excel. Custom number formats can contain up to four
sections, each separated by a semicolon (;):

Positive format; Negative format; Zero format; Text format

When you create a custom number format, you do not have to specify all four sections. If
you include only two sections, the first section will be used for both positive numbers and
zero values, while the second section will be used for negative numbers. If you include only
one section, all number types will use that one format. Text is affected by custom formats
only when you use all four sections; the text will use the last section. If you skip a section,
include the ending semicolon for that section.

Format for positive numbers Format for zeros

#,###.00;[Red](#,###.00);0.00;”sales “@

Format for negative numbers Format for text


Page 8 of 120
Ms Joanne Zarb

The basic keys to understanding number format codes are as follows:



MS Excel number formats use a combination of 0, ?, and # symbols with such
 punctuation as dollar signs, percent
 signs, and commas to stand for the formatted digits
in the numbers that you format.
 
 # displays only significant digits and does not display insignificant zeros.

0 (zero)displays insignificant zeros if a number has fewer digits than there are zeros in the
 format.


? adds spaces for insignificant zeros on either side of the decimal point so that decimal
points align when formatted with a fixed-width font, such as Courier New. You can also
 use ? for fractions that have varying numbers of digits.

Text (e.g. the Euro currency symbol) that will be included with numbers should be
typed within inverted quotes. The Euro (€) currency symbol can be inserted by
pressing ALT+0128 on the numeric keypad. The Sterling (£)  currency symbol can
 be inserted by pressing ALT+0163 on the numeric keypad.

To set the colour for a section of the format, type the name of one of the following
eight colours in square brackets in the section. The colour code must be the first
item in the section. For example if you want negative numbers to be displayed
 in
red type [Red] within square brackets before the negative number section.

Cell Entry Custom Number Format How it appears


12000 #,#### 12,000
1234.59 ####.# 1234.6
8.9 #.000 8.900
.631 0.# 0.6
12 #.0# 12.0
1234.568 #.0# 1234.57
44.398 44.398
102.65 ???.??? 102.65
2.8 2.8
25432.22 "€" #,###.00 € 24,432.22
(€ 24,432.22)
-25432.22 "€" #,###.00;[Red]( "€" #,###.00)
(displayed in red)

To create a custom number format:


1. Click the Home tab.
2. Select the cells you want to format.
3. In the Number group, click the Format Cells: Number Dialog Box Launcher. The
Format Cells dialog box is displayed.
4. In the Number tab, in the Category: list, click Custom.
5. In the Type: box, type the codes to create the format you want.
6. Click OK button.

Page 9 of 120
Ms Joanne Zarb

To delete a custom number format:


1. Repeat steps 1-4 as above.
2. At the bottom of the Type: box, click the custom format you want to delete.
3. Click Delete button.

Note that:

MS Excel applies the default
General format to any cells in the workbook that were formatted with
the deleted custom format.

Copying & Moving Worksheets between Workbooks

To move or copy worksheets between workbooks:


1. Open the workbook containing the worksheets to be move or copied.
2. Open the destination workbook that will receive the worksheets.
3. Select the sheets you want to move or copy.
4. Click the Home tab.
5. In the Cells group, click Format.
6. Click Move or Copy Sheet… The Move or Copy dialog box is displayed.

7. In the To book: field select the workbook to receive the sheets. To move or copy
the selected sheets to a new workbook, click new book.
8. In the Before sheet: field select the sheet before which you want to insert the
moved or copied sheets.
9. To copy the sheets instead of moving them, select the Create a copy check box.

Page 10 of 120
Ms Joanne Zarb

10. Click OK button.

Splitting a Window

You can split the MS Excel window into multiple resizable panes containing views of your
worksheet. You can use this feature to view multiple distant parts of your worksheet at
once.

To split a window:
1. Click any cell in the workbook.
2. Click the View tab.
3. In the Window group, click Split.

Note that:

The program
 splits the window vertically at the left edge of the pointer and horizontally along the
 top edge.

After you split the window  into panes, you can move the cell cursor into a particular pane by
clicking one of its cells.

You can move the vertical and horizontal split bars:


1. Position the pointer on the split bar to move.
2. Drag the mouse to the location where the split bar will be moved.

To remove split bars


1. Click the View tab.
2. In the Window group, click Split.

Note that:
 
Alternatively you can remove the split bars by double-clicking these.

Page 11 of 120
Ms Joanne Zarb

Hiding & Showing Rows, Columns & Worksheets

When working on a large worksheet, you may


wish to focus on data located in columns or
rows that are far away from each other. In
order to do so you can make use of the
hide/unhide facility in MS Excel.

To hide rows or columns:


1. Click the Home tab.
2. Select the rows or columns you want to
hide. If you want to hide a worksheet
click in any cell of the worksheet to
hide.
3. In the Cells group, click Format.
4. Highlight Hide & Unhide.
5. Choose the appropriate option.

To unhide rows or columns:

1. Select a row or column on each side of


the hidden rows or columns you want
to display.
2. Repeat steps 3-5 as above.

Page 12 of 120
Ms Joanne Zarb
Note that:

If the first row or column of a worksheet
 is hidden, type A1 in the Reference box, and press
ENTER key. Repeat steps 3-5 as above.

To display a hidden worksheet/s:


1. In the Cells group, click Format.
2. Highlight Hide & Unhide.
3. Click Unhide Sheet… The Unhide dialog box is displayed.

4. In the Unhide sheet: box, click the name of the hidden sheet (e.g. freeze) you want
to display.
5. Click OK button.

 
Activity 1

You will use Exercises

1. Open one.xlsx located in Exercises folder.


2. In the data worksheet:
a. Apply Table Style Light 9 to the cell range A1 to I39.
b. Change the style applied in step 2 to Table Style Medium 3.
c. Change the style applied in step 3 to None
d. Switch off the automatic filters in the header rows.
3. In the data worksheet, apply the following formatting to the cell range C2 to
C39:
a. Cells containing the text Mr. should be shaded in yellow colour.
b. Cells containing the text Miss should be shaded in light green colour.
c. Edit the formatting of the first condition such that the cells containing Mr.
will be shaded in light blue.
d. Remove the formatting of the second condition such that the cells
containing Miss will not be shaded.

Page 13 of 120
Ms Joanne Zarb

4. In the data worksheet, apply the following formatting to the cell range G2 to I39:
a. The text colour of cells containing the numbers between 1 and 2 should
be red.
b. The text colour of cells containing the numbers between 3 and 4 should
be blue.
c. The text colour of cells containing the numbers between 5 and 6 should
be green.
d. The text colour of cells containing the numbers between 7 and 8 should
be pink.
5. Open two.xlsx located in Exercises folder.
6. In the custom number worksheet:
a. Apply a custom number format to the numbers in the cell range B4:B9. The
custom number format should display positive numbers with the € followed by
a space. Do not include any figures after the decimal point. Negative numbers
should be displayed in the same way but within brackets.

b. Apply a custom number format to the numbers in the cell range C4:C9. The
custom number format should display positive numbers with the € followed by
a space and the number including the decimal point and two numbers after
the decimal point. Negative numbers should be displayed in the same way but
within brackets and in red colour.
7. Move the custom number worksheet in two.xlsx to be before the data worksheet
in first.xls.
8. Copy the sales worksheet in one.xlsx to be before Sheet2 in two.xlsx.
9. In one.xlsx:
a. Split the data worksheet to display a horizontal and vertical split bar.
b. Remove the horizontal and vertical split bars.
10. Hide column A and I in the data worksheet.
11. Hide the sales worksheet in one.xlsx.
12. Unhide column A and I in the data worksheet.
13. Unhide the sales worksheet in one.xlsx.
14. Save and close one.xlsx and two.xlsx.

Page 14 of 120
Ms Joanne Zarb

FUNCTIONS & FORMULAE

There are many functions available in MS Excel which you can use to carry out calculations
or operations. You have probably already used functions such as =SUM() and =AVERAGE().

You can enter a function in the active cell in three ways:


1. Type the function directly into the cell.
2. Use the AutoSum button in the Home tab.
3. Use the Insert Function dialog box.

Type a Function Directly into a Cell

This is the most straightforward way to enter a function.


MS Excel displays a ScreenTip as you enter the function. ScreenTip

Use the AutoSum Drop-down Menu

The AutoSum button on the Home tab can also be used to insert
functions such as Average, Count, Max, and Min functions, together
with a More Functions entry that displays the Insert Function dialog
box (discussed next).

Use the Insert Function dialog box.

The Insert Function dialog box, guides you through the process of choosing a function and
specifying its arguments correctly.

The Insert Function dialog box can be displayed by:


 
 Click the Insert Function button in the Formula bar.

 
 Click the Formulas tab and click Function.




 
Click the More Functions… entry on the AutoSum drop-down menu.

Page 15 of 120
Ms Joanne Zarb

To use the Insert Function dialog box:


1. Display the Insert Function dialog box as explained above.

2. You can type the name of the function or a brief description of what you want to do
in the Search for a function: box.
Alternatively, you can choose the category e.g. Math & Trig to which the function
belongs.
3. Click the function e.g. SUM to use below Select a function:
4. Click OK button. The Function Arguments dialog box is displayed. The display
varies according to the function selected in step 3.

Page 16 of 120
Ms Joanne Zarb
5. Enter the data in each argument box in turn, either by typing in the data or by
clicking the Collapse Dialog buttons and using the mouse to select the appropriate
cell or range references. As you work, MS Excel displays information on the current
argument and, as soon as appropriate, the result of the formula.
6. Click OK button.

Using the Date & Time Functions

MS Excel stores dates as sequential serial numbers so they can be used in calculations. In
Windows based computer, January 1, 1900 is serial number 1, and January 1, 2008 is serial
number 39448 because it is 39,448 days after January 1, 1900.

TODAY Function
The =TODAY() function is used to insert the date from your computer‘s internal clock.

To use the TODAY function:


1. Click the cell where the current date will be
inserted e.g. A2.
2. Type =TODAY()
3. Press ENTER key.

Note that:

The TODAY function returns the serial number of the current date. If the cell format was General
before the function was entered, the result is formatted as a date.

DAY Function
The =DAY() function returns the day of the month for
a date.

To use the DAY function:


1. Click the cell where the day will be inserted
e.g. A5.
2. Type =DAY(A2)
3. Press ENTER key.

Note that:
 
 The day is given as an integer ranging from 1 to 31.

You can also enter the date directly into the function e.g. =DAY(„25/04/06‟). The result will
also be 25.

Page 17 of 120
Ms Joanne Zarb

MONTH Function

The =MONTH() function returns the month for a date.

To use the MONTH function:


1. Click the cell where the day will be inserted e.g.
A5.
2. Type =MONTH(A2)
3. Press ENTER key.

Note that:
 
 The month is given as an integer ranging from 1 to 12.

You can also
 enter the date directly into the function e.g. =MONTH(„25/04/06‟). The result will
also be 4.

YEAR Function

The =YEAR() function returns the year for a date.

To use the MONTH function:


1. Click the cell where the day will be inserted e.g.
A5.
2. Type =YEAR(A2)
3. Press ENTER key.

Note that:
 
 The year is given as an integer in the range 1900 to 9999.

You can also enter
 the date directly into the function e.g. =YEAR(„25/04/06‟). The result will
also be 2006.

Using Mathematical Functions

ROUNDDOWN Function

The ROUNDDOWN function rounds a number down toward 0 (zero).


= ROUNDDOWN(number,num_digits)
where Number is the number you want to round down.

Num_digits specifies the number of digits to which you want to round number.

Note that:

 If num_digits is
greater than 0 (zero), then number is rounded down to the specified number of
decimal places.
 
 If num_digits is 0, then number is rounded down to the nearest integer.
 
If num_digits is less than 0, then number is rounded down to the left of the decimal point.

Page 18 of 120
Ms Joanne Zarb

Formula Description (Result)


=ROUNDDOWN(3.2,0) Rounds 3.2 down to zero decimal places (3)
=ROUNDDOWN(76.9,0) Rounds 76.9 down to zero decimal places (76)
=ROUNDDOWN(3.14159, 3) Rounds 3.14159 down to three decimal places (3.141)
=ROUNDDOWN(-3.14159, 1) Rounds -3.14159 down to one decimal place (-3.1)
=ROUNDDOWN(31415.92654, -2) Rounds 31415.92654 down to 2 decimal places to the left of the
decimal (31400)

ROUNDUP Function

The ROUNDUP function rounds a number up, away from 0 (zero).

= ROUNDUP(number,num_digits)
where Number is the number you want to round.

Num_digits specifies the number of digits to which you want to round number.

Note that:

 If num_digits isgreater than 0 (zero), then number is rounded up to the specified number of
decimal places.
 
 If num_digits is 0, then number is rounded to the nearest integer.
 
If num_digits is less than 0, then number is rounded up to the left of the decimal point.

Formula Description (Result)


=ROUNDUP(3.2,0) Rounds 3.2 up to zero decimal places (4)
=ROUNDUP(76.9,0) Rounds 76.9 up to zero decimal places (77)
=ROUNDUP(3.14159, 3) Rounds 3.14159 up to three decimal places (3.142)
=ROUNDUP(-3.14159, 1) Rounds -3.14159 up to one decimal place (-3.2)
=ROUNDUP(31415.92654, -2) Rounds 31415.92654 up to 2 decimal places to the left of the
decimal (31500)

SUMIF Function

The SUMIF function adds the cells specified by a given criteria.


=SUMIF(range,criteria,sum_range)

where Range is the range of cells you want evaluated.

Criteria is the criteria in the form of a number, expression, or text that defines
which cells will be added. For example, criteria can be expressed as 32, "32",
">32", "apples".
Sum_range are the actual cells to sum.

Note that:
 
The cells in sum_range are summed only if their corresponding cells in range match the criteria.

Page 19 of 120
Ms Joanne Zarb

 
 If sum_range is omitted, the cells in range are summed.

MS Excel provides additional functions that can be used to analyse your data based
on a condition. For example, to count the number of occurrences of a string of text
or a number within a range of cells, use the COUNTIF function. To have a formula
return one of two values based on a condition,
 such as a sales bonus based on a
specified sales amount, use the IF function.

Consider the following example. To calculate the sum of commissions for property values
over €100,000 enter the formula as shown below.

Consider the following example. To calculate the expenses incurred for the lab enter the
formula as shown below.


Activity 2
You will use Exercises.
1. Open three.xlsx located in Exercises folder.
2. In the Date & Time worksheet:
a. Enter a function in cell A2 so that the current date will be displayed.
b. Enter a function in cell A5 that will return the day of the month for the
date in cell A2.
c. Enter a function n cell A8 that will return the month for the date in cell A2.
d. Enter a function in cell A11 that will return the year for the date in cell A2.

3. In the Round worksheet:

Page 20 of 120
Ms Joanne Zarb
a. In cell B1 round 4.2 down to zero decimal places.
b. In cell B2 round 76.9 down to zero decimal places
c. In cell B3 round 3.145 down to two decimal places
d. In cell B4 round 4.2 up to zero decimal places
e. In cell B5 round 76.9 up to zero decimal places
f. In cell B6 round 3.145 up to two decimal places,

4. In the Property worksheet, enter a function in cell B7 to calculate the sum of


commissions for property values over €100,000.
5. In the School worksheet, enter a function in cell B4 to calculate the sum of
expenses for Labs. In cell B5 enter a function to calculate the sum of expenses for
Software. In cell B6 enter a function to calculate the sum of expenses for Network.
6. Save and close three.xlsx.

Using Statistical Functions

Many of the most frequently used spreadsheet functions involve counting values or
worksheet elements (text, blank cells, specific number or text, etc.). A "counting" function
will return the number of cells in a range that meet certain criteria. There are several
variations of the COUNT function. Each will look for different types of data in a range, and
then return the result.

COUNTIF Function

The COUNTIF function counts the number of cells within a range that meet the given
criteria.
=COUNTIF(range,criteria)
where Range is the range of cells from which you want to count cells.
Criteria is the criteria in the form of a number, expression, cell reference, or text
that defines which cells will be counted. For example, criteria can be expressed as
32, "32", ">32", "apples", or B4.

Consider the following example. To calculate the number of students who got over 80 enter
the function as shown below.

Page 21 of 120
Ms Joanne Zarb

COUNTBLANK Function

The COUNTBLANK function counts empty cells in a specified range of cells.


= COUNTBLANK(range)
where range is the range from which you want to count the blank cells.

RANK Function

The RANK function returns the rank of a number in a list of numbers. The rank of a number is
its size relative to other values in a list. If you were to sort the list, the rank of the number
would be its position.
= RANK(number,ref,order)
where number is the number whose rank you want to find.
ref is an array of, or a reference to, a list of numbers. Nonnumeric values in ref are
ignored.
order is a number specifying how to rank number. If order is 0 (zero) or omitted,
MS Excel ranks number as if ref were a list sorted in descending order. If order is
any nonzero value, MS Excel ranks number as if ref were a list sorted in ascending
order.

Page 22 of 120
Ms Joanne Zarb

Note that:

RANK gives duplicate numbers the same rank. However, the presence of duplicate
numbers affects the ranks of subsequent numbers. For example, in a list of integers
sorted in ascending order, if the number 10 appears twice and has
 a rank of 5, then
11 would have a rank of 7 (no number would have a rank of 6).

Formula Description (Result)


=RANK(A2,A1:A5,1) Rank of 3.5 in the list above (3)
=RANK(A1,A1:A5,1) Rank of 7 in the list above (5)

Using Text Functions

LEFT Function

The LEFT function returns the first character or characters in a text string, based on the
number of characters you specify.
=LEFT(text,num_chars)

Where text is the text string that contains the characters you want to extract.
num_chars specifies the number of characters you want LEFT to extract.

Note that:
 
 Num_chars must be greater than or equal to zero.
 
 If num_chars is greater than the length of text, LEFT returns all of text.
 
If num_chars is omitted, it is assumed to be 1.

Formula Description (Result)


=LEFT(A1,4) First four characters in the first string (Sale)
=LEFT(A2) First character in the second string (S)

RIGHT Function

The RIGHT function returns the last character or characters in a text string, based on
the number of characters you specify.
=RIGHT(text,num_chars)
where text is the text string that contains the characters you want to extract.
num_chars specifies the number of characters you want RIGHT to extract.

Note that:
 
 Num_chars must be greater than or equal to zero.
 
 If num_chars is greater than the length of text, RIGHT returns all of text.
 
If num_chars is omitted, it is assumed to be 1.

Page 23 of 120
Ms Joanne Zarb

Formula Description (Result)


=RIGHT(A1,5) Last 5 characters of the first string (Price)
=RIGHT(A2) Last character of the second string (r)

MID Function

The MID function returns a specific number of characters from a text string, starting at the
position you specify, based on the number of characters you specify.
=MID(text,start_num,num_chars)

where text is the text string that contains the characters you want to extract.
start_num is the position of the first character you want to extract in text. The first
character in text has start_num 1, and so on.
num_chars specifies the number of characters you want MID to return from text.

Formula Description (Result)


=MID(A1,1,5) Five characters from the string above, starting at the first
character (Fluid)
=MID(A1,7,20) Twenty characters from the string above, starting at the
seventh (Flow)
=MID(A1,20,5) Because the starting point is greater than the length of
the string, empty text is returned ()

TRIM Function

The TRIM function removes all spaces from text except for single spaces between words.
Use TRIM on text that you have received from another application that may have irregular
spacing.
=TRIM(text)

where text is the text from which you want spaces removed.

Formula Description (Result)


=TRIM(" First Quarter Earnings ") Removes leading and trailing spaces from the text in the
formula (First Quarter Earnings)

CONCATENATE Function

The CONCATENATE function joins several text strings into one text string.
=CONCATENATE(text1,text2…)

where Text1, text2 are 1 to 30 text items to be joined into a single text
item. The text items can be text strings, numbers, or single-cell
references.

Page 24 of 120
Ms Joanne Zarb

Consider the following example.

Formula Description (Result)


=CONCATENATE("Stream population for ",A2," Concatenates a sentence from the data above
",A3," is ",A4,"/mile") (Stream population for brook trout species is
32/mile)


Activity 3
You will use Exercises.

1. Open four.xlsx located in Exercises folder.


2. In the Grades worksheet:
a. Enter a function in cell A20 to count the number of students in class.
b. Enter a function in cell B20 to count the number of students who sat for
Quiz 1.
c. Enter a function in cell C20 to count the number of students who were
absent for Quiz 1.
d. Enter a function in cell D20 to count the number of students who sat for
Quiz 3.
e. Enter a function in cell F20 to count the number of students who got over
89 without taking the extra credit.
f. Enter a function in cell G20 to count the number of students who took
the extra credit.
g. Enter a function in cell H20 to count the number of students who got over
89 because the followed the extra credit (hint you need to use subtraction).

3. In the Results worksheet:


a. Enter a function in cell C9 to count the number of students who got over 80.
b. Enter a function in cell C11 to count the number of students who got
less than 50.
c. Enter a function in cell C13 to rank the number in cell C3 in the cell
range C2:C7.
d. Enter a function in cell C15 to rank the number in cell C5 in the cell
range C2:C7.
4. In the Text worksheet:
a. Enter a function in cell B2 to copy the number in cell A2 without km.
Copy the function in cell B2 to cell range B3:B5.
b. Enter a function in cell B9 to copy the number in cell A9 without #. Copy
the function in cell B9 to cell range B10:B12.
c. Enter a function in cell B16 to copy the content in cell A16 without any
extra spaces. Copy the function in cell B16 to cell range B17:B18.
d. Enter a function in cell E2 to copy the three numbers in cell D2 without
any alphabet characters. Copy the function in cell E2 to cell range
E3:E5.

Page 25 of 120
Ms Joanne Zarb

e. Enter a function in cell F10 to join the alphabet letters MT in cell E10 to
the number 60321 in cell D10. Copy the function in cell F10 to cell range
F11:F12.
5. Save and close four.xlsx.

Using Financial Functions

MS Excel has several financial management functions. These can be used to calculate loan
payments, make decisions about investment opportunities and compare investment returns.
The financial functions make use of the following arguments:

Argument Description
PV (Present Value) This is the principal amount.
If you invest €1,000 in a bank, this amount represents the principal, or
present value of the money you invested.
If you borrow €75,000 to purchase an apartment, this amount represents
the principal or present value of the loan.
The present value may be positive or negative.
FV (Future Value) This is the principal plus interest.
If you invest €5,000 for 5 years and earn 6% annual interest, you receive
€6,312.38 at the end of the five-year term. The amount is the future value
of your €5,000 investment.
If you take out a three-year car loan for €15,000 and pay 7% annual
interest, you pay a total of €16,673.16. This amount represents the
principal plus the interest you paid.
The future value may be positive or negative.
PMT (Payment) This is either principal, or principal plus interest.
If you deposit €100 per month into a savings account, €100 is the payment.
If you have a monthly loan payment of €215, the €215 is made up of
principal and interest.
Rate (Interest rate) Interest is a percentage of the principal, usually expressed on an annual
basis.
For example, you might earn 5.5% annual interest on a bank account. On
your home loan may have a 7.75% interest rate.
Nper (Term) This is the term during which interests will be paid or payments will be
made.
A 12 month fixed account has a term of one year. A 30-year home loan has
a term of 30 years.
Type When payment is to be made (0 if omitted); 0 = at end of period; 1 = at
beginning of period

FV Function

The FV function is used to calculate the future value of an investment based on periodic
constant payments and a constant interest rate.

For example you can use the FV function to calculate how much money you will have in
your bank account provided that you invest the same sum of money per month, on a
regular basis and if the interest rate does not change over the investment period.

Page 26 of 120
Ms Joanne Zarb

=FV(rate,nper,pmt,[pv],[type])

Note that:
 
 PV and type (within square brackets) can be omitted.

Make sure that you are consistent about the units you use for specifying rate and
nper. If you make monthly payments on a four-year loan at 12 percent annual
interest, use 12%/12 for rate and 4*12 for nper.If you make annual payments on
 the same loan, use 12% for rate and 4 for nper.

For all the arguments, cash you pay out, such as deposits to savings, is represented by
negative numbers;cash you receive, such as dividend cheques, is represented by
positive numbers.

Example 1: You are going to invest €100 into a


fixed account and leave it there for 10 years.
The annual interest rate on the savings account
is 6% compounded monthly. How much will it
have grown to be in 10 years?

A negative sign is placed in front of the PV (i.e.


–B1) because you invested the money
(€100). By convention money flowing away
from you should be negative.

The type is set to 0 assuming the payment is made at the end of the ten year term.

You can also use the following formula: =FV(B2,B4,,-B10)

Example 2: You are going to put an


initial deposit of €1,000 into a bank
account and then €100 each month for
ten years. The annual interest rate is 6%
compounded monthly. How much will
you have at the end of 10 years?

A negative sign is placed in front of the


PMT and PV (i.e. –B3, –B1) because you
are paying money.

Example 3: You want to borrow €14,500 for 5


years at 8% annual interest. How much will
you pay back at the end of the 5 years?

Page 27 of 120
Ms Joanne Zarb
PV Function

The PV function (Present Value) calculates the present value of an investment i.e. the total
amount that a series of future payments is currently worth.

=PV(rate,nper,pmt,[fv],[type])

Example 1: You need to make a deposit


today that in 10 years will have grown to
€100. The interest rate is 8%. How much
should you deposit?

Example 2: You are presented with an investment


opportunity that returns €1,000 each year over the
next 5 years. To receive this annuity, you must
invest €4,000. Are you willing to pay €4,000 today
to earn €5,000 over the next 5 years?

To decide whether this investment is acceptable,


you need to determine the present value of the
stream of €1,000 payments you will receive.

Since you can invest your money in a 5-year bank account at 3.5%, you will use 3.5% as
the interest rate of the investment. This interest rate (3.5%) is a sort of hurdle over which
an investment must leap before it becomes attractive to you. This is often called the hurdle
rate.

The result of the present value of this investment opportunity is €4515.05. This means that
if you would like to earn €5,000 after 5 years, you would need to invest €4515.05 in the
bank at 3.5%. Therefore the investment opportunity is attractive because you will only
invest €4000 to receive €5,000. Through the bank you will need to invest €4,515.05.

PMT Function

The PMT function calculates the payment for a loan based on constant payments and a
constant interest rate.
=PMT(rate,nper,pv,[fv],[type])

Note that:

The payment returned by PMT includes  principal and interest but no taxes, reserve payments, or
fees sometimes associated with loans.

Page 28 of 120
Ms Joanne Zarb
Example 1: You want to borrow €75,000 to
purchase an apartment. The annual
interest rate is 5%. You want to work out
the amount of money that you will pay at
the end of each month over 30 years (i.e.
30×12=360months).

The annual interest rate is divided by


12 because you will be making monthly
payments.

Most of the time you can omit the FV and


Type from your PMT function.

Example 2: You would like to have €50,000 in


your bank account by the time you retire. You
have 30 years until retirement and you have
found a special bank account which pays 6%
interest for 30 years. How much do you have to
deposit each month to reach your goal amount?


Activity 4
You will use Exercises.
1. Open five.xlsx located in Exercises folder.
2. You are going to invest €100 into a fixed account and leave it there for 10 years.
The annual interest rate on the savings account is 6% compounded monthly. How
much will it have grown to be in 10 years? Enter the appropriate function in cell B8
in the FV worksheet.
3. You are going to put an initial deposit of €1,000 into a bank account and then
Lm100 each month for ten years. The annual interest rate is 6% compounded
monthly. How much will you have at the end of 10 years? Enter the appropriate
function in cell B18 in the FV worksheet.

4. You want to borrow €14,500 for 5 years at 8% annual interest. How much will you
pay back at the end of the 5 years? Enter the appropriate function in cell B28 in
the FV worksheet.
5. You need to make a deposit today that in 10 years will have grown to €100. The
interest rate is 8%. How much should you deposit? Enter the appropriate function in
cell B8 in the PV worksheet.
6. You are presented with an investment opportunity that returns €1,000 each year
over the next 5 years. To receive this annuity, you must invest €4,000. Are you
willing to pay €4,000 today to earn €5,000 over the next 5 years? Enter the
appropriate function in cell B18 in the PV worksheet.
7. You want to borrow €75,000 to purchase an apartment. The annual interest rate is
5%. What will be your monthly payment? Enter the appropriate function in cell B6
in the PMT worksheet.
8. You would like to have €50,000 in your bank account by the time you retire. You
Page 29 of 120
Ms Joanne Zarb
have 30 years until retirement and you have found a special bank account which
pays 6% interest for 30 years. How much do you have to deposit each month to
reach your goal amount? Enter the appropriate function in cell B14 in the PMT
worksheet.
9. Save and close five.xlsx.

Using Lookup Functions

MS Excel provides two basic lookup functions to search a column or row for a lookup value
to return another value as a result.

VLOOKUP Function

The VLOOKUP function looks up the value in the first column of the lookup table and returns
the corresponding value in a specified table column. The lookup table is arranged vertically.

VLOOKUP(lookup_value,table_array,col_index_num,[range_lookup])

where lookup_value is the value to be looked up in the first column of the lookup table.

table_array is the range that contains the lookup table.


col_index_num is the column number within the table from which the matching
value is returned.
range_lookup (Optional). If TRUE or omitted, an approximate match is returned.
(If an exact match is not found, the next largest value that is less than
lookup_value is returned.) If FALSE, VLOOKUP will search for an exact match. If
VLOOKUP cannot find an exact match, the function returns #N/A.

Example: The sheet has two tables: (a) the table containing the scores of students and a
blank column for grades and (b) the grades table having the Scores column and the Grade
column.

=VLOOKUP($C4,$F$4:$G$8,2)

Page 30 of 120
Ms Joanne Zarb

The VLOOKUP function will be used to look up the score e.g. 240 (in cell C4) in the Grades
Table. The score 240 is over 230 corresponding to Grade A in the Grades Table. Therefore
grade A will be automatically inserted in cell D4.

The Grades Table is referred to as the look-up table.

Note that:

The values in the first column of look-up table must be placed in ascending sort order;
otherwise, VLOOKUP may not give the correct
 value. The values in the Score column of
 the Grades Table are in ascending order.

The dollar sign in $C4 is used to ensure that we keep referring to the same cell when
using the AutoFill feature.
 Similarly absolute cell references are used for the look-up
 table $F$4:$G$8.

Column  headings in the lookup table are not included when defining the range of the look-up
 table.

The value 2 refers to the second column in the Grades  Table. This means that values/text in
column 2 of the look-up table will be placed in cell D4.

Now let‘s assume that we have the Award column. We cannot look for the grade in the
Grades Table and have the corresponding award entered in column E. This is because the
Grade column in the Grades Table would have to be sorted in ascending order. If we sort
the Grade column in the Grades Table in ascending order, column D will display errors. Here
we will need to look-up the score in the Grades Table and have the corresponding Award
entered in column E.

=VLOOKUP($C4,$G$4:$I$8,3)

HLOOKUP Function

The HLOOKUP function works just like the VLOOKUP function except that the lookup table is
arranged horizontally instead of vertically. The HLOOKUP function looks up the value in the
first row of the lookup table and returns the corresponding value in a specified table row.

HVLOOKUP(lookup_value,table_array,row_index_num,[range_lookup])

where lookup_value is the value to be looked up in the first row of the lookup table.

table_array is the range that contains the lookup table.


Page 31 of 120
Ms Joanne Zarb

row_index_num is the row number within the table from which the matching
value is returned.
range_lookup (Optional). If TRUE or omitted, an approximate match is returned.
(If an exact match is not found, the next largest value that is less than
lookup_value is returned.) If FALSE, HLOOKUP will search for an exact match. If
HLOOKUP cannot find an exact match, the function returns #N/A.

Example: The sheet has two tables: (a) the Grades Table having the Scores column and the
Grade column and (b) the table containing the scores of students and a blank column for
grades. Note that the Grades Table (lookup table) is arranged horizontally.

=HLOOKUP($C10,$B$3:$F$5,3)

=HLOOKUP($C10,$B$3:$F$5,2)


Activity 5
You will use Exercises.
1. Open six.xlsx located in Exercises folder.
2. In the VLOOKUP worksheet, add a lookup function in cell D4 to input the grade
corresponding to the score in cell C4. Copy the function in cell D4 to the cell
range D5:D8.
3. Add a lookup function in cell E4 to input the award corresponding to the score in
cell C4. Copy the function in cell E4 to the cell range E5:E8.
4. In the HVLOOKUP worksheet, add a lookup function in cell D10 to input the grade
corresponding to the score in cell C10. Copy the function in cell D10 to the cell
range D11:D14.
5. Add a lookup function in cell E10 to input the award corresponding to the score in
cell C10. Copy the function in cell E10 to the cell range E11:E14.
6. Save and close six.xlsx.

Page 32 of 120
Ms Joanne Zarb
Using Database Functions

We have already used the standard statistical functions SUM, MIN, MAX and COUNT. Their
D-equivalents behave in a similar way but only operate on those values that meet criteria
specified by you.

The criteria are not included in the formula, as they were with SUMIF and COUNTIF, but
these are entered in a range of cells on your worksheet. This means that you can build
complex criteria.

DSUM Function

The DSUM function returns the total of all the values in a database column satisfying a
condition/s.

=DSUM(database, field, criteria)

where database is the range of cells that make up the database or list.
field is the column name or number indicating which column to use.
criteria is the range of cells that contain the conditions.

Example:The worksheet displays a database list. In cell C13 you want to find the sum of
st
salaries for persons who are less than 20 years old and employed before the 1 January
2003.

At the top of the worksheet the same headings used for the database list are typed in the
first row. On the second row the criteria where entered i.e. in cell B2 the criterion <20 was
entered and in cell D2 the criterion <=01/01/03 was entered.

In cell C13, the DSUM function was entered: =DSUM(A4:D11,3,A1:D2)

Page 33 of 120
Ms Joanne Zarb

Note that:
 
 The "criteria" must be in a contiguous block of adjacent cells.

The "criteria" can be anywhere on the active sheet,  although it is recommended not to put it
 below the data, in case more data is added later on.

Make sure the "criteria" and "database" ranges  do not overlap and that they are always
separated by at least one blank row or column.

DMIN Function

The DMIN function returns the smallest number in a database column satisfying a
condition/s.
=DMIN(database, field, criteria)

where database is the range of cells that make up the database or list.
field is the column name or number indicating which column to use.
criteria is the range of cells that contain the conditions.

Example: The worksheet displays a database list. In cell C13 you want to find the minimum
st
salary paid for persons who are less than 20 years old and employed before the 1 January
2003.

At the top of the worksheet the same headings used for the database list are typed in the
first row. On the second row the criteria where entered i.e. in cell B2 the criterion <20 was
entered and in cell D2 the criterion <=01/01/03 was entered.

In cell C13, the DMIN function was entered: =DMIN(A4:D11,3,A1:D2)

Page 34 of 120
Ms Joanne Zarb
DMAX Function

The DMAX function returns the largest number in a database column satisfying a
condition/s.
=DMAX(database, field, criteria)

where database is the range of cells that make up the database or list.
field is the column name or number indicating which column to use.
criteria is the range of cells that contain the conditions.

Example: The worksheet displays a database list. In cell C13 you want to find the maximum
st
salary paid for persons who are less than 20 years old and employed before the 1 January
2003.

At the top of the worksheet the same headings used for the database list are typed in the
first row. On the second row the criteria where entered i.e. in cell B2 the criterion <20 was
entered and in cell D2 the criterion <=01/01/03 was entered.

In cell C13, the DMAX function was entered: =DMAX(A4:D11,3,A1:D2)

DCOUNT Function

The DCOUNT function returns the total number of values in a database column satisfying a
condition/s.
=DCOUNT (database, field, criteria)

where database is the range of cells that make up the database or list.
field is the column name or number indicating which column to use.
criteria is the range of cells that contain the conditions.

Page 35 of 120
Ms Joanne Zarb

Example: The worksheet displays a database list. In cell C14 you want to find the number of
employees who are less than 20 years old and received less than €20,000 salary.

At the top of the worksheet the same headings used for the database list are typed in the
first row. On the second row the criteria where entered i.e. in cell B2 the criterion <20 was
entered and in cell C2 the criterion <=19000 was entered.

In cell C14, the DCOUNT function was entered: =DCOUNT(A4:D11,3,A1:D2)

DAVERAGE Function

The DAVERAGE function averages the values in a field (column) of records in a list or
database that match conditions you specify.
=DAVERAGE(database, field, criteria)

where database is the range of cells that make up the database or list.
field is the column name or number indicating which column to use.
criteria is the range of cells that contain the conditions.

Example: The worksheet displays a database list. In cell C13 you want to find the average
salary of employees who are less than 20 years old.

At the top of the worksheet the same headings used for the database list are typed in the
first row. On the second row the criteria where entered i.e. in cell B2 the criterion <20 was
entered.

In cell C14, the DAVERAGE function was entered: =DAVERAGE(A4:D11,3,A1:D2)

Page 36 of 120
Ms Joanne Zarb


Activity 6
You will use Exercises.
1. Open seven.xlsx located in Exercises folder.

2. In the DSUM worksheet, add a function in cell C13 to find the sum of salaries for
employees who are less than 20 years old and employed before the 1st January
2003.
3. In the DMIN & DMAX worksheet, add a function in cell C13 to find the lowest
salary received by employees who are less than 20 years old and employed before
the 1st January 2003.
4. In the DMIN & DMAX worksheet, add a function in cell C15 to find the highest
salary received by employees who are less than 20 years old and employed before
the 1st January 2003.
5. In the DCOUNT & DAVERAGE worksheet, add a function in cell C13 to find the
number of employees who are less than 20 years old and received a salary which is
less than or equal to €19,000.
6. In the DCOUNT & DAVERAGE worksheet, add a function in cell C13 to find the
average salary of employees who are less than 20 years old.
7. Save and close seven.xlsx.

Page 37 of 120
Ms Joanne Zarb

Using Logical Functions

IF Function

The IF function is a logical function that evaluates a condition and returns one of two
answers, depending on the result of the evaluation. The IF function has three parts. The
first part determines if a situation is true or false; the second part determines the result to
display if the first part is true; and the third part determines the result to display if the first
part is false.

IF(logical_test,value_if_true,value_if_false)

Example 1: Column D contains the text PASS if the mark in column C is greater or equal to
45. The function used in cell D2 is =IF(C2>=45,”PASS”,”FAIL”). The function returns
PASS in cell D2 because the mark in C2 is greater than 45. The function returns FAIL in cell
D4 because the mark in C4 is less than 45.

Note that:

The text PASS and FAIL are enclosed with inverted quotes. The latter are used when the result
returned by a logical test is text data.

Example 2: A company awards a 2% commission to those salespersons who exceed €3,000


sales. The commission is 2% of the sales amount. No commission is awarded if the
salesperson does not exceed €3,000. The function entered in cell D2 is
=IF(C2>3000,C2*2%,0).

Note that:
 
Inverted quotes are not used if the results of the logical test are not text data.
Page 38 of 120
Ms Joanne Zarb

AND Function

The AND function works similarly to the OR function except that all the conditions must
be true for the AND condition to return TRUE.

=AND(Condition1,Condition2,Condition3,…)

AND returns TRUE only if all conditions are TRUE. Otherwise, AND returns FALSE.

Example 1: The AND function will be


used to check whether a car will start or
not. To keep it simple we are only
considering two factors, petrol and the
state of the battery.

The function used is:


=AND(A2=”Yes”,B2=”OK”)

For the result to be true A2 must be ―Yes‖ and B2 must be ―OK‖. Any of the other three possible
combinations will give a FALSE result.

Example 2: The AND function will be used to check if the student passed both tests. The
pass mark for each test is 50.

The function used is: =AND(C4>=$B$1,D4>=$B$1)

OR Function

To perform an OR condition in an IF statement, there is a separate OR function which can


be nested within the IF Statement.

=OR(condition1,condition2,condition3,…)

OR returns TRUE if any of the conditions are true. It returns FALSE if none of the conditions
are TRUE.

Page 39 of 120
Ms Joanne Zarb

Example 1: The OR function will be used to


check whether you will buy a new car.
To keep it simple we are only considering two
factors, ―Sold Old Car‖ or ―Have a Bank Loan.‖

The function used is:


=OR(A2=”Yes”,B2=”Yes”)

Example 2: The OR function will be used to check if the student passed at least one test.
The pass mark for each test is 50.

The function used is: =OR(C4>=$B$1,D4<=$B$1)

Creating Two-Level Nested Functions

Nested functions are functions within functions. A "nested" IF statement is when an IF


statement contains another IF statement. This is done whenever there are more than two
possible outcomes. The nested IF statement can go in either the true or false section.

IF(condition1, value_if_true1, IF(condition2, value_if_true2, value_if_false )

Example 1: Consider the underlying worksheet. A grade will be entered in column E based
on the mark in column C following the table under the worksheet.

Page 40 of 120
Ms Joanne Zarb

The function entered in cell B2 is


=IF(C2<45,"F",IF(C2<61,"D",IF(C2<76,"C",IF(C2<91,"B","A"))))

Note that:
 Mark Range Grade
The nested "IF Statements" are placed in the false section
of the previous "IF Statements". The key to understanding 91-100 A
this "IF Statement" is knowing that "IF Statements" are 76-90 B
read from left to right and as soon as a conditionit true,
 MS Excel stops reading the rest of the statement. 61-75 C

 45-60 D
It is important to close all open brackets.
 You need to have as
many close brackets as open brackets. 0-44 F

Example 2: Consider this worksheet. The country of manufacture will be entered in column
B depending on the type of car in column A.

Type Manufacture
Fiat, Alfa ITALY
Opel, Volkswagen GERMANY
Ford, Jaguar BRITAIN
None of the above OTHER

The function entered in cell B2:

=IF(OR(A2="Fiat",A2="Alfa"),"ITALY",IF(OR(A2="Volkswagen",A2="Opel"),"GE
RMANY",IF(OR(A2="Ford",A2="Jaguar"),"BRITAIN","OTHER")))

Example 3: Consider this worksheet comparing three universities to see which one is ranked
the best between 1 and 10 with 1 being the best. It also employs a nested IF statement.

The function entered in cell B6:

=IF(AND(B2<B3,B2<B4),A2,IF(AND(B3<B2,B3<B4),A3,A4))

Page 41 of 120
Ms Joanne Zarb

Using a 3-D Reference within a Sum Function

Suppose you have a number of sheets (e.g. Form I, Form II & Form III) in the same
workbook containing similar data e.g. the annual exam marks of the same students. You
can create a worksheet (e.g. Consolidated) that will display the sum of different values in
adjacent sheets. This is referred to as consolidation of data. The function used to total the
different values in adjacent sheets is referred to as 3D Sum function.

The term 3D reference is used to refer to a range of cells that spans two or more
worksheets in a workbook.

To consolidate data in adjacent sheets:

1. Create a sheet that will contain the consolidated data. Typically this sheet will be
the first sheet in the workbook. You may give any name to this sheet e.g.
Consolidated.
2. Click the cell where the consolidated data will be displayed.
3. Type =sum(
4. Click the sheet (e.g. Form I) containing the cell/s to add.
5. Highlight the cell/s to be added.
6. Press and hold SHIFT key.
7. Click the next sheet (e.g. Form II) containing the cell/s to add.
8. Highlight the cell/s to be added.
9. Repeat steps 6 through 8 as often as necessary.
10. Press ENTER key. The formula in the consolidated sheet would look something
similar to this: =SUM('Form I:Form III'!B4)

Note that:

The cells are referred to using three pieces of data: the sheet 
name, the column heading and the
row heading. This explains why the term 3D reference is used.

Page 42 of 120
Ms Joanne Zarb


Activity 7
You will use Exercises.

1. Open eight.xlsx located in Exercises folder.

2. In the Results worksheet, add a function in cell D2 to return the text Pass if the
mark is greater than or equal to 45. Alternatively it should return the text Fail. Copy
the function in cell D2 to the cell range D3:D6.
3. On the Sales worksheet, add a function in cell D2 to calculate a 2% commission on
sales if the sales exceed €3,000. If the sales do not exceed €3,000 no commission
is awarded. Copy the function in cell D2 to the cell range D3:D6.
4. In the AND worksheet, add a function in cell C2 that will return the text True if A2
is Yes and B2 is OK. Copy the function in cell C2 to the cell range C3:C5.
5. Add a function in cell E10 that will return the text True if the results of both Test 1
and Test 2 are greater or equal to 50. Copy the function in cell E10 to the cell
range E11:E13.
6. In the OR worksheet, add a function in cell C2 that will return the text True if
either A2 is Yes or B2 is Yes. Copy the function in cell C2 to the cell range C3:C5.
7. Add a function in cell E10 that will return the text True if the results of either Test
1 or Test 2 are greater or equal to 50. Copy the function in cell E10 to the cell
range E11:E13.
8. In the Results worksheet, add a function in cell E2 that will award any of the
underlying grades based on the mark in cell C2. Copy the function in cell E2 to the
cell range E3:E6.

Mark Range Grade


91-100 A
76-90 B
61-75 C
45-60 D
0-44 F

9. In the Cars worksheet, add a function in cell B2 that will display any of the
underlying Manufacture based on the type in cell A2. Copy the function in cell B2
to the cell range B3:B8.
Type Manufacture
Fiat, Alfa ITALY
Opel, Volkswagen GERMANY
Ford, Jaguar BRITAIN
None of the above OTHER

10. In the University worksheet, add a function in cell B6 that will display the name
of the best university in the list A2:A4. The best university is the one with the
lowest number in the Rank column.
11. Save and close eight.xlsx.

Page 43 of 120
Ms Joanne Zarb

12. Open the file nine.xlsx.


13. In the Consolidated worksheet, enter a function in cell B4 to sum cells B4 on the
Form I, Form II and Form III worksheet.
14. Copy the 3D Sum function to cells C4 to D6.
15. Save and close nine.xlsx.

Page 44 of 120
Ms Joanne Zarb

CHARTS

Creating a Combined Column & Line Chart

You can create a combined column and line chart:

1. Click the chart.


2. Select the data series e.g. Sales 2010 to change its chart type to a line
chart.
3. Click Design tab below, Chart Tools.
4. Click Change Chart Type. The Change Chart Type dialog box is
displayed.
5. Select the appropriate line chart.
6. Click OK button.

Page 45 of 120
Ms Joanne Zarb

Adding a Secondary Axis to a Chart

When the values in a 2-D chart vary widely from data series to data series, or when you
have mixed types of data (for example, price and volume), you can plot one or more data
series on a secondary vertical (value) axis. The scale of the secondary vertical axis reflects
the values for the associated data series.

To help distinguish the data that is plotted along the secondary axis, you can change the
chart type for just one data series. For example, you could change one data series to a line
chart.

Page 46 of 120
Ms Joanne Zarb

You can plot data on a secondary vertical axis one data series at a time. To plot more than
one data series on the secondary vertical axis, repeat this procedure for each data series
that you want to display on the secondary vertical axis.

To add a secondary axis to a chart:


1. In the chart, click the data series that you want to plot on a secondary vertical axis,
or do the following to select the data series from a list of chart elements:
a. Click the chart.
b. Click the Format tab below Chart Tools.
c. In the Current Selection group, click the arrow in the
Chart Elements box.
d. Click the data series that you want to plot along a
secondary vertical axis.

2. In the Format tab, in the Current Selection group, click Format Selection. The
Format Data Series dialog box is displayed.

3. In the Series Options tab, under Plot Series On, click Secondary Axis.
4. Click Close button.

Note that:
 
Secondary axes are supported in 2-D charts only.

To change the display of the secondary vertical axis:


1. Click the Layout tab below Chart tools.
2. In the Axes group, click Axes.
3. Click Secondary Vertical Axis.
4. Click the display option that you want.

To change the axis options of the secondary vertical axis:


1. Right-click the secondary vertical axis.
2. Click Format Axis.
3. Under Axis Options, select the options that you want to use.

Page 47 of 120
Ms Joanne Zarb

To remove a secondary axis:


1. Click the chart that displays the secondary axis that you want to remove.
2. Do one of the following:

In the Layout tab, in the Axes group, click Axes.


Click Secondary Vertical Axis or Secondary Horizontal Axis.
Click None.

Click the secondary axis that you want to delete, and then press DELETE.

Right-click the secondary axis.


Click Delete.

Changing the Chart Type for a Defined Data Series

You can change the chart type for a defined data series (refer to the following illustration):

1. Click the chart.


2. Select the data series to change its chart type.
3. Click Design tab below, Chart Tools.
4. Click Change Chart Type. The Change Chart Type dialog box is
displayed.
5. Select the appropriate type of chart.
6. Click OK button.

Page 48 of 120
Ms Joanne Zarb

Page 49 of 120
Ms Joanne Zarb

Adding & Deleting a Data Series in a Chart

The data series are related data points that are plotted in a chart. Each data series in a
chart has a unique colour or pattern and is represented in the chart legend. You can plot
one or more data series in a chart. Pie charts have only one data series.

To add a data series:


1. Click the chart. This will highlight the data (in cells) used for the chart.

2. Do one of the following:

If the data series to add is adjacent to the highlighted cells (e.g. Sales 2009), drag
the corner to include the data series to be added.

If the data series to add is not adjacent to the highlighted cells (e.g. Sales 2010):
a. Click the Design tab below Chart Tools.
b. In the Data group, click Select Data. The Select Data Source dialog
box is displayed.

Page 50 of 120
Ms Joanne Zarb

c. Click Add button. The Edit Series dialog box is displayed.


d. Click the cell that contains the name of the data series e.g. Sales 2010.

e. Click the Collapse button of the Series values: field.


f. Select the cells that contain the values to be added to the chart.

g. Click the Expand button.


h. Click OK button. This displays the Select Data Source dialog box.
i. Click OK button.

To delete a data series:


1. Click the data series you want to delete.
2. Press DELETE key.

Note that:
 
Deleting the data series from a chart does not delete any data in the worksheet.

Page 51 of 120
Ms Joanne Zarb

Re-Positioning Chart Title, Legend & Data Labels

To change the position of the chart title:


1. Click the title of the chart. This will display the placeholder and sizing handles.
2. Drag the chart title to the new position.

The legend is a box that identifies the patterns or colours that are assigned to the data
series or categories in a chart.

To change the position of the legend:


1. Click the chart.
2. Click the Layout tab below Chart Tools.
3. Click Legend.
4. Click More Legend Options… The Format Legend dialog box is displayed.

5. In the Legend Options category, select the position of the legend.


6. Click Close button.

A data label is used to identify the details of a data point in a data series. To change the
position of data labels:
1. Click the chart.
2. Click the Layout tab below Chart Tools.
3. Click Data Labels. This will display a list of options where the data
labels will be displayed.
4. Click the appropriate data label position or click More Data Label Options… The
Format Data Labels dialog box is displayed.

Page 52 of 120
Ms Joanne Zarb

7. In the Label Options category, select the position of the labels.


5. Click Close button.

Changing the Scale Value Axis

By default, MS PowerPoint determines the minimum and maximum scale values of the value
(Y) axis in a chart. You can, however, customize the scale to better meet your needs.

1. Click the chart.


2. Click the Layout tab below Chart Tools.
3. In Axes group, click Axes.
4. Highlight Primary Vertical Axes.
5. Click More Primary Vertical Axes Options… The Format Axis dialog box is
displayed.
6. Set the appropriate scaling options.
a. To change the number at which the value axis starts or ends, ticked Fixed
and type a different number in the Minimum: or the Maximum: field.
b. To change the interval of tick mark and chart gridlines, tick Fixed and type a
different number in the Major unit: or Minor unit: field.
7. Click Close button.

Page 53 of 120
Ms Joanne Zarb

Changing Display Units on Value Axis

If the chart values are large numbers, you can make the axis text shorter and more
readable by changing the display unit of the axis. For example, you can display chart values
ranging from 1,000 to 50,000 as 1 to 50 on the axis and show a label that indicates that the
units are expressed in thousands.

1. Click the chart.


2. Click the Layout tab below Chart Tools.
3. In Axes group, click Axes.
4. Highlight Primary Vertical Axes.
5. Choose the appropriate option: Show Axis in Thousands, Show Axis in
Millions, Show Axis in Billions etc.

Page 54 of 120
Ms Joanne Zarb

Formatting Columns, Bars, Plot Area & Chart Area to Display an Image

To format columns, bars, plot area, or chart Area to display a picture:


1. Right-click the column/s or bar/s or plot area or chart area.
2. Click Format Data Series… The Format Data Series dialog box is displayed.
3. Click Fill option.
4. Tick Picture or texture fill.
5. Click File… button. The Insert Picture dialog box.
6. Browse to the location (drive/folder) where the picture is displayed.
7. Double-click the picture to use.
8. Tick any other appropriate options e.g. Stretch, Stack or Stack and Scale with:
9. Click Close button.

Page 55 of 120
Ms Joanne Zarb


Activity 8
You will use Exercises.

1. Open ten.xlsx located in Exercises folder.

2. In Sheet1, using the data in cell range A1:C4, create a combined column and lien
chart. The data series in cell range B1:B4 should be plotted as columns. The data
in cell data series in cell range C1:C4 should be plotted as a line.
3. In Sheet2:
a. Set the data series in cell range C1:C6 as a secondary vertical axis to the
existing chart.
b. Change the chart type of the secondary value axis only to a line chart.
4. In Sheet3:
a. Add the data series in cell range C1:C4 to the existing chart.
b. Delete the data series i.e. cell range C1:C4 added in the previous step.
c. Add the data series in cell range D1:D4 to the existing chart.

Page 56 of 120
Ms Joanne Zarb
5. In Chart1:
a. Move the chart title to the right of the chart.
b. Show the legend at the bottom of the chart.
c. Show the data labels on top of the columns.
6. In Sheet4, set the scale of the primary value axis such that the minimum unit is
set to 40 and the maximum unit set to 140. Set the major unit to 5.
7. In Sheet5, apply the appropriate setting such that the display units on the y-axis is
set to thousands.
8. In Sheet4, Apply picture fill to the Rainfall columns using the picture rain.gif (in
Exercises folder). Use the stack option.
9. Save and close ten.xlsx.

Page 57 of 120
Ms Joanne Zarb

ANALYSIS

Creating & Modifying a Pivot Table

A pivot table allows you to "interactively" aggregate your data and is a great way to
generate a dynamic summary report of your data. The term pivot refers to being able to
change the position of the fields and to being able to transpose the rows and columns of
your table. The more data you have to analyse then the more appropriate it is to use a
pivot table.

Pivot tables are always linked to the data they are derived from.

Looking at the list of data displayed above it is hard to identify the order amounts for each
country per year. The pivot table feature can be used to summarise the data as shown
below:
Page Field
Column Field

Data Field Items

Row Field

Data Area

Page 58 of 120
Ms Joanne Zarb

Pivot tables can be based on:


  A list or database table in an MS Excel worksheet.

  
An external source, database or another workbook.
  
A consolidation of multiple ranges from different worksheets.
 
Another PivotTable or PivotChart.

Pivot tables are made up of the following items:


 
Row Field - identifies the values from the source data assigned to use as the rows of the table.


Column Field - identifies the values from the source data assigned to use as the columns of the
 table.

 
Data Area - summarises the data using the assigned summarisation function or custom formula.

 
 Data Field - identifies the values from the source data that are summarised in the Data Area.


Items - 
identifies a sub category for a row or a column that identifies the corresponding data area
 values.

Page Field - can be used to filter the values on the page. Only records containing matching values
 will be displayed. This is optional

 
 Grand Totals - a row or column that provides a total for all the cells of the data area.

 
Sub Totals - a row or column that summarises cells within the corresponding detail fields.

When you create a PivotTable, you specify which fields you are interested in, how you want
the table organized, and what kinds of calculations you want the table to perform. After you
have built the table, you can rearrange it to view your data from alternative perspectives.
This ability to ―pivot‖ the dimensions of your table—for example, to transpose column headings to
row positions—gives the PivotTable its name and its unusual analytical power.

You will create a pivot table from an MS Excel worksheet showing the Country field along
columns, Order Date field along rows and the Order Amount as data to sum.

1. Select a cell in a range of cells, or put the insertion point inside


of a MS Excel table. Make sure that the range of cells has column
headings.
2. Click the Insert tab.
3. In the Tables group, click PivotTable.
4. Click PivotTable. The Create PivotTable dialog box is displayed.

MS Excel automatically selects all data. If you want to choose


some other data click the Collapse Dialog of the Table Range: and highlight the
data to be included. Click Expand Dialog.

Page 59 of 120
Ms Joanne Zarb

5. Specify a location where the Pivot Table will be placed.

To place the PivotTable report in a new worksheet starting at cell A1, click New
Worksheet.

To place the PivotTable report in an existing worksheet, select Existing


Worksheet, and then specify the first cell in the range of cells where you want to
position the PivotTable report.

Alternatively, click Collapse Dialog to temporarily hide the dialog box, select the
beginning cell on the worksheet, and then press Expand Dialog.

6. Click OK button.

MS Excel adds an empty PivotTable report to the specified location and displays the
PivotTable Field List so that you can add fields, create a layout, and customize the
PivotTable report.

Page 60 of 120
Ms Joanne Zarb

Now all that‘s left for you to do is to drag field headings from the PivotTable Field List to
the appropriate places at the bottom of the PivotTable Field List. For example:
  Drag the Order Date to the row area (Row Labels).

  
Drag the Country to the column area (Column Labels).
  
Drag the Order Amount to the data area (Values).
 
Drag the Salesperson to the page area (Report Filter).

Note that:
 
 You can put as many fields as you like in any of the areas of the layout.

The PivotTable Field List disappears when you click outside
 the pivot table. When you select the
PivotTable data, the PivotTable Field List appears again.

To modify the pivot table:


1. Click in the PivotTable data.
2. Click the arrow next to the field to modify.
3. Select the appropriate option e.g.:
Click where the field will be re-located e.g. Move to
Report Filter.
To remove a field, click Remove Field

To delete a PivotTable report:


1. Click the PivotTable report.
2. Click the Options tab.
3. In the Actions group, click Select.
4. Click Entire PivotTable.
5. Press DELETE.

Page 61 of 120
Ms Joanne Zarb

Modifying the Data Source & Refreshing Pivot Tables

Pivot tables are not updated each time a change occurs in their source data. After you
update any piece of data you need to update the pivot table:
1. Select any cell in the pivot table.
2. Click the Options tab.
3. In the Data group, click Refresh.

Note that:
 
Alternatively right-click any cell in the pivot table and click Refresh.
If you want Excel to refresh your pivot table every time you open the workbook in which it
resides:
1. Select any cell in the pivot table.
2. Click the Options tab.
3. In the PivotTable group, click Options. The PivotTable Options
dialog box is displayed.
4. Click the Data tab.

5. Tick the option Refresh data when opening file.


6. Click OK button.

Page 62 of 120
Ms Joanne Zarb

Filtering & Sorting Data in a Pivot Table

You can filter and sort the data in a pivot table to display a subset of data arranged how you
want to view it. MS Excel automatically adds drop-down filter arrows to the Report Filter
field as well as the labels for the Column and Row fields. These filter arrows enable you to
filter out all but certain entries in any of these fields, and in the case of the Column and Row
fields, to sort their entries in the table.

If you‘ve added more than one Column or Row field to your pivot table, MS Excel adds
collapse buttons (-) that you can use to temporarily hide subtotal values for a particular
secondary field. After clicking a collapse button in the table, it immediately becomes an
expand button (+) that you can click to redisplay the subtotals for that one secondary field.
Filter a pivot table report

Perhaps the most important filter buttons in a pivot table are the ones added to the Report
Filter field(s). By selecting a particular option on the drop-down lists attached to one of
these filter buttons, only the summary data for that subset you select is then displayed in
the pivot table itself.

When you filter a pivot table field, MS Excel replaces the standard drop-down button icon
with a cone-shaped filter icon, indicating that the field is currently being filtered to show
only some of the values in the data source.

To filter individual column and row fields:


1. Click the Column or Row field‘s filter button.
2. Deselect the Select All check box.
3. Click the check boxes for all the groups or individual entries whose summed values
you still want displayed in the pivot table.
4. Click OK button.

Page 63 of 120
Ms Joanne Zarb

Note that:

As with filtering a Report Filter field, Excel replaces the 
standard drop-down button
 icon for that Column or Report field with a cone-shaped
filter icon, indicating that the field is currently being 
filtered and only some of its
summary values are now displayed in the pivot table.

You can instantly reorder the summary values in a pivot table by sorting the table on one or
more of its Column or Row fields. To sort a pivot table:

1. Click the filter button for the Column or Row field you want to sort.
2. Click either the Sort A to Z option or the Sort Z to A option at the top of the field‘s
drop-down list.

Note that:

Use the Sort A to Z option when you want the table reordered by sorting the labels
in the selected field alphabetically or in the case of values from the smallest to
largest value or in the case of dates from the oldest to newest date. Use the Sort Z
to A option when you want the table reordered by sorting the labels in reverse
alphabetical order (Z to A), values from the highest to smallest, and dates from the
newest to oldest.

Grouping Data in Pivot Tables

To group date fields by year, by quarter, by month etc:


1. Click any item in the date field.
2. Click the Options tab under PivotTable Tools.
3. In the Group, click Group Selection. The Grouping dialog box is displayed.
4. Define the date from which grouping should start in the Starting at: field.
5. Define the date at which grouping should end in the Ending at: field.
6. Choose one or more options under By e.g. choose Years and Quarters.

7. Click OK button.

Page 64 of 120
Ms Joanne Zarb

To group numeric fields:


1. Click any item in the numeric field.
2. Click the Options tab under PivotTable Tools.
3. In the Group, click Group Selection. The
Grouping dialog box is displayed.
4. Set the Starting at: value e.g. 15.
5. Set the Ending at: value e.g. 55.
6. Set the grouping by value e.g. 10.
7. Click OK button.

To remove grouping:
1. Click any cell in the field to ungroup.
2. Click the Options tab under PivotTable Tools.
3. In the Group, click Ungroup.

Using One-Input & Two-Input Tables

A what-if table enables you to summarise the impact of one or two variables on a formula
that uses those variables. What-if tables are also known as data tables or sensitivity tables.

You can create two types of data tables:


  One-input (or one-variable) data table

 
Two-input data table

Page 65 of 120
Ms Joanne Zarb

One-input (or One-variable) Data Table

Let‘s start with a simple what-if problem. You want to invest €75,000 in a bank. Different
banks offer different interest rates, ranging from 5% to 7%. You want to know what money
would be earned at each interest rate in this range. You might be tempted to use a manual
approach, simply substituting each of the interest rates one at a time in the original data
and recording the amount earned. However, the one-variable data table can automate this
process.

Formula entered
in cell B5 is:
=B3*B4

Formula entered
in cell B11 is:
=B3

Formula entered
Formula entered
here references the
in cell B12 is:
input cell:
=B3*B4 or =B5
=B4

1. Enter the data as shown above.


2. In cell B5 enter =B3*B4
3. In cell B11 enter =B3
4. In cell A12 enter =B4

In a one-variable data table the input values (the variables) can be oriented either
horizontally, in a row, or vertically, in a column. In this example the interest values
are arranged vertically. A characteristic of one-variable data tables is that the
leftmost cell of the first row of the data in the table (B12 in this example) must
contain a formula referencing the input cell. Because B4 is the cell in the original
data in which MS Excel will successively substitute different interest rates, it‘s the
input cell.

5. In cell B12 the formula =B3*B4


The result cell, which will contain the results of varying interest rates, is B12.
6. Type in the rest of the interest rates as shown above.

Page 66 of 120
Ms Joanne Zarb

7. Highlight the cell range A12 to B20.


8. Click the Data tab.
9. In the Data Tools group, click What-If Analysis.
10. Click Data Table… The Table dialog box is displayed.

11. Since the interest rates are arranged vertically, in a


column, enter the reference to the input cell, $B$4, in the
Column input cell.

If the interest rates where arranged horizontally, in a row, you would have entered the
cell identification in the Row input cell and left the Column input cell blank.

12. Click OK button. The rest of the table will then be populated with a special array
formula {=TABLE(,B4)}

Note that:
  In a one variable data table you only need to enter the cell address in either the

―Column input cell‖ or the ―Row input cell‖.
 
Do not include the column or row headings when you highlight the table.

Two-input (Two-variable) Data Table

Now let‘s complicate the problem a bit by varying the amount invested as well as the interest rate.
MS Excel offers a two-variable data table to accomplish this analysis.

1. Enter the data as shown on the previous page. arious investment amounts were
placed horizontally, across the top row of the table, and listed interest rates
vertically, down the left column.
2. In cell B5 enter =B3*B4
In a two-variable input table, the result cell must be referenced in the top-left
corner of the table, at the intersection of the row and column headings.
3. In cell A11 enter =B5
4. Format cell B11 so it‘s identified as ―Interest Rate‖ while maintaining the underlying formula
=B5
a. Click cell A11.
b. Click the Home tab.
c. In the Number group, click Format Cells: Number Dialog Box Launcher. The
Format Cells dialog box is displayed.
d. In the Number tab, under Category, click Custom.
e. In the Type: field enter “Interest Rate” (including the quotation marks).
f. Click OK button.

Page 67 of 120
Ms Joanne Zarb

Formula
entered in
cell B5 is:
=B3*B4

Formula
entered
here
reference
s the
result
cell: =B5

Page 68 of 120
Ms Joanne Zarb

MS Excel doesn‘t remove the underlying formula (=B5). Instead, it hides it and labels the cell
―Interest Rate.‖ If you click on A11, you‘ll see the formula is still there

5. Highlight the table from A11 to E20. It is important that the reference to the result
cell is in the top-left cell of the highlighted area; otherwise MS Excel won‘t know what
to place in the body of the table when you execute the Table command.
6. Click the Data tab.
7. In the Data Tools group, click What-If Analysis.
8. Click Data Table… The Table dialog box is displayed.
The term of the loan is in the row across the top of the table, while the interest rate
is in a column down the left side.
9. In the Row input cell: type $B$3.
10. In the Column input cell: type $B$4.

11.Click OK button. The rest of the table will then be populated with a special array
formula {=TABLE(B3,B4)}

Note that:

In a two-variable input table, the result cell must bereferenced in the top-left corner of the table,
at the intersection of the row and column headings.

Page 69 of 120
Ms Joanne Zarb


Activity 9
You will use Exercises.

1. Open eleven.xlsx located in Exercises folder.


2. On the Practice worksheet, create a pivot table from the cell range A1:E800
showing the Country field along columns, Order Date field along rows and the Order
Amount as data to sum. Put the pivot table at cell G3 on the existing worksheet.
3. Show the Order Date in the pivot table grouped by quarters and years only.
4. Edit the amount of €441.00 in cell C2 to €1441.00.
5. Remove the grouping set in the step 3.
6. Show the Order Date in the pivot table grouped by months and years only.

7. On the Survey worksheet, create a pivot table from the cell range A1:D18
showing the Favourite Group field along columns, Age field along rows and the No.
as data to sum. Put the pivot table at cell F2 on the existing worksheet.
8. Show the Age in groups of 10 in the pivot table starting at 15 and ending at 55.
9. On the one-variable worksheet, create a data table from cell range A11:B20
that will calculate the relevant interest amounts for the different interest rates in
the column.
10. On the two-variable worksheet, create a data table from cell range B11:E20
that will calculate the relevant interest amounts for the different investments in the
row and the different interest rates in the column.
11. Save and close eleven.xlsx.

Sorting Data by Multiple Columns

You can sort the data by multiple columns, for example in the following sheet you want to
sort the data in alphabetical order by Surname, then by Name and then by ID Card.

For best results, the range you sort should have column labels.

1. Click a cell in the range you want to sort.


2. Click the Data tab.
3. In the Sort & Filter group, click Sort... The Sort dialog box is displayed.
4. In the Sort by field select the first column e.g. Surname you want to sort
by. Set the Order A to Z or Z to A.

Page 70 of 120
Ms Joanne Zarb

5. Click Add Level button.


6. In the Then by box select the second column e.g. Name you want to sort by. Set
the Order A to Z or Z to A.
7. Click Add Level button.
8. In the Then by box select the third column e.g. ID Card you want to sort by. Set
the Order A to Z or Z to A.
9. Click OK button.

Creating Customised Lists & Performing Custom Sorts

MS Excel provides the following built-in, day-of-the-week, and month-of-the year custom
lists. Built-in lists cannot be edited or deleted.

Built-in Lists
Sun, Mon, Tue, Wed, Thu, Fri, Sat
Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec
January, February, March, April, May, June, July, August, September, October, November, December

You can also create your own custom lists, and use them to sort or fill. For example, if you
want to sort or fill by the following lists, you need to create a custom list, because there is
no natural order.

Custom Lists
High, Medium, Low
Large, Medium, Small
North, South, East, West
Senior Sales Manager, Regional Sales Manager, Department Sales Manager, Sales Representative

A custom list can only contain text or text mixed with numbers. For a custom list that
contains numbers only, such as 0 through 100, you must first create a list of numbers that
is formatted as text.

Page 71 of 120
Ms Joanne Zarb

There are two ways to create a custom list. If your custom list is short, you can type the
values directly in the dialog box. If your custom list is long, you can import it from a range
of cells.

To create a custom list by typing in values:


1. Click the Microsoft Office Button.
2. Click Excel Options. The Excel Options dialog box is displayed.

3. Click the Popular category.


4. Under Top options for working with Excel, click Edit Custom Lists… The Custom
Lists dialog box is displayed.

5. Click NEW LIST.

Page 72 of 120
Ms Joanne Zarb

6. Type the entries in the List entries box, beginning with the first entry.
7. Press ENTER after each entry.
8. When the list is complete, click Add. The items in the list that you selected are
added to the Custom lists box.
9. Click OK twice.

To create a custom list from a cell range:


1. In a range of cells, enter the values that you want to sort or fill by,
in the order that you want them, from top to bottom.
2. Select the range that you just typed e.g. cell range A1:A3.
3. Click the Microsoft Office Button.
4. Click Excel Options. The Excel Options dialog box is displayed.
5. Click the Popular category.
6. Under Top options for working with Excel, click Edit Custom Lists… The Custom
Lists dialog box is displayed.
7. In the Custom Lists dialog box, verify that the cell reference of the list of items that
you selected is displayed in the Import list from cells box.
8. Click Import. The items in the list that you selected are added to the Custom lists
box.
9. Click OK twice.

Note that:


You can only create a custom list based on a value (text, number, and date or time). 
You cannot create a custom list based on a format (cell colour, font colour, and icon).

To delete a custom list:


1. Click the Microsoft Office Button.
2. Click Excel Options. The Excel Options dialog box is displayed.
3. Click the Popular category.
4. Under Top options for working with Excel, click Edit Custom Lists… The Custom
Lists dialog box is displayed.
5. In the Custom Lists box, select the list that you want to delete.
6. Click Delete button.

You may wish to sort rows by months or weekdays.

1. Click a cell in the range you want to sort.


2. Click the Data tab.
3. In the Sort & Filter group, click Sort... The Sort dialog box
is displayed.
4. In the Sort by field, choose moth or date.
5. In the Order field, choose Custom List… The Custom
Lists dialog box is displayed.
6. Select the custom list that matches the field you want to
sort.
7. Click OK twice.

Page 73 of 120
Ms Joanne Zarb

Automatic Filtering a List

MS Excel provides a very simple mechanism (AutoFilter) for selecting data subsets.
AutoFilters can be set up to choose specific values or a range of values. Several filters can
be used, each acting further on the current data subset.

To use the AutoFilter:


1. Highlight the header row of the list to be filtered.
2. Click the Data tab.
3. In the Sort & Filter group, click Filter. A drop-down arrow will appear to the
right of every header cell.

4. Do any of the following:

A. Filter for the smallest or largest number


1. Click the arrow in the column that contains the numbers.
2. Highlight Number Filters.
3. Click Top 10... The Top 10 AutoFilter dialog box is displayed.
4. In the box on the left, click Top or Bottom.
5. In the box in the middle, enter a number.
6. In the box on the right, click Items.

Page 74 of 120
Ms Joanne Zarb
7. Click OK button.

Note that:
 
The filter field will show a filter icon.

To remove the filtering from a field and display all data:


1. Click the filter icon next to the field.
2. Click (Select All).
3. Click OK button.

B. Filter a range for rows that contain specific text


1. Click the arrow in the column that contains the text or numbers to filter.
2. Highlight Number Filters.
3. Click Equals… The Custom AutoFilter dialog box is displayed.
4. In the box on the left, click equals, or does not equal, contains, or does not
contain.
5. In the box on the right, enter the text or number you want.

If you need to find text values that share some characters but not others, use a
wildcard character.

The following wildcard characters can be used as comparison criteria for filters, and
when searching and replacing content.

Page 75 of 120
Ms Joanne Zarb

Use To find
? (question mark) Any single character
For example, sm?th finds "smith" and "smyth"
* (asterisk) Any number of characters
For example, *east finds "Northeast" and "Southeast"
~ (tilde) followed by ?, *, or ~ A question mark, asterisk, or tilde
For example, fy91~?

C. Filter for blank cells


1. Click the arrow in the column that contains the numbers.
2. Highlight Number Filters.
3. Click Equals… The Custom AutoFilter dialog box is displayed.
4. In the box on the left, click equals. Leave the box on the right empty.
5. Click OK button.

D. Filter for numbers greater than or less than another number


1. Click the arrow in the column that contains the numbers.
2. Highlight Number Filters.
3. Click Greater Than… The Custom AutoFilter dialog box is displayed.
4. In the box on the left, click is greater than, is less than, is greater than or
equal to, or is less than or equal to.
5. In the box on the right, enter a number.
6. To add another criteria, click And or Or, and repeat the previous step.
7. Click OK button.

E. Filter for a number equal to or not equal to another number


1. Click the arrow in the column that contains the numbers.
2. Highlight Number Filters.
3. Click Equals… The Custom AutoFilter dialog box is displayed.
4. In the box on the left, click equals, or does not equal.
5. In the box on the right, enter a number.
6. To add another criteria, click And or Or, and repeat the previous step.
7. Click OK button.

F. Filter for the beginning or end of a text string


1. Click the arrow in the column that contains the numbers.
2. Highlight Number Filters.
3. Click Custom Filter… The Custom AutoFilter dialog box is displayed.
4. In the box on the left, click begins with, or does not begin with, or ends with,
or does not end with.
5. In the box on the right, enter the text you want.
6. If you need to find text values that share some characters but not others, use a
wildcard character.
7. To add another criteria, click And or Or, and repeat the previous step.
8. Click OK button.

Page 76 of 120
Ms Joanne Zarb

G. Filter for the top or bottom numbers by percent


1. Click the arrow in the column that contains the numbers.
2. Highlight Number Filters.
3. Click Top 10... The Top 10 AutoFilter dialog box is displayed.
4. In the box on the left, click Top or Bottom.
5. In the box in the middle, enter a number.
6. In the box on the right, click Percent.
7. Click OK button.

To switch off the AutoFilter:


1. Click the Data tab.
2. In the Sort & Filter group, click Filter.

Applying Advanced Filter Options

The Advanced Filter feature in MS Excel enables you to filter a list using more complex
criteria than those possible with AutoFilter. Your list can be filtered in place as before or you
can arrange for a copy of the filtered rows to be placed in another area of the worksheet.

The Advanced Filter command does not display drop-down lists for the columns (as for
AutoFilters). Instead, you type criteria in a criteria range on your worksheet. The criteria
range must consist of at least two rows –column headings in the first row and filtering
criteria in the second and subsequent rows.

The criteria range has to be put either above or below


your list so that it won‘t be hidden when the list is
filtered.

1. Insert at least three blank rows above the


range that can be used as a criteria range.
The criteria range must have column labels.
Make sure there is at least one blank row
between the criteria values and the range.
2. In the rows below the column labels, type the
criteria you want to match.
Refer to the criteria examples below these
steps.
3. Click a cell in the range.
4. Click the Data tab.
5. In the Sort & Filter group, click Advanced. The Advanced filter dialog
box is displayed.
6. To filter the range by hiding rows that don't match your criteria, click Filter the
list, in-place.
To filter the range by copying rows that match your criteria to another area of the
worksheet, click Copy to another location, click in the Copy to: field, and then
click the upper-left corner of the area where you want to paste the rows.

Page 77 of 120
Ms Joanne Zarb

7. In the Criteria range: field, enter the reference for the criteria range, including the
criteria labels.
8. To move the Advanced Filter dialog box out of the way temporarily while you select
the criteria range, click Collapse Dialog button.
9. To change how the data is filtered, change the values in the criteria range and filter
the data again.
10. Click OK button.

Note that:

You can name a range Criteria, and the reference for the range will appear
automatically in the Criteria range box. You can also define the name Database for
the range of data to be filtered and define the name Extract for the area where
you want to paste the rows, and these ranges
 will appear automatically in the List
range: and Copy to: fields, respectively.


When you copy filtered rows to another location, you can specify which columns to
include in the copy. Before filtering, copy the column labels for the columns you
want to the first row of the area where you plan to paste the filtered rows. When
you filter, enter a reference to the copied column labels in the Copy to box. The
copied rows will then include only the columns for which you copied the labels.

Criteria Examples

Before you create any criteria, note that:


Because the equal sign is used to indicate a formula when you type text or a value
in a cell, MS Excel evaluates what you type; however, this may cause unexpected
filter results. To indicate an equality comparison operator for either text or a value, 
 type the criteria as a string expression in the appropriate cell in the criteria range:

 =''=entry''

where entry is the text or value you want to find. For example:

What you type in the cell What Excel evaluates and displays
=‖=Borg‖ =Borg
=‖=5,122‖ =5,122

Page 78 of 120
Ms Joanne Zarb


When filtering text data, MS Excel does not distinguish between uppercase and
lowercase
 characters. However, you can use a formula to perform a case-sensitive
search.

A. Multiple criteria in one column

To list only the data showing the salespersons Borg


and Zammit, type the criteria directly below each
other in separate rows of the criteria range.

B. Multiple criteria in multiple columns where all


criteria must be true

To find rows that meet multiple criteria in multiple


columns, type all of the criteria in the same row of the
criteria range.

For example enter =”=Produce” and >6350 to list


the data rows where the type is Produce and the Sales
are less than €6,350 on the same row in the criteria
range.

Note that currency symbols should not be included in


the criteria.

C. Multiple criteria in multiple columns where any


criteria can be true

To find rows that meet multiple criteria in multiple


columns, where any criteria can be true, type the
criteria in different rows of the criteria range.

For example, to list data where the type is Produce or


the salesperson is Borg, type =”=Produce” and
=”=Borg” on separate rows in the criteria range.

Page 79 of 120
Ms Joanne Zarb

D. Multiple sets of criteria where each set


includes criteria for multiple columns

To find rows that meet multiple sets of criteria, where


each set includes criteria for multiple columns, type
each set of criteria in separate rows.

For example, to list data where the salesperson is Borg


and the sales are greater than €3,000, and also data
where the salesperson is Zammit and the sales are
greater than €1,500, type the criteria as shown on the
right.

Using Automatic Sub-Totalling Features

MS Excel can automatically calculate subtotal and grand total values in a list. When you
insert automatic subtotals, MS Excel outlines the list so that you can display and hide the
detail rows for each subtotal.

Consider the above example. The sheet shows the names of the property negotiators, the
date when the property was sold, the names of property buyers, the location of the
property, and the selling price. Using the subtotal feature, the total sales and the number of
properties sold per negotiator were calculated. A grand total and a grand count were
calculated and displayed at the bottom of the list.

Before you use the subtotal feature in MS Excel:



Each column has a label in the first row. For example, the first cell of every column in the above
sheet has heading title i.e. Negotiator, Date, Buyer etc.
 
 There are no blank columns or rows in the list.

You must sort your list by the field you want to sub-total. For example, if you want your
sub-total toappear after each change in negotiator, you must sort the data by
negotiator.

Page 80 of 120
Ms Joanne Zarb

To use the subtotal feature:


1. Click a cell in the column to subtotal. In the example above, click a cell in the
Negotiator column (column A).
2. Click the Data tab.
3. In the Sort & Filter group, click Sort Ascending. The data will be sorted in
alphabetical order by negotiator‘s name.
4. In the Outline group, click Subtotal. The Subtotal dialog box is displayed.

Page 81 of 120
Ms Joanne Zarb

5. The At each change in: box lists all the fields in the list. Click the column to subtotal
e.g. click Negotiator.
6. The Use function: box lists 11 summary functions. Click the summary function (e.g.
Sum, Count etc.) you want to use to calculate the subtotals.
7. In the Add subtotal to: box, select the check box for each column that contains
values you want to subtotal. E.g. select the Sale column.
8. If you want to remove any existing subtotals and replace these with new subtotals
click Replace current subtotals.
9. If you want to insert a manual page break after each subtotal click Page break
between groups.
10. If you want to place the subtotals below the data (the default) click Summary
below data.
11. Click OK button.

Note that:

You can use the Subtotals command again to add more subtotals with different
summary functions. To avoid overwriting the existing subtotals, clear the Replace
 current subtotals check box.

To display a summary of just the subtotals and grandtotals, click the outline symbols
next to the row numbers.  Use the and symbols to display or hide the detail
rows for individual subtotals.

To remove subtotals:
1. Click a cell in the table that contains subtotals.
2. Click the Data tab.
3. In the Outline group, click Subtotal. The Subtotal dialog box is displayed.
4. Click Remove All button.

Creating Named Scenarios

The Scenario Manager feature in MS Excel enables you to analyze your data to see how
changing one or more values in the worksheet affects the other cells in the worksheet. This
feature comes in handy for figuring out what would happen if certain factors in your
business changed.

Consider the following example.

Page 82 of 120
Ms Joanne Zarb

The scenario manager can be used to determine the amounts in the Projected Sales column
when the values in the % Increase column change.

To create a scenario:
1. Click the Data tab.
2. In the Data Tools group, click What-If Analysis.
3. Click Scenario Manager... The Scenario Manager dialog
box is displayed.

4. Click Add… The Edit Scenario dialog box is displayed.

5. In the Scenario name box, type a name for the scenario e.g. low growth.
6. In the Changing cells: field, enter the references for the cells that you want to
change. You can do this by highlighting the range of cells that will change e.g.
$c$4:$c$7

Page 83 of 120
Ms Joanne Zarb

7. Under Protection, select the options you want.


8. Click OK button. The Scenario Values dialog box is displayed. The values in each
field display the current values in the cell.

It is suggested that you do not change these values for the first scenario. That way
you will preserve the original values for the changing cells.

9. Click Add button to create another scenario.


10. Repeat step 5.
11. Enter the new values in the Scenario Values dialog box.
12. Click OK button when you finish creating scenarios. 13.
Click Close button in the Scenario Manager dialog box.

Showing, Editing & Deleting Scenarios

When you display a scenario, you change the values of the cells saved as part of that
scenario. To view a scenario:

1. Click the Data tab.


2. In the Data Tools group, click What-If Analysis.
3. Click Scenario Manager... The Scenario Manager dialog box is displayed.

Page 84 of 120
Ms Joanne Zarb

4. Click the name of the scenario you want to display e.g. medium growth.
5. Click Show button.

To edit a scenario:
1. Repeat steps 1-3 as above.
2. Click the name of the scenario you want to edit e.g. medium growth.
3. Click Edit… button. The Edit Scenario dialog box is displayed.

4. In the Scenario name: field you can edit the name of the scenario.
5. Highlight another range of changing cells.
6. Click OK button. The Scenario Values dialog box is displayed.
7. Edit the values.
8. Click OK button.
9. Click Close button.

To delete a scenario:
1. Click the Data tab.
2. In the Data Tools group, click What-If Analysis.
3. Click Scenario Manager... The Scenario Manager dialog box is displayed.
4. Click Delete button for each scenario.
5. Click Close button.

Creating a Scenario Summary Report

If you need to view all results of the different scenarios on one sheet you will create a
scenario summary report.

1. Click the Data tab.


2. In the Data Tools group, click What-If Analysis.
3. Click Scenario Manager... The Scenario Manager dialog box is displayed.
4. Click Summary… button.

Page 85 of 120
Ms Joanne Zarb

5. Click Scenario summary or Scenario PivotTable report.


6. In the Result cells box, enter the references for the cells that refer to cells whose
values are changed by the scenarios. Separate multiple references with commas.
7. Click OK button. The scenario summary is displayed on a new sheet called Scenario
Summary


Activity 10
You will use Exercises.

1. Open eleven.xlsx located in Exercises folder.

2. In the marks worksheet, simultaneously sort the cell range A2:E6 firstly by
Surname (in ascending order), then by Name (in ascending order) and then by
ID Card (in ascending order).
3. Create a custom list Low, Medium, High.
4. Edit the custom list Low, Medium, High to include Higher.
5. Delete the custom list created in steps 3 and 4.
6. In the sales worksheet, perform a custom sort on the cell range A1:B5 by Month
in calendar order (January, February, March etc.).
7. In the sales worksheet, perform a custom sort on the cell range A7:B11 by Day
in week order (Monday, Tuesday, Wednesday etc.)

Page 86 of 120
Ms Joanne Zarb

8. In the birds-A worksheet:


a. Apply an AutoFilter. Apply a filter such that you find the lowest Nest Altitude.
Remove this filter.
b. Apply a filter to list all rows where the Collector is BRV. Remove this filter.
c. Apply a filter to list all rows where the Diameter is less than 7. Remove this
filter.
d. Apply a filter to list all rows where the Collector is BRV and the Diameter is
less than 7. Remove this filter.
9. In the birds-B worksheet, create an advanced filter in-place on the cell range
A5:G55 so that only the data where the Nest Altitude is greater or equal to 1000, the
Length is less than 10 and the Collector is CDS is visible. Remove the advanced filter.
10. In the birds-B worksheet, create an advanced filter on the cell range A5:G55 so that
only the data where the Nest Altitude is greater or equal to 1000, the Length is less
than 10 and the Collector is CDS is visible. Display the records that meet these criteria,
beginning at cell A57.
11. In the sales 2001 worksheet:

a. Use a feature to sub-total (by sum) the Amount column for each employee in the
cell range A2:D56. The sub-total result should be displayed in the Amount
column. Remove the sub-totals.
b. Use a feature to sub-total (by sum) the Amount column for each category in the
cell range A2:D56. The sub-total result should be displayed in the Amount
column.
12. In the property worksheet:

a. Use a feature to sub-total (by sum) the Sale column for each property Negotiator
in the cell range A2:E12. The sub-total result should be displayed in the Sale
column.
b. Without losing the Sale sub-totals also show a Count of the number of sales made
by each property Negotiator. The sub-total result should be displayed in the Sale
column.
13. In the projections worksheet, create three named scenarios as follows:
Scenario Name Changing Cells Cells Cell Values
Low growth C4:C7 C4 0.05
C5 0.25
C6 0.1
C7 0.05
Medium growth C4:C7 C4 0.1
C5 0.5
C6 0.15
C7 0.5
High growth C4:C7 C4 0.15
C5 0.35
C6 0.2
C7 0.1

14. Edit cell c7 in the Medium growth scenario to read 0.55.


15. Using the scenarios created in step 13, create a scenario summary report.
16. Save and close twelve.xlsx.
Page 87 of 120
Ms Joanne Zarb
VALIDATING & AUDITING

Setting & Editing Validation Criteria for Data Entry

Data validation is an MS Excel feature that you can use to define restrictions on what data
can or should be entered in a cell. You can configure data validation to prevent users from
entering data that is not valid. If you prefer, you can allow users to enter invalid data but
warn them when they try to type it in the cell. You can also provide messages to define
what input you expect for the cell, and instructions to help users correct any errors.

For example, in a marketing workbook, you can set up a cell to allow only account numbers
that are exactly three characters long. When users select the cell, you can show them a
message such as this one:

If users ignore this message and type invalid data in the cell, such as a two-digit or five-
digit number, you can show them an actual error message.

To restrict data entry to a whole number or decimal within limits:


1. Select one or more cells to validate.
2. Click the Data tab.
3. In the Data Tools group, click Data Validation. The
Data Validation dialog box is displayed.
4. In the Data Validation dialog box, click the Settings
tab.
5. In the Allow: box, select Whole number or Decimal
Number.
6. In the Data: box, select the type of restriction that you
want. For example, to set upper and lower limits, select between.
7. Enter the minimum, maximum, or specific value to allow. You can also enter a
formula that returns a number value.
8. To specify how you want to handle blank (null) values, select or clear the Ignore
blank check box.

If your allowed values are based on a cell range with a defined name, and there is a
blank cell anywhere in the range, setting the Ignore blank check box allows any
values to be entered in the validated cell. This is also true for any cells that are
referenced by validation formulas: if any referenced cell is blank, setting the Ignore
blank check box allows any values to be entered in the validated cell.

Page 88 of 120
Ms Joanne Zarb

9. Click OK button.

To restrict data entry to values in a drop-down list:


1. Repeat steps 1-4 as above.
2. In the Allow: box, select List.
3. Click the Source box and then type the list values separated by commas. For
example:
To limit entry to a question, such as "Do you have children?", to two choices, type
Yes, No.
To limit a vendor's quality reputation to three ratings, type Low, Average, High.
You can also create the list entries by referring to a range of cells elsewhere in the
workbook.

4. Make sure that the In-cell dropdown check box is selected. Otherwise, you won't

Page 89 of 120
Ms Joanne Zarb
be able to see the drop-down arrow next to the cell.
5. To specify how you want to handle blank (null) values, select or clear the Ignore
blank check box.
6. Click OK button.

Note that:

The width of the drop-down list is determined by the width of the cell that has the
data validation. You might need to adjust the width of that cell to prevent
truncating
 the width of valid entries that are wider than the width of the drop-down
list.

To restrict data entry to a date within a time frame or to a time within a time frame:
1. Select one or more cells to validate.
2. Click the Data tab.
3. In the Data Tools group, click Data Validation. The Data Validation dialog box is
displayed.
4. In the Data Validation dialog box, click the Settings tab.
5. In the Allow: box, select Date or Time.
6. In the Data: box, select the type of restriction that you want. For example, to allow
dates after a certain day, select greater than.
7. Enter the start, end, or specific date/time to allow.
8. To specify how you want to handle blank (null) values, select or clear the Ignore
blank check box.
9. Click OK button.

Entering an Input Message & Error Alerts

After setting validation criteria on a cell, you can set an input message that will be displayed
when the cell is clicked:
1. In the Data Validation dialog box, click the Input Message tab.
2. Make sure the Show input message when cell is selected check box is selected.

Page 90 of 120
Ms Joanne Zarb

3. Fill in the title and text for the message.


4. Click OK button.

You can specify how you want MS Excel to respond when invalid data is entered:
1. In the Data Validation dialog box, click the Error Alert tab.
2. Make sure that the Show error alert after invalid data is entered check box is
selected.
3. Select one of the following options for the Style box:
4. To display an information message that does not prevent entry of invalid
data, select Information.
5. To display a warning message that does not prevent entry of invalid data, select
Warning.
6. To prevent entry of invalid data, select Stop.
7. Fill in the title and text for the message (up to 225 characters).
8. Click OK button.

Page 91 of 120
Ms Joanne Zarb

Tracing Precedent or Dependent Cells

Sometimes, checking formulas for accuracy or finding the source of an error can be
difficult when the formula uses precedent or dependent cells:


Precedent cells are cells that are referred to by a formula in another
 cell. For example, if cell
 D10 contains the formula =B5, cell B5 is a precedent to cell D10.

Dependent cells contain formulas that refer to other
 cells. For example, if cell D10 contains the
formula =B5, cell D10 is a dependent of cell B5.

To assist you in checking your formulas, you can use the Trace Precedents and Trace
Dependents commands to graphically display, or trace the relationships between these cells
and formulas with tracer arrows.

1. Click the Microsoft Office Button.


2. Click Excel Options. The Excel Options dialog box is displayed.
3. Click the Advanced category.
4. In the Display options for this workbook section, select the workbook you want,
and then check that All is selected under For objects, show.
5. If formulas reference cells in another workbook, open that workbook. MS Excel
cannot go to a cell in a workbook that is not open.
6. Do one of the following.

Trace cells that provide data to a formula (precedents):


a. Select the cell that contains the formula for which you want to find precedent
cells.
b. To display a tracer arrow to each cell that directly provides data to the active
cell, on the Formulas tab, in the Formula Auditing group, click Trace
Precedents.

Blue arrows show cells with no errors. Red arrows show cells that cause
errors. If the selected cell is referenced by a cell on another worksheet or
workbook, a black arrow points from the selected cell to a worksheet icon.
The other workbook must be open before MS Excel can trace these
dependencies.

c. To identify the next level of cells that provide data to the active cell, click
Trace Precedents again.
d. To remove tracer arrows one level at a time, starting with the precedent cell
farthest away from the active cell, on the Formulas tab, in the Formula
Auditing group, click the arrow next to Remove Arrows, and then click
Remove Precedent Arrows. To remove another level of tracer arrows, click
the button again.

Trace formulas that reference a particular cell (dependents)

a. Select the cell for which you want to identify the dependent cells.
b. To display a tracer arrow to each cell that is dependent on the active cell,
on the Formulas tab, in the Formula Auditing group, click Trace
Dependents.

Page 92 of 120
Ms Joanne Zarb

c. To identify the next level of cells that depend on the active cell, click
Trace Dependents again.
d. To remove tracer arrows one level at a time, starting with the dependent cell
farthest away from the active cell, on the Formulas tab, in the Formula
Auditing group, click the arrow next to Remove Arrows, and then click
Remove Dependent Arrows. To remove another level of tracer arrows, click
the button again.

7. To remove all tracer arrows on the worksheet, on the Formulas tab, in the
Formula Auditing group, click Remove Arrows.

Showing Formulas in Cells

You may be auditing formulas and you need to see all the formulas on the worksheet.
To switch between displaying formulas and their values on a worksheet:

1. Click the Formulas tab.


2. In the Formula Auditing group, click Show Formulas.

Inserting, Editing, Deleting, Showing & Hiding Comments

To insert a comment to a cell:


1. Click the cell you want to comment on.
2. Click the Review tab.
3. In the Comments group, click New Comment.
4. In the comment box, type the comment text.
5. If you don't want your name in the comment, select and delete the name.
6. When you finish typing the text, click outside the comment box.

Note that:
 
Cells having a comment will display a red indicator at the top right edge of the cell.

To edit a comment:

Page 93 of 120
Ms Joanne Zarb
1. Click the cell containing the comment.
2. Click the Review tab.
3. In the Comments group, click Edit Comment.
4. In the comment box, edit the comment text as necessary.
5. When you finish editing the text, click outside the comment box.

Note that:
 
Alternatively right-click the cell containing the comment and click Edit Comment.

To delete a comment:
1. Repeat steps 1-2 as above.
2. In the Comments group, click Delete Comment.

Note that:
 
Alternatively right-click the cell containing the comment and click Delete Comment.

To show or hide comment:


1. Click the cell containing the comment.
2. Click the Review tab.
3. In the Comments group, click Show/Hide Comment.


Activity 11
You will use Exercises.

1. Open thirteen.xlsx located in Exercises folder.


2. In the Data Validation worksheet:
a. Set criteria such that only dates between 01/01/10 and 30/06/10 are entered
in the cell range B2:B5.
b. Set the following message when any cell in cell range B2:B5 is clicked:
‗Enter a date between 01/01/10 and 30/06/10.‘
c. Set the following alert message when any cell in cell range B2:B5 is clicked:
‗Incorrect entry. Please enter a date between 01/01/10 and 30/06/10.‘
d. Set criteria such that only numbers between €1 and €2,000 are entered in
the cell range C2:C5.
e. Set the following message when any cell in cell range B2:B5 is clicked:
‗Enter a number between €1 and €2,000.‘
f. Set the following alert message when any cell in cell range B2:B5 is clicked:
‗Incorrect entry. Please enter a number between €1 and €2,000.‘
g. Set criteria such that either Yes or No is selected in the cell range D2:D5.
h. Set the following message when any cell in cell range B2:B5 is clicked:
‗Select Yes or No.‘

Page 94 of 120
Ms Joanne Zarb

3. In the Auditing worksheet:


a. Highlight the precedent cells for the formula in cell D2.
b. Highlight the dependent cells for the formula in cell E2.
c. Use a feature to show formulas instead of values in cells.
d. Switch off the display of formulas in cells.
e. Trace the error in cell E3. Attach a comment to cell E3 and write how
you can correct the error in the formula.
f. Show the comment in cell B4.
g. Edit the comment attached to cell B4 to read ‗Remove bold style‘.
h. Delete the comment attached to cell B1.
4. Save and close thirteen.xlsx.

Page 95 of 120
Ms Joanne Zarb
ENHANCING PRODUCTIVITY

Naming & Deleting Cell Ranges

A range is any rectangular area of cells in a worksheet. The range


is defined by the top-left and bottom-right corner cell addresses
separated by a colon (:).

For example, the range of cells B12:B7 has been selected in the
diagram shown here.

To name a cell range:


1. Highlight the cells to name.
2. Click the Formulas tab.
3. In the Defined Names group, click Define Name. The New Name
dialog box is displayed.
4. In the Name: field type a name e.g. Sales for the range of cells selected in step 1.

5. To specify the scope of the name, in the Scope: drop-down list box, select
Workbook or the name of a worksheet in the workbook.
6. Optionally, in the Comment: box, enter a descriptive comment up to 255 characters.

7. Click OK button.

Note that:
Name Box

The Name box will display the name sales.

To delete a range name:


1. Click the Formulas tab.
2. In the Defined Names group, click Name
Manager. The Name Manager Dialog box is
displayed.
3. Click the range name to delete.
4. Click Delete button.
5. Click OK button to confirm that you want to delete the range name.
6. Click Close button to close the Name Manager Dialog box.

Page 96 of 120
Ms Joanne Zarb

Note that:
 
Deleting a range name does not delete any cell data.

Using Named Cell Ranges in a Function

You can use range names in functions for example:


1. Click the cell where the function will be
typed e.g. B8.
2. Type the function e.g. =sum(Sales)
3. Press ENTER key.

Using Paste Special Options

The Paste Special feature has several options that can help you whilst editing your
worksheet. For example you can copy the value in a cell without copying the underlying
formatting or its underlying formula.

1. Click the Home tab.


2. Select the cell/s to copy.
3. In the Clipboard group, click Copy.
4. Click Paste arrow.
5. Click Paste Special… The Paste Special dialog box is displayed.
6. Tick the appropriate option.
7. Click OK button.
Page 97 of 120
Ms Joanne Zarb

Option To do
Paste
All Pastes all cell contents and formatting of the copied data.
Formulas Pastes only the formulas of the copied data as entered in the
formula bar.
Values Pastes only the values of the copied data as displayed in the
cells.
Formats Pastes only cell formatting of the copied data.
Comments Pastes only comments attached to the copied cell.
Validation Pastes data validation rules for the copied cells to the paste
area.
All using Source theme Pastes all cell contents in the document theme formatting
that is applied to the copied data.
All except cell borders Pastes all cell contents and formatting applied to the copied
cell except borders.
Column widths Pastes the width of one column or range of columns to
another column or range of columns.
Formulas & number formats Pastes only formulas and all number formatting options from
the selected cells.
Values & number formats Pastes only values and all number formatting options from
the selected cells.
Operation Specifies which mathematical operation, if any, you want to
apply to the copied data.
None Specifies that no mathematical operation will be applied to
the copied data.
Add Specifies that the copied data will be added to the data in the
destination cell or range of cells.
Subtract Specifies that the copied data will be subtracted from the
data in the destination cell or range of cells.
Multiply Specifies that the copied data will be multiplied with the data
in the destination cell or range of cells.
Divide Specifies that the copied data will be divided by the data in
the destination cell or range of cells.

Page 98 of 120
Ms Joanne Zarb

Option To do
Skip Blanks Avoids replacing values in your paste area when blank cells
occur in the copy area.
Transpose Changes columns of copied data to rows, and vice versa.
Paste Link Links the pasted data to the active worksheet.

Creating a Spreadsheet based on an Existing Template

A template is a workbook that you create and use as the basis for other similar workbooks.
You can also create templates for worksheets.

MS Excel has several pre-defined templates that you can use. You can also download
templates from the Microsoft Office website. To use the pre-defined templates available in
MS Excel:

1. Click the Microsoft Office Button.


2. Click New. The New Workbook dialog box is displayed.
3. Under Templates, do one of the following:
To base the workbook on a recently used template, click
Blank and recent, and then under Recently Used
Templates, double-click the template that you want to use.
To base the workbook on an installed template, click
Installed Templates, and then under Installed Templates,
double-click the template that you want to use.
To base the workbook on a template that you created, click
My templates…, and then on the My Templates tab,
double-click the template that you want to use.
To base the workbook on another workbook, click New
from existing…, and then double-click the workbook that
you want to use.

Modifying a Template

To edit a template:
1. Open the template and apply the necessary edits.
2. Click Save button. The Save As dialog box is displayed.
3. Browse to the location (drive/folder) where the template will be saved.
4. In the File name: field type a name for the template.
5. In the Save as type: drop down field, click Excel Template.
6. Click Save button.

Note that:

Any changes that you make to the template file will only affect new workbooks that

Page 99 of 120
Ms Joanne Zarb
are created using the template.Any workbooks that were previously based on the
template will remain unaffected.

Inserting, Editing & Removing a Hyperlink

MS Excel creates a hyperlink for you when you press ENTER or the SPACEBAR after you
type the address of an existing Web page, such as www.um.edu.mt.

To create a hyperlink:
1. Select the text or picture that you want to display as the hyperlink.
2. Click the Insert tab.
3. In the Links group, click Hyperlink button. You can also right-click the
text or picture and then click Hyperlink on the shortcut menu.
4. Do one of the following:

To link to an existing file or Web page, click Existing File or Web Page under Link
to:, and then type the address that you want to link to in the Address: field. If you
do not know the address for a file, click the arrow in the Look in: list, and then
navigate to the file that you want.

To link to a file that you haven't created yet, click Create New Document under
Link to:, type the name of the new file in the Name of new document box, and
then, under When to edit, click Edit the new document later or Edit the new
document now.

5. Click OK button.

Note that:

To customize the ScreenTip that appears when you rest the pointer over the hyperlink,
click ScreenTip… button and then type the text that you want.  If you do not specify a
tip, MS Excel uses the path or address of the file as the tip.

Page 100 of 120


Ms Joanne Zarb

To edit a hyperlink:
1. Right-click the text or picture that has the hyperlink to edit.
2. Click Edit Hyperlink on the shortcut menu. The Insert Hyperlink dialog box is
displayed.
3. Edit the hyperlink in the Address: field.
4. Click OK button.

To remove a hyperlink:
1. Right-click the text or picture that has the hyperlink to edit.
2. Click Remove Hyperlink on the shortcut menu. The Insert Hyperlink dialog box is
displayed.
3. Click Remove Link button.

Linking Data

You can link data within a spreadsheet, between spreadsheets and between applications.

You can link data within and between worksheets:


1. Click the Home tab.
2. Click the cell/s that contains the data you want to link to.
3. In the Clipboard group, click Copy.
4. Click the cell you want to link from (in the same worksheet
or different worksheet).
5. In the Clipboard group, click Paste.
6. Click Paste Link.

You can link data between workbooks:

1. Open both the workbook that will contain the link (called
the destination workbook), and the workbook that contains
the data you want to link to (called the source workbook).

2. Click the Home tab.


3. Click the cell/s in the source workbook that contains the
data you want to link to.
4. In the Clipboard group, click Copy.
5. Switch to the destination workbook.
6. Click the cell you want to link from
7. In the Clipboard group, click Paste.
8. Click Paste Link.

You can link data into word processing documents or presentations. A linked object is an
object created in a source file and inserted into a destination file, while maintaining a
connection between the two files. The linked object in the destination file can be updated
when the source file is updated. For example, you can link a range of cells in MS Excel file
(the source file) and insert this in a MS Word file (the destination file). When you update
data in MS Excel file, the updates are reflected in the MS Word file.

Page 101 of 120


Ms Joanne Zarb

When an object is linked, information is updated only if you modify the source file. Linked
data is stored in the source file. The destination file stores only the location of the source
file and displays a representation of the linked data. Use linked objects if file size is a
consideration.

1. Click the Home tab.


2. Highlight the cell/s to be linked.
3. In the Clipboard group, click Copy.
4. Open the MS Word document to link the cell/s to.
5. Position the cursor at the location where the cell/s will be copied.
6. In the Clipboard group, click the arrow under Paste button.
7. Click Paste Special… The Paste Special dialog box is displayed.

8. Click Microsoft Office Excel Worksheet Object.


9. Tick Paste link: to insert a link to the object. Tick the option Display as icon if
you want to insert an icon instead of the text.
10. Click OK button.

To modify the linked data:


1. Double-click anywhere in the pasted text or the icon. This will open the linked
object in the source file (MS Excel).
2. Edit the data as necessary.
3. Save the edited text, data or chart. Changes to the source file will be reflected in
your document.
4. Close the file to update the document.

Updating & Breaking a Link

To update the linked data:


1. Right-click the linked data in MS Word.
2. Click Update Link.

Page 102 of 120


Ms Joanne Zarb

Note that:
 
The document will display the data as last updated in the source file.

To break a link:
1. Right-click the linked data in MS Word to break its link.
2. Highlight Linked Worksheet Object.
3. Click Links… The Links dialog box is displayed.

4. Click Break Link button.


5. Click Yes button to confirm that you wish to break the link.

Importing Delimited Data from a Text File

Typically a delimited text file contains fields of text separated by TAB characters or commas.
You can import data from a text file into an existing worksheet as an external data range.

1. Click the cell where you want to put the data from the text file.
2. Click the Data tab.
3. In the Get External Data group, click From Text. The Import Text
File dialog box is displayed.
4. In the Address bar, locate and double-click the text file that you
want to import. This will start the Text Import Wizard.

Page 103 of 120


Ms Joanne Zarb

5. In the Text Import Wizard – Step 1 of 3 dialog box, tick Delimited. Click Next
button.

6. In the Text Import Wizard – Step 2 of 3 dialog box, tick the appropriate
delimiter e.g. Tab check box. Click Next button.

Page 104 of 120


Ms Joanne Zarb

7. In the Text Import Wizard – Step 3 of 3 dialog box, select each column and set the
appropriate data format. Click Finish button.

8. In the Import Data dialog box, click Properties to set formatting and layout
options for the imported data.

Page 105 of 120


Ms Joanne Zarb

9. In the Import Data dialog box, do one of the following:


a. To return the data to the location you selected, click Existing worksheet,
and then click OK.
b. To return the data to a new worksheet, click New worksheet, and then click
OK. MS Excel adds a new worksheet to your workbook and automatically puts
the external data range in the upper-left corner of the new worksheet.

Recording a Simple Macro

If you perform a task repeatedly in MS Excel, you can automate the task using a macro. A
macro is a series of MS Excel commands and instructions that you group together as a
single command to accomplish a task automatically. Instead of manually performing a
series of time-consuming, repetitive actions in MS Excel, you can create and run a single
macro – a custom command – that accomplishes the task for you. You usually use macros:
  To speed up routine editing and formatting.

  
To combine multiple commands.
  
To make an option in a dialog box more accessible.
 
To automate a complex series of tasks.

There are many tasks that can be automated using a macro. For example, you can change
page setup, apply a custom number format, apply autoformats to a cell range, insert fields
in a worksheet header and/or footer.

When you are recording a macro, you can use the mouse to click commands and options.
Any mouse movements in a document window are not recorded. For example, you cannot
use the mouse to move the insertion point or to select, copy, or move items by clicking or
dragging. You must use the keyboard to record these actions.

To work with macros in MS Excel 2007, you need to show the Developer tab which is not
displayed by default.

To show the Developer tab:


1. Click the Microsoft Office Button.
2. Click Excel Options button.
3. Click Popular.
4. Under Top options for working with Word, select the Show Developer tab in the
Ribbon check box.
5. Click OK button.

Page 106 of 120


Ms Joanne Zarb

To record a macro:
1. Click the Developer tab.
2. In the Code group, click Record Macro button. The Record
Macro dialog box is displayed.

3. In the Macro name: field, type a name for the macro.


4. In the Store macro in: field, click This Workbook, New Workbook or Personal
Macro Workbook.
5. In the Description: field, type a description of the macro.
6. To begin recording the macro without assigning it to a button on the Quick Access
Toolbar (refer to next section), click OK button.
7. Perform the actions that you want to include in the macro.
8. To stop recording your actions, click the Developer tab.
9. Click Stop Recording button.

Page 107 of 120


Ms Joanne Zarb

Running a Macro

To run a macro:
1. Click the Developer tab.
2. In the Code group, click Macros button. The Macros dialog box is
displayed.
3. In the list under Macro name:, click the macro that you want to run.
4. Click Run button.

To delete a macro:
1. Repeat steps 1-2 as above.
2. In the list under Macro name:, click the macro that you want to delete.
3. Click Delete button.

4. Click Yes button.


5. Click Close button.

Assigning a Macro to a Toolbar

You can assign a recorded macro to a custom button on a toolbar:


1. Click Microsoft Office Button.
2. Click Excel Options. The Excel Options dialog box is displayed.

Page 108 of 120


Ms Joanne Zarb

3. Click Customize category.


4. In the Choose commands from: field, select Macros.
5. Click the recorded macro.
6. Click Add button. The Macro will be added to the Quick Access Toolbar.
7. To customize the button, click Modify.
8. Under Symbol, click the symbol that you want to use for your button.
9. In the Display name: field, type the macro name that you want to display.
10. Click OK twice.


Activity 12
You will use Exercises.

1. Open thirteen.xlsx located in Exercises folder.


2. In the range worksheet:
a. Name the cell range A2:A7 as Months.
b. Delete the range name for cell range A2:A7.
c. Name the cell range B2:B7 as Sales_AreaA.
d. Rename the range name for cell range B2:B7 to AreaA.
e. Name the cell range C2:C7 as AreaB.
f. Name the cell range D2:D7 as AreaC.
g. In cell B8 use a sum function that includes the range name to add the
values in cell range B2:B7.
h. In cell C8 use a sum function that includes the range name to add the values
in cell range C2:C7.

Page 109 of 120


Ms Joanne Zarb

i. In cell D8 use a sum function that includes the range name to add the values in
cell range D2:D7.
j. Use the paste special option to replace the answers in cell range B8 D8 with
values i.e. when you click on any cell in the cell range B8:D8 no formulas are
displayed in the formula bar.
k. Copy the cell range B1:D1. Use the Transpose option to copy these cells to
cell range A12:A14.
3. Open a new workbook based on the template Sales Invoice located in
Exercises folder:
a. Delete the content of cells A1 and A2.
b. Type your name and address in cell range A4:A6.
c. Format the cell range C18:C35 such that numbers are displayed with the €
currency style.
d. Save the template using the same name Sales Invoice in Exercises folder.
e. Open a new workbook based on the modified Sales Invoice template.
f. Type the following:

g. Save the workbook as Invoice01 in Exercises folder. Close the


workbook.
4. In thirteen.xlsx, in the Hyperlinks worksheet, set a hyperlink on the text IT
Services in cell A1 to the website http://www.um.edu.mt/itservices.
5. Open twelve.xlsx in Exercises folder. In the marks worksheet, copy the cell
range A1:E6 and link this to cell A1 in in the links worksheet in thirteen.xlsx.
6. In the marks worksheet, copy and link the cell range A1:E6 in a new MS Word
document. Save the document as link.docx in Exercises folder. Close link.docx.
7. In the marks worksheet, update cell A2 from Peter to Simon and save. Open
link.docx. Update the linked data as necessary. Break the link between link.docx
and thirteen.xlsx. Close link.docx.
8. In the Import worksheet, in cell A1 import the file results.txt located in
Exercises folder.
9. Record a macro (accepting default settings) called settings that changes the top and
bottom margins to 3.5, the orientation to landscape, centre on page vertically and
horizontally, and prints row and column headings for printing purposes. Do not print
the sheet. Run the macro.
10. Assign the macro created in step 9 as a button in the Quick Access toolbar.

11. Delete the macro created in step 9.


12. Save and close thirteen.xlsx.

Page 110 of 120


Ms Joanne Zarb

COLLABORATIVE EDITING

Turning On & Off Track Changes

You can use change tracking to log details about workbook changes every time that you
save a workbook. This change history can help you identify any changes that were made to
the data in the workbook, and you can then accept or reject those changes. Change
tracking is especially useful when several users edit a workbook. It is also useful when you
submit a workbook to reviewers for comments, and then want to merge the input that you
receive into one copy of that workbook, incorporating the changes and comments that you
want to keep.

Change tracking is available only in shared workbooks. In fact, when you turn on change
tracking, the workbook automatically becomes a shared workbook. Although a shared
workbook is typically stored in a location where other users can access it, you can also track
changes in a local copy of a shared workbook.

When changes are made in the shared workbook, you can view the change history directly
on the worksheet or on a separate history worksheet. Either way, you can instantly review
the details of each change. For example, you can see who made the change, what type of
change was made, when it was made, what cells were affected, and what data was added or
deleted.

When you highlight changes as you work, MS Excel marks any revisions (such as changes,
insertions, and deletions) with a highlighting colour.

1. Click the Review tab.


2. In the Changes group, click Track Changes.
3. Click Highlight Changes… The Highlight
Changes dialog box is displayed.
4. Select the Track changes while editing check box.

5. Under Highlight which changes, select the When: check box and then, in the When
list, click the option that you want.
6. To specify for which users you want to highlight changes, select the Who: check
box and then, in the Who list, click the option that you want.

Page 111 of 120


Ms Joanne Zarb

7. To specify the worksheet area where you want changes to be highlighted, select the
Where: check box and then, in the Where box, type the cell reference of the
worksheet range.
You can also click the Collapse Dialog button at the right end of the Where
box, and then select the range that you want to use on the worksheet. When you
finish, click the Collapse Dialog button again to display the entire dialog box.
8. Make sure that the Highlight changes on screen check box is selected.
9. Click OK button. If prompted, save the workbook.
10. On the worksheet, make the changes that you want.

Note that:

Some changes, such  as formatting, are not tracked and therefore are not marked with a
highlighting colour.

When you no longer want to highlight changes, you can turn change highlighting off:
1. Click the Review tab.
2. In the Changes group, click Track Changes.
3. Click Highlight Changes. The Highlight Changes dialog box is displayed.
4. Clear the Track changes while editing check box.
5. Click OK button.

Accepting & Rejecting Changes in a Worksheet

To accept and reject changes in a worksheet:


1. Click the Review tab.
2. In the Changes group, click Track Changes.
3. Click Accept or Reject Changes. If prompted to save
the workbook, click OK.

4. In the Select Changes to Accept or Reject dialog box, do the following:

To accept or reject changes that are made after a particular date, select the When
check box, click Since date in the When list, and then type the earliest date for
which you want to review the changes.

To accept or reject changes that are made by another user, select the Who check
box and then, in the Who list, click the user whose changes you want to review.

Page 112 of 120


Ms Joanne Zarb
To accept or reject changes that are made by all users, clear the Who check box.

To accept or reject changes that are made to a specific area, select the Where
check box, and then type the cell reference of the worksheet range.

To accept or reject changes to the entire workbook, clear the Where check box.

5. Click OK button. The Accept or Reject Changes dialog box is displayed.

6. To accept or reject each change, click Accept button or Reject button.


7. If prompted to select a value for a cell, click the value that you want, and then click
Accept.

Note that:
 
You must accept or reject a change before you can advance to the next change.

Comparing & Merging Worksheets

When a shared workbook is updated by other users, and you want to compare the changes
that they have made before you update the workbook with those changes, you can use the
Compare and Merge Workbooks command. This command is not available with other shared
workbook commands on the Review tab in the Changes group, but you can add it to the
Quick Access Toolbar.

To use the Compare and Merge Workbooks command, all shared workbook users must save
a copy of the shared workbook that contains their changes and use a unique file name that
differs from the original workbook. All copies of a shared workbook should be located in the
same folder as the shared workbook.

If needed, do the following to add the Compare and Merge Workbooks command to the
Quick Access Toolbar:
1. Click the Microsoft Office Button.
2. Click Excel Options.
3. In the Customize category, in the Choose commands from list, click All
Commands.
4. In the list, click Compare and Merge Workbooks.
5. Click Add button.
6. Click OK button.

Page 113 of 120


Ms Joanne Zarb

To compare and merge worksheets:


1. Open the copy of the shared workbook into which you want to merge the changes.
2. On the Quick Access Toolbar, click Compare and Merge Workbooks.

3. If prompted, save the workbook.


4. In the Select Files to Merge into Current Workbook dialog box, click a copy of
the workbook that contains the changes that you want to merge.
5. Click OK button.

Note that:

To merge the workbook with multiple copies of the shared workbook
 at the same time, hold down
CTRL or SHIFT and click their file names, and then click OK.

Adding & Removing Password Protection for a Spreadsheet

To protect a workbook file from viewing or editing:


1. Click Microsoft Office button.
2. Highlight Save As.
3. Click Excel Workbook. The Save As dialog box is displayed.
4. Browse to the location (drive/folder) where you want to save the workbook.
5. Type a name for the workbook in the File name: field.
6. Click the Tools menu in the Save As dialog box.
7. Click General Options… The General Options dialog box is displayed.

8. Do either or both of the following:


a. If you want users to enter a password before they can view the workbook,
type a password in the Password to open: field, and then click OK button.
b. If you want users to enter a password before they can save changes to the
workbook, type a password in the Password to modify: field, and then click
OK button.
9. When prompted, retype your passwords to confirm them.
10. Click Save button.
11. If prompted, click Yes button to replace the existing workbook.

Page 114 of 120


Ms Joanne Zarb

To remove the password for viewing or editing a workbook file:


1. Open the workbook.
2. Repeat steps 1 through 7 as above.

3. In the Password to open or Password to modify box, or both boxes, double-click the
asterisks.
4. Press DELETE key.
5. Click OK button.
6. Click Save button.
7. Click Yes button to replace the existing workbook.

Protecting & Unprotecting Cells & Worksheets

Protecting a worksheet will prevent users from modifying the contents of the worksheet.
When you protect a worksheet, you can protect or unprotect individual elements of the
sheet from being modified by users.

To protect a worksheet:
1. Switch to the worksheet you want to protect.
2. Click the Review tab.
3. In the Changes group, click Protect Sheet. The Protect Sheet dialog box
is displayed.

4. Tick the option Protect worksheet and contents of locked cells. When selected,
prevents users from:

Page 115 of 120


Ms Joanne Zarb


Making changes to cells that you did not unlock before protecting the worksheet,
 unless you've granted a specific user
 permission to edit to the cells in the Allow
Users to Edit Ranges dialog box.
 
 Viewing rows or columns that you hid before you protected the worksheet.

Viewing the
formulas for the cells for which you hid the formulas before you protected the
 worksheet.

5. In the Password to unprotect sheet: field, type a password.


The password is optional; however, if you don't supply a password, any user will be
able to unprotect the sheet and change the protected elements. Make sure you
choose a password you can remember, because if you lose the password, you
cannot gain access to the protected elements on the worksheet.
6. In the Allow all users of this worksheet to list, select the elements that you want
users to be able to change.
7. Click OK button. If you have entered a password in step 5 the Confirm Password
dialog box is displayed.

8. Type the same password entered in step 5.


9. Click OK button.

Note that:

A warning message is displayed if you try and edit a cell within a worksheet. Click OK
button to close the warning message. However,
 MS Excel has features so that users are
allowed to edit parts of the worksheet.

Option To do…
Select locked cells When cleared, prevents users from moving the pointer to cells for which
the Locked check box is selected on the Protection tab of the Format
Cells dialog box.
Select unlocked cells When cleared, prevents users from moving the pointer to cells for which
the Locked check box is cleared on the Protection tab of the Format
Cells dialog box. When users are allowed to select unlocked cells, they can
press the TAB key to move between the unlocked cells on a protected
worksheet.

Page 116 of 120


Ms Joanne Zarb

Option To do…
Format cells When cleared, prevents users from changing any of the options in the
Format Cells or Conditional Formatting dialog boxes. If you applied
conditional formats before you protected the worksheet, the formatting
continues to change when a user enters a value that satisfies a different
condition.
Format columns When cleared, prevents users from using any of the commands on the
Column submenu of the Format menu, including changing column width
or hiding columns.
Format rows When cleared, prevents users from using any of the commands on the Row
submenu of the Format menu, including changing row height or hiding
rows.
Insert columns When cleared, prevents users from inserting columns.
Insert rows When cleared, prevents users from inserting rows.
Insert hyperlinks When cleared, prevents users from inserting new hyperlinks, even in
unlocked cells.
Delete columns When cleared, prevents users from deleting columns. Note that if Delete
columns is protected and Insert columns is not also protected, a user
can insert columns that he or she cannot delete.
Delete rows When cleared, prevents users from deleting rows. Note that if delete rows
is protected and insert rows is not also protected, a user can insert rows
that he or she cannot delete.
Sort When cleared, prevents users from using any of the Sort commands on the
Data menu, or the Sort buttons on the Standard toolbar. Users can't sort
ranges containing locked cells on a protected worksheet, regardless of this
setting.
Use AutoFilter When cleared, prevents users from using the drop-down arrows to change
the filter on an AutoFiltered range. Users cannot create or remove
AutoFiltered ranges on a protected worksheet, regardless of this setting.
Use PivotTable When cleared, prevents users from formatting, changing the layout,
reports refreshing, or otherwise modifying PivotTable reports, or creating new
reports.
Edit objects When cleared, prevents users from:
 Making changes to graphic objects - including maps, embedded
charts, shapes, text boxes, and controls - that you did not unlock
before you protected the worksheet. For example, if a worksheet
has a button that runs a macro, you can click the button to run the
macro, but you cannot delete the button.
 Making any changes, such as formatting, to an embedded chart.
The chart continues to update when you change its source data.
 Adding or editing comments.
Edit scenarios When cleared, prevents users from viewing scenarios that you have hidden,
making changes to scenarios that you have prevented changes to, and
deleting these scenarios. Users can edit the values in the changing cells, if
the cells are not protected, and add new scenarios.

To unprotect a worksheet:
1. Click the Review tab.
2. In the Changes group, click Unprotect Sheet. The Unprotect Sheet
dialog box is displayed.
3. Type the password used to protect the sheet.
4. Click OK button.

Page 117 of 120


Ms Joanne Zarb

By default, cells are locked, but locking means nothing unless you enforce it. Applying
protection does just that. If there are cells you‘re willing to let other users manipulate, you
must unlock them before protecting your worksheet.

To unlock/unprotect cells so that these can still be edited by users:


1. Click the Home tab.
2. Select the worksheet cell/s to unlock/unprotect.
3. In the Cells group, click Format.
4. Click Format Cells. The Format Cells dialog box is displayed.
5. Click the Protection tab card.

6. To unlock the cell/s, click the Locked check box to deselect the option.
7. Click OK button.

To lock/protect cells:
1. Repeat steps 1 through 5 as above.
2. To lock the cell/s, click the Locked check box to select the option.
3. Click OK button.

Page 118 of 120


Ms Joanne Zarb

Note that:

To enforce
 this protection, you need to protect the worksheet as indicated at the beginning of this
section.

Hiding & Unhiding Formulas

For security or privacy reasons, you may want to hide a formula from users of your
worksheet.

To prevent a formula from displaying in the formula bar:


1. Select the range of cells whose formulas you want to hide. You can also select
nonadjacent ranges or the entire sheet.
2. Click the Home tab.
3. In the Cells group, click Format.
4. Click Format Cells. The Format Cells dialog box is displayed.
5. Click the Protection tab.

6. Select the Hidden check box.


7. Click OK button.
8. On the Home tab, in the Cells group, click Format.
9. Click Protect Sheet. The Protect Sheet dialog box is displayed.

10. Make sure that the Protect worksheet and contents of locked cells check box is
selected.

Page 119 of 120


Ms Joanne Zarb

Note that:

When you prevent a formula from  displaying in the formula bar prevents editing
of the cell containing the formula.

To show formulas that were previously hidden by removing protection:


1. Click the Review tab.
2. In the Changes group, click Unprotect Sheet.
3. Select the range of cells whose formulas you want to unhide.
4. Click the Home tab.
5. In the Cells group, click Format.
6. Click Format Cells. The Format Cells dialog box is displayed.
7. Click the Protection tab.
8. Clear the Hidden check box.
9. Click OK button.

 
Activity 13

You will use Exercises.

1. Open twelve.xlsx located in Exercises folder.


2. In the Sales worksheet, using the track changes feature edit the
content in cell B1 to Sales 2010 and the content in cell B2 to €300.
3. Save and close twelve.xlsx.
4. Open fourteen.xlsx located in Exercises folder.
5. In the marks worksheet, accept the tracked change in cell A2
and reject the tracked change in cell D4.
6. Add password protection to open and modify the workbook
fourteen.xlsx.
7. Remove the password protection to modify set in the previous step.
8. In the marks worksheet set password protection such that
content in the cell range D2:E6 could be edited.
9. In the projections sheet, apply a setting to hide all formulas from
being displayed in the formula bar. Show the formulas again.
10. Save and close fourteen.xlsx.

Page 120 of 120

You might also like