You are on page 1of 133

Microsoft Excel

Intermediate Level
Excel Intermediate Page 1

Table of Contents
EXCEL FORMULA REFERENCES .................................................................................................................. 3
NESTED FUNCTIONS .......................................................................................................................................... 3
CONSOLIDATING DATA USING A 3-D REFERENCE SUM FUNCTION .................................................................... 5
MIXED REFERENCES WITHIN FORMULAS ........................................................................................................... 6
EXCEL NAMED RANGES .................................................................................................................................. 9
NAMING CELL RANGES ....................................................................................................................................... 9
REMOVING A NAMED RANGE ............................................................................................................................ 11
NAMED CELL RANGES AND FUNCTIONS ........................................................................................................... 12
EXCEL CELL AND RANGE FORMATTING .................................................................................................. 16
CONDITIONAL FORMATTING ............................................................................................................................. 16
CUSTOM NUMBER FORMATS ............................................................................................................................ 18
EXCEL STATISTICAL FUNCTIONS .............................................................................................................. 23
COUNT FUNCTION ......................................................................................................................................... 23
COUNTA FUNCTION....................................................................................................................................... 25
COUNTIF FUNCTION ...................................................................................................................................... 29
COUNTBLANK FUNCTION ............................................................................................................................ 31
EXCEL TEXT FUNCTIONS ............................................................................................................................. 35
LEFT FUNCTION .............................................................................................................................................. 35
RIGHT FUNCTION ........................................................................................................................................... 38
MID FUNCTION ................................................................................................................................................ 42
TRIM FUNCTION .............................................................................................................................................. 46
CONCATENATE FUNCTION ......................................................................................................................... 49
EXCEL DATE FUNCTIONS ............................................................................................................................. 52
INSERTING THE CURRENT TIME AND DATE ....................................................................................................... 52
TODAY FUNCTION .......................................................................................................................................... 52
NOW FUNCTION .............................................................................................................................................. 54
DAY FUNCTION ............................................................................................................................................... 56
MONTH FUNCTION ......................................................................................................................................... 58
YEAR FUNCTION............................................................................................................................................. 60
EXCEL LOGICAL FUNCTIONS ...................................................................................................................... 64
IF FUNCTION .................................................................................................................................................... 64
AND FUNCTION ............................................................................................................................................... 67
OR FUNCTION ................................................................................................................................................. 68
EXCEL LOOKUP FUNCTIONS ....................................................................................................................... 70
VLOOKUP FUNCTION .................................................................................................................................... 70
HLOOKUP FUNCTION .................................................................................................................................... 74
EXCEL DATABASE FUNCTIONS .................................................................................................................. 77
DSUM FUNCTION ............................................................................................................................................ 77
DMIN FUNCTION ............................................................................................................................................. 80
DMAX FUNCTION ............................................................................................................................................ 83
DCOUNT FUNCTION ...................................................................................................................................... 86
DAVERAGE FUNCTION ................................................................................................................................. 89
Excel Intermediate Page 2

EXCEL PIVOT TABLES .................................................................................................................................... 92


CREATING AND USING A PIVOT TABLE ............................................................................................................. 92
FILTERING AND SORTING DATA WITHIN A PIVOT TABLE ................................................................................... 99
AUTOMATICALLY GROUPING DATA IN A PIVOT TABLE AND RENAMING GROUPS ............................................ 103
PASTE SPECIAL OPTIONS WITHIN EXCEL ............................................................................................. 107
USING PASTE SPECIAL TO ADD RANGES ....................................................................................................... 107
USING PASTE SPECIAL TO SUBTRACT RANGES ............................................................................................ 109
USING PASTE SPECIAL TO MULTIPLY RANGES .............................................................................................. 111
USING PASTE SPECIAL TO DIVIDE RANGES ................................................................................................... 112
USING PASTE SPECIAL ‘VALUES’ ................................................................................................................... 114
USING PASTE SPECIAL TRANSPOSE OPTION ................................................................................................ 117
PRINTING SETUP ........................................................................................................................................... 121
PREVIEWING A WORKSHEET .......................................................................................................................... 121
PRINTING TITLES ON EVERY PAGE WHEN PRINTING ...................................................................................... 121
TO VIEW PRINTING OPTIONS .......................................................................................................................... 125
SELECTING WHICH PAGES TO PRINT.............................................................................................................. 126
PAGE ORIENTATION ....................................................................................................................................... 127
PAPER SIZE .................................................................................................................................................... 128
MARGINS ........................................................................................................................................................ 128
SCALING ......................................................................................................................................................... 130
PRINTING ....................................................................................................................................................... 131
Excel Intermediate Page 3

Excel Formula References


Nested functions
 Open a workbook called Nested Functions.

This workbook contains sales results for the North and South regions, along
with total and average sales results for the two regions.

The average sales target of a region is 25 (per sales person).

We want to be able to sum up only those sales of the regions that are above
the sales target.

 Click on cell B13 and enter the following formula.

=IF(AVERAGE(B3:B6)>25,SUM(B3:B6),0)
Excel Intermediate Page 4

 Once you have entered this formula, use drag and drop to copy this formula to
cell C13. The result should be as illustrated.

Sales for the North region exceeded their targets, (i.e. the average is over 25)
so in cell B13 you see the sales summed, while in cell C13, you see a 0 figure
as sales for the South region were below an average of 25:
Excel Intermediate Page 5

 Save your changes and close the workbook.

Consolidating data using a 3-D reference sum function


 Open a workbook called 3-D SUM Consolidation.

Quickly examine the data on each worksheet. In this example, we have a


workbook containing a number of worksheets.

Each worksheet within the workbook contains the total annual sales for a
salesperson called Rowan. We wish to total the sales for the last three years
and display them on the first page within the workbook:

 Click on cell C7 on the first worksheet within the workbook.


 Click on Formulas tab and within the Function Library group, click on the
upper part of the AutoSum button.

 Your screen will look like this.


Excel Intermediate Page 6

 Click on the tab of the second worksheet to display the second worksheet.
 Highlight the cell or range to be consolidated, in this case cell B2:
 While depressing the Shift key, click on the worksheet tabs for the other
worksheets to be consolidated, in this case for the years 2012 and 2011.
 Press the Enter key and the consolidated value for the three years will be
displayed within the first worksheet.
 If you click on the cell containing the consolidated data (on the first worksheet)
you will notice the consolidation formula in the Formula Bar:

 Save your changes and close the workbook.

Mixed references within formulas


 Open a workbook called Mixed references.
 We are going to use mixed references within the workbook to produce a
multiplication table that will display all possible values for up to 'ten times ten'.

When you create a mixed cell reference, either the column or the row uses
absolute referencing, which will not change when the formula is copied and
pasted to another part of your worksheet.

An absolute cell reference contains a dollar sign in front of both parts of the
reference whereas a mixed cell reference contains a dollar sign in front of just
one part of the reference.

 Click on cell B2 and insert the following formula, which contains 2 mixed
references.

=B$1*$A2
Excel Intermediate Page 7

 Your worksheet will look like this.

 Extend the contents of cell B2 to fill the range B2:K2. You will see the
following.

 Extend the range B2:K2 down the worksheet, as illustrated.


Excel Intermediate Page 8

 As you can see you now have a multiplication table, just like the ones you
used at school.
 Save your changes and close the workbook.
Excel Intermediate Page 9

Excel Named Ranges


Naming cell ranges
 Open a file called Named Ranges 01.
 We are going to give a name to the Quantity Sold range.
 Select the range to be named, in this case cell B4:B9.

 Click in the Name Box (to the top-left of your screen) with the mouse and
enter the name you want to give to the cell(s), in this case Quantity_Sold,
and press Enter.

TIP: If you see an error message, this is because you did not place an
underscore character between the words Quantity and Sold.
Excel Intermediate Page 10

 We are now going to name the range for the Price per Item.
 Click on cell E3.
 Click in the Name Box with the mouse and enter the name for the range, in
this case Price_per_item, and press Enter.

TIP: If you see an error message, this is because you did not place an
underscore character between the words.

 If you click on the down arrow, next to the Name Box, you will see both
named ranges listed.
Excel Intermediate Page 11

 Within Excel functions you may now reference the name of these ranges,
rather than have to specify the cell range. This makes understanding
functions much easier.
 Save your changes and close the workbook.

Removing a named range


 Open a file called Named Ranges 02.
 Click on the down arrow next to the Name Box and you will see that this
worksheet contains two named ranges.

 Click on a Formulas tab and within the Defined Names group, click on the
Name Manager button.
Excel Intermediate Page 12

 The Name Manager dialog box will be displayed. Select the named range
that you wish to delete, such as Quanity_Sold and then click on the Delete
button.

 A warning dialog box will be displayed. Click on the OK button.

 Click on the Close button to close the Name Manager dialog box.
 Save your changes and close the workbook.

Named cell ranges and functions


 Open a file called Named Ranges 03.
 Click on the down arrow next to the Name Box and you will see that this
worksheet contains two named ranges.
Excel Intermediate Page 13

 Click on the Price_per_item named range as displayed within the Name Box
and you will see the named range highlighted within the worksheet.

 Click on the Quantity_Sold named range as displayed within the Name Box
and you will see the named range highlighted within the worksheet.
Excel Intermediate Page 14

 Click on cell B10.


 Click on the Formulas button, and within the Function Library group, click
on the upper part of the AutoSum button.

 As you can see the function automatically used the name of the range, within
the function syntax.

=SUM(Quantity_Sold)
Excel Intermediate Page 15

 Press the Enter key.


 Click on cell B10 and you will see that the named range is used in the SUM
function.

 Save your changes and close the workbook.


Excel Intermediate Page 16

Excel Cell and Range Formatting


Conditional formatting
 Open a workbook called Conditional Formatting.

 This workbook contains details for sales over a 3-month period. We wish to
highlight all sales over 50 units.
 Select the range of cells to which you wish to apply conditional formatting. In
this example, the range would be C6:E13.

 Click on the Home tab and within the Styles group, click on the Conditional
Formatting button.
Excel Intermediate Page 17

 From the drop-down menu displayed click on Highlight Cells Rules. From
the sub-menu displayed, click on Greater Than.

 This will display the Conditional Formatting dialog box. We wish to highlight
all values over 50, so enter the number 50 into the dialog box.

 Click on the down arrow in the right-hand side of the dialog box. This will
allow you to specify how cells containing a value greater than 50 will be
formatted. In this case select Red Text.
Excel Intermediate Page 18

 Click on the OK button to close the dialog box. You should now see all values
above 50 displayed in red text.

 Save your changes and close the workbook.

Custom number formats


 Open a workbook called Custom Numbers.
Excel Intermediate Page 19

 Select cells C6 and D6, which contain the annual balance information.

 Right click on the selected cells and from the pop-up menu displayed select
the Format Cells command.
Excel Intermediate Page 20

 This will display the Format Cells dialog box.

 If necessary, select the Number tab.


 From the Category section of the dialog box, select Custom.
Excel Intermediate Page 21

 Within the Type section of the dialog box, select a format code similar to that
shown below.

#,##0;[Red]-#,##0

 Within the formatting code, change the word Red to Blue.


Excel Intermediate Page 22

 Click on the OK button and the negative balance for the year 2009 will be
displayed in blue.

NOTE. Normally you would use red for a negative balance, but here we are
simply illustrating a formatting feature.

 Save your changes and close the workbook.


Excel Intermediate Page 23

Excel Statistical Functions


COUNT Function
 Open a workbook called Functions - Count. This sheet contains
examination results and grades.

 Click on cell C9.


 Click on the Formulas tab and within the Function Library group click on the
More Functions button. From the drop down list displayed click on
Statistical. From the submenu displayed click on the COUNT function.
Excel Intermediate Page 24

 The Function Arguments dialog box is displayed.

 In the Value1 section of the dialog box, Enter the cell range C5:C8.

 Click on the OK button to insert the function. Your worksheet will now look
like this.
Excel Intermediate Page 25

 You can see the function syntax displayed within the Formula Bar.

=COUNT(C5:C8)

 Use the normal drag and drop techniques to copy this function to cells D9 and
E9. Your worksheet will now look like this.

 Save your changes and close the workbook.

COUNTA Function
 Open a workbook called Functions - Counta. This sheet contains
examination results and grades.
Excel Intermediate Page 26

 Click on cell C9. We will use the COUNTA function to count the number of A
grades, the number of B grades and the number of C grades.
 Click on the Formulas tab and within the Function Library group click on the
More Functions button. From the drop down list displayed click on
Statistical. From the submenu displayed click on the COUNTA function.

 The Function Arguments dialog box will be displayed.


Excel Intermediate Page 27

 In the Value1 section of the dialog box, Enter the cell range C5:C8.

 Click on the OK button to insert the function. Your worksheet will now look
like this.
Excel Intermediate Page 28

 You can see the function syntax displayed within the Formula Bar.

=COUNTA(C5:C8)

 Use the normal drag and drop techniques to copy this function to cells D9 and
E9. Your worksheet will now look like this.

 Save your changes and close the workbook.


Excel Intermediate Page 29

COUNTIF Function
 Open a workbook called Functions - Countif. This sheet contains
examination results and grades. We shall use the Countif function to see how
many 'A' grades Dave has, how many Rowan has and how many Elliot has.

 Click on cell C9.


 Click on the Formulas tab and within the Function Library group click on the
More Functions button. From the drop down list displayed click on
Statistical. From the submenu displayed click on the COUNTIF function.

 The Function Arguments dialog box is displayed.


Excel Intermediate Page 30

 In the Range section of the dialog box, enter the cell range C5:C8.
 In the Criteria section of the dialog box, enter A.

 Click on the OK button to insert the function. Your worksheet will now look
like this.
Excel Intermediate Page 31

 You can see the function syntax displayed within the Formula Bar.

=COUNTIF(C5:C8,"A")

 Use the normal drag and drop techniques to copy this function to cells D9 and
E9. Your worksheet will now look like this.

 Save your changes and close the workbook.

COUNTBLANK Function
 Open a workbook called Functions - Countblank. This sheet contains
examination results and grades. We shall use the Countblank function to see
how many empty cells are listed under each name. This will tell us how many
Excel Intermediate Page 32

subjects each person did not pass. The worksheet looks like this.

 Click on cell C11.


 Click on the Formulas tab and within the Function Library group click on the
More Functions button. From the drop down list displayed click on
Statistical. From the submenu displayed click on the COUNTBLANK
function.

 The Function Arguments dialog box is displayed.


Excel Intermediate Page 33

 In the Range section of the dialog box, enter the cell range C5:C10.

 Click on the OK button to insert the function. Your worksheet will now look
like this.
Excel Intermediate Page 34

 You can see the function syntax displayed within the Formula Bar.

=COUNTBLANK(C5:C10)

 Use the normal drag and drop techniques to copy this function to cells
D11:H11. Your worksheet will now look like this.

 Save your changes and close the workbook.


Excel Intermediate Page 35

Excel Text Functions


LEFT Function
 Open a workbook called Functions - Left. It contains the following data.

 We want to extract the first character from the text within the range B4:B19
and insert the first character in the range C4:C19.
 Click on cell C4.
 Click on the Formulas tab and within the Function Library group click on the
Text button. From the submenu displayed click on the LEFT function.
Excel Intermediate Page 36

 The Function Arguments dialog box will be displayed.

 Enter the following information into the dialog box.


Excel Intermediate Page 37

 Click on the OK button and you will see the following.

 Notice the syntax, displayed within the Function bar.

=LEFT(B4,1)

 Use the normal Excel drag and drop techniques to extend this function to fill
the range C4:C19. Your data will now look like this.
Excel Intermediate Page 38

 Save your changes and close the workbook.

RIGHT Function
 Open a workbook called Functions - Right. The worksheet contains the
following table.
Excel Intermediate Page 39

 We will use the RIGHT function to extract the last 2 characters from the right
of each text string and just display the 2 digit country ID.
 Click on cell D3.
 Click on the Formulas tab and within the Function Library group click on the
Text button. From the submenu displayed click on the RIGHT function.
Excel Intermediate Page 40

 The Function Arguments dialog box will be displayed.

 Within the Text field enter C3.


 Within the Num_chars enter the number 2.
Excel Intermediate Page 41

 Click on the OK button and your data will look like this. Notice the function
syntax in the Function bar.

 Extend the contents of cell D3 to fill the range D3:D21. Your data will now
look like this.
Excel Intermediate Page 42

 Save your changes and close the workbook.

MID Function
 Open a workbook called Functions - Mid. The worksheet contains the
following table. We want to extract the fourth and fifth characters, which are
country codes for the DVDs and then display that data in the column next to
the product codes.
Excel Intermediate Page 43

 Click on cell C3.


 Click on the Formulas tab and within the Function Library group click on the
Text button. From the submenu displayed click on the MID function.
Excel Intermediate Page 44

 The Function Arguments dialog box is displayed.

 Enter the following information.

 Click on the OK button and your data will look like this.
Excel Intermediate Page 45

 Extend the contents of cell C3 to fill the range C3:C16. Your data will now
look like this.

 Save your changes and close the workbook.


Excel Intermediate Page 46

TRIM Function
 Open a workbook called Functions - Trim. The worksheet contains the
following data. As you can see there are increasing large amounts of extra
spaces inserted at the start of each line of text. We will use the TRIM function
to 'trim' these leading spaces.

NOTE: You can also use TRIM to 'trim' spaces at the end of a line.

 Click on cell D4.


 Click on the Formulas tab and within the Function Library group click on the
Text button. From the sub-menu displayed click on the TRIM function.
Excel Intermediate Page 47

 The Function Arguments dialog box is displayed.

 Enter C4 into the Text field.


Excel Intermediate Page 48

 Click on the OK button and your data will look like this. Notice the function
syntax in the Formula Bar.

 Extend the contents of cell D4 to the range D4:D13. Your data will now look
like this.
Excel Intermediate Page 49

 Save your changes and close the workbook.

CONCATENATE Function
 Open a workbook called Functions - Concatenate. It contains the following
data.

 Click on cell B5.


 Click on the Formulas tab and within the Function Library group click on the
Text button. From the sub-menu displayed click on the CONCATENATE
function.
Excel Intermediate Page 50

 The Function Arguments dialog box is displayed.

 Click within the Text 1 section of the dialog box


and then click on cell A1.
 Click within the Text 2 section of the dialog box
and then click on cell A2.
 Click within the Text 3 section of the dialog box
and then click on cell A3.
 Click within the Text 4 section of the dialog box
and then click on cell A4.
 The Function Arguments dialog box will now look like this.
Excel Intermediate Page 51

 Click on the OK button, and you will see the result as illustrated.

 Save your changes and close the workbook.


Excel Intermediate Page 52

Excel Date Functions


Inserting the current time and date
 PLEASE NOTE:

This section is just a reference, so do not try to follow through instructions


now just remember how you can insert the current date or time within Excel.

 The advantage of using functions is that the time and date will be updated to
the current time and date, even when you close down the workbook, and later
reopen it. You can also use keyboard shortcuts to insert the time and date,
but the following examples will only insert 'static' time or dates that will not be
automatically updated.

To insert the current date into a cell.


Click within a cell and then press Ctrl+;

To insert the current time.


Click within a cell and then press Ctrl+Shift+;

TODAY Function
 Open a workbook called Functions - Today.
 Click on cell C2.
 Click on the Formulas tab and within the Function Library group click on the
Date and Time button. From the drop down list displayed click on the
TODAY function.
Excel Intermediate Page 53

 The Function Arguments dialog box will be displayed.

 Click on the OK button to insert the function.


Excel Intermediate Page 54

 You can see the function syntax displayed within the Formula Bar (displayed
above the workbook area). In this case you will see the following.

=TODAY()

 Save your changes and close the workbook.

NOW Function
 Open a workbook called Functions - Now.
 Click on cell C2.
 Click on the Formulas tab and within the Function Library group click on the
Date and Time button. From the drop down list displayed click on the NOW
function.
Excel Intermediate Page 55

 The Function Arguments dialog box will be displayed.

 Click on the OK button to insert the function.


Excel Intermediate Page 56

 You can see the function syntax displayed within the Formula Bar (displayed
above the workbook area). In this case you will see the following.

=NOW()

 Save your changes and close the workbook.

DAY Function
 Open a workbook called Functions - Day.
 Click on cell C3. As you can see this cell contains the TODAY function, which
displays the current date.

 Click on the cell into which we want to insert the DAY function. In this case
click on cell C6.
 Click on the Formulas tab and within the Function Library group click on the
Date and Time button. From the drop down list displayed click on the DAY
function.
Excel Intermediate Page 57

 The Function Arguments dialog box is displayed. The dialog box displays
basic information about this function. As you can see this function 'returns
the day of the month, a number from 1 to 31'.

 Click on cell C3 and you will see that this cell reference is automatically
displayed within the Serial_number section of the dialog box.
Excel Intermediate Page 58

 Click on the OK button and the current day of the month will be displayed
within cell, C6. It takes this information from the data within cell C3.

 The function syntax is displayed within the Formula Bar, above the
worksheet.

=DAY(C3)

 Save your changes and close the workbook.

MONTH Function
 Open a workbook called Functions - Month.
 Click on cell C3. As you can see this cell contains the TODAY function, which
displays the current date.
Excel Intermediate Page 59

 Click on the cell into which we want to insert the MONTH function. In this
case click on cell C6.
 Click on the Formulas tab and within the Function Library group click on the
Date and Time button. From the drop down list displayed click on the
MONTH function.

 The Function Arguments dialog box is displayed. The dialog box displays
basic information about this function. As you can see this function 'returns
the month, a number from 1 (January) to 12 (December)'.

 Click on cell C3 and you will see that this cell reference is automatically
displayed within the Serial_number section of the dialog box.
Excel Intermediate Page 60

 Click on the OK button and the current month will be displayed within cell, C6.
It takes this information from the data within cell C3.

 The function syntax is displayed within the Formula Bar, above the
worksheet.

=MONTH(C3)

 Save your changes and close the workbook.

YEAR Function
 Open a workbook called Functions - Year.
 Click on cell C3. As you can see this cell contains the TODAY function, which
displays the current date.
Excel Intermediate Page 61

 Click on the cell into which we want to insert the YEAR function. In this case
click on cell C6.
 Click on the Formulas tab and within the Function Library group click on the
Date and Time button. From the drop down list displayed click on the YEAR
function.
Excel Intermediate Page 62

 The Function Arguments dialog box is displayed. The dialog box displays
basic information about this function. As you can see this function 'returns
the year, an integer in the range 1900-9999'.

 Click on cell C3 and you will see that this cell reference is automatically
displayed within the Serial_number section of the dialog box.

 Click on the OK button and the current year will be displayed within cell C6. It
takes this information from the data within cell C3.
Excel Intermediate Page 63

 The function syntax is displayed within the Formula Bar, above the
worksheet.

=YEAR(C3)

 Save your changes and close the workbook.


Excel Intermediate Page 64

Excel Logical Functions


IF Function
 Open a workbook called Functions - If.

This example calculates a discount based on order quantity. The company


offers its customers a 5% discount if the value of an order is above 500.
There is no discount if the value is below 500.

A way of simplifying the above statement is as follows.

If the sale value is greater than 500 give 5% discount otherwise give no
discount.

 Click on cell C3.


 Click on the Formulas tab and within the Function Library group click on the
Logical button. From the drop down list displayed click on the IF function.
Excel Intermediate Page 65

 The Function Arguments dialog box will be displayed.

 Click on the Logical_test section of the dialog box and enter B3>500.
 Click on the Value_if_true section of the dialog box and enter B3*5%.
 Click on the Value_if_false section of the dialog box and enter 0.
Excel Intermediate Page 66

 When you press the OK button, you will see the following. As the value in cell
B3 is less than 500, the discount value is zero.

 Copy the formula in cell C3 to cells C4:C6 using the usual fill handle
technique and you will see the following. As you can see where the sales
value is above 500, a discount value is displayed.
Excel Intermediate Page 67

 Save your changes and close the workbook.

AND Function
 Open a workbook called Functions - AND.

In this example, we have the results of a two-part examination;

candidates must achieve over 50 in EACH part of the examination.

 Click on cell D3 and enter the following:

=IF(AND(B3>50,C3>50),$F$2,$F$3)

 When you press Enter you should see the following, as the candidate scored
less than 50 in the first part of the examinations:
Excel Intermediate Page 68

 Copy the formula in cell D3 to the cell range D4:D6 and you will see the
following:

 The only person to get more than 50 in both parts of the examination is
Menendez, who is the only person to pass the entire examination.
 Save your changes and close the workbook.

OR Function
 Open a workbook called Functions - OR.

In this example, we have the results of a two-part examination and candidates


can pass the entire examination by achieving a score of > 75 in either part of
the examination.

 Click on cell D3 and enter the following:

=IF(OR(B3>75,C3>75),$F$2,$F$3)

 When you press Enter you should see the following, as the candidate scored
less than 75 marks in both parts of the examination:
Excel Intermediate Page 69

 Copy the formula in cell D3 to the cell range D4:D6 and you will see the
following:

 The only person to get less than 75 marks in both parts of the examination is
Gravani, who is the only person to not pass the entire examination.
 Save your changes and close the workbook.
Excel Intermediate Page 70

Excel Lookup Functions


VLOOKUP Function
 Open a workbook called Functions Vlookup. The workbook looks like this.

 Click on cell B3.


 Click on the Formulas tab and within the Function Library group click on the
Lookup & Reference button. From the sub-menu displayed click on the
VLOOKUP function.
Excel Intermediate Page 71

 The Function Arguments dialog box will be displayed.

 Click in the Lookup_value section of the dialog box and then click on cell A3.
 Click in the Table_array section of the dialog box and then select the cell
range A7:C10.
Excel Intermediate Page 72

 Click in the Col_index_num section of the dialog box and then enter 2.

 Click on the OK button and you will see the following.

 Click on cell C3 and enter the following.

=VLOOKUP(A3,A7:C10,3)
Excel Intermediate Page 73

 Try entering different values into cell A3, such as Medium.

 Try entering different values into cell A3, such as Large.


Excel Intermediate Page 74

 Save your changes and close the workbook.

HLOOKUP Function
 Open a workbook called Functions - Hlookup. This example shows how you
can use two values to lookup a value in a table. The function looks for the
package type in row 1 of the table and then returns the mailing cost in the
appropriate mailing type row.

 Click on cell C5.


 Click on the Formulas tab and within the Function Library group click on the
Lookup & Reference button. From the sub-menu displayed click on the
HLOOKUP function.
Excel Intermediate Page 75

 The Function Arguments dialog box will be displayed.

 Click on the Lookup_value section of the dialog box, and then click on cell
C2.
 Click on the Table_array section of the dialog box, and then select the cell
range B8:E11.
 Click on the Row_index_num section of the dialog box, and then click on cell
C3.
Excel Intermediate Page 76

 When you click on the OK button, you will see the following. Notice the
formula in cell C5 displayed in the Formula Bar.

 Try entering other values in cell C2, such as B or C.


 Try entering other values in cell C3, such as 3 or 4.
 Save your changes and close the workbook.
Excel Intermediate Page 77

Excel Database Functions


DSUM Function
 Open a workbook called Functions - Dsum.

In this example, we will sum up the total value of all sales people whose sales
are above their sales targets.

 Click on cell D14.


 Click on the Formulas tab and within the Function Library group click on the
Insert Function button.

 The Insert Function dialog box will be displayed. Use the Or select a
category drop down arrow to select Database functions. From the list of
database functions displayed, scroll down and select the DSUM function.
Excel Intermediate Page 78

 Click on the OK button and the Function Arguments dialog box will be
displayed.

 Click on the Database field within the dialog box and then select cells
A7:C12.
 Click on the Field section of the dialog box and enter Sales.
 Click on the Criteria section of the dialog box and then select cells B4:B5.
Excel Intermediate Page 79

 Click on the OK button to see the result displayed.

 The function syntax is displayed in the Formula Bar.

=DSUM(A7:C12,"Sales",B4:B5)

 Save your changes and close the workbook.


Excel Intermediate Page 80

DMIN Function
 Open a workbook called Functions - Dmin.

In this example, we will use the DMIN function to see what the lowest sales
figure of any of our sales people is.

 Click on cell D14.


 Click on the Formulas tab and within the Function Library group click on the
Insert Function button.

 The Insert Function dialog box will be displayed. Use the Or select a
category drop down arrow to select Database functions. From the list of
database functions displayed, scroll down and select the DMIN function.
Excel Intermediate Page 81

 Click on the OK button and the Function Arguments dialog box will be
displayed.

 Click on the Database section of the dialog box and then select the cell range
A7:C12.
 Click on the Field section of the dialog box and then click on cell C7.
Excel Intermediate Page 82

 Click on the Criteria section of the dialog box and then select the cell range

 When you click on the OK button, you will see the results displayed.

 You can see the function syntax displayed within the Formula Bar.

=DMIN(A7:C12,C7,C8:C12)

 Save your changes and close the workbook.


Excel Intermediate Page 83

DMAX Function
 Open a workbook called Functions - Dmax.

In this example, we will use the DMAX function to see what the highest sales
figure of any of our sales people is.

 Click on cell D14.


 Click on the Formulas tab and within the Function Library group click on the
Insert Function button.

 The Insert Function dialog box will be displayed. Use the Or select a
category drop down arrow to select Database functions. From the list of
database functions displayed, scroll down and select the DMAX function.
Excel Intermediate Page 84

 Click on the OK button and the Function Arguments dialog box will be
displayed.

 Click on the Database section of the dialog box and then select the cell range
A7:C12.
 Click on the Field section of the dialog box and then click on cell C7.
 Click on the Criteria section of the dialog box and then select the cell range
C8:C12.
Excel Intermediate Page 85

 When you click on the OK button, you will see the results displayed.

 You can see the function syntax displayed within the Formula Bar.

=DMAX(A7:C12,C7,C8:C12)

 Save your changes and close the workbook.


Excel Intermediate Page 86

DCOUNT Function
 Open a workbook called Functions - Dcount.

In this example, we have a number of sales people, and their target sales
should be above 20.

We wish to use the DCOUNT function to show the sales people who are
above target sales.

 Click on cell D14.


 Click on the Formulas tab and within the Function Library group click on the
Insert Function button.

 The Insert Function dialog box will be displayed. Use the Or select a
category drop down arrow to select Database functions. From the list of
database functions displayed, scroll down and select the DCOUNT function.
Excel Intermediate Page 87

 Click on the OK button and the Function Arguments dialog box will be
displayed.

 Click within the Database section of the dialog box and then select cells
A7:C12.
 Click within the Field section of the dialog box and then click on cell C7.
Excel Intermediate Page 88

 Click within the Criteria section of the dialog box and then select cells B4:B5.

 Click on the OK button and the results will be displayed.

 You can see the function syntax displayed within the Formula Bar.

=DCOUNT(A7:C12,C7,B4:B5)

 Save your changes and close the workbook.


Excel Intermediate Page 89

DAVERAGE Function
 Open a workbook called Functions - Daverage. This workbook contains the
following data:

 In this example we have a number of products with associated quantities and


costs. We wish to use the DAVERAGE function to find the average unit price
of products with a quantity value higher than 9.

 Click on cell C18.


 Click on the Formulas tab and within the Function Library group click on the
Insert Function button.
Excel Intermediate Page 90

 The Insert Function dialog box will be displayed. Use the Or select a
category drop down arrow to select Database functions. From the list of
database functions displayed, scroll down and select the DAVERAGE
function.

 Click on the OK button and the Function Arguments dialog box will be
displayed.

 Click within the Database section of the dialog box and then select cells
A3:D12.
 Click within the Field section of the dialog box and then click on cell C3.
 Click within the Criteria section of the dialog box and then select cells
B15:B16.
Excel Intermediate Page 91

 Click on the OK button and the results will be displayed.

 You can see the function syntax displayed within the Formula Bar.

=DAVERAGE(A3:D12,C3,B15:B16)

 Save your changes and close the workbook.


Excel Intermediate Page 92

Excel Pivot Tables


Creating and using a pivot table
 Open a workbook called Pivot Tables 01. This worksheet contains the data
from which you wish to create your pivot table.

 Click within the data table.


 Click on the Insert tab and within the Tables group click on the Pivot Table
button.

 The Create Pivot Table dialog box will be displayed.


Excel Intermediate Page 93

 Accept the default values displayed and click on the OK button. Your screen
will now look like this.

NOTE: A new worksheet has been inserted into your workbook and the
default name for this worksheet is Sheet1.
Excel Intermediate Page 94

 The Pivot Table Field List will be displayed to the right of the screen. Click
on the Sales Person check box.

 Your will data will now look like this.

 Within the Pivot Table Field List click on the Customer check box.
Excel Intermediate Page 95

 Move the mouse pointer over the Customer field so that the field is
highlighted as illustrated.

 Drag the Customer field down to the Column Label box as illustrated.
Excel Intermediate Page 96

 Your data will now look like this.

 Within the Pivot Table Field List click on the check box next to Total value.
Excel Intermediate Page 97

Your data will now look like this.

 Click on the Pivot Table Data worksheet tab, so that your original table of
data is displayed.
 Make some changes such as changing the value within cell D4, from 1 to 10.
Excel Intermediate Page 98

 Click on the worksheet tab containing your Pivot Table, you will notice that the
Pivot Table has not been updated to take account of your changed data.

 Click within the Pivot Table.


 Right click and from the pop-up menu displayed select the Refresh
command.
Excel Intermediate Page 99

 You will see the data change, as illustrated.

 Save your changes and close the workbook.

Filtering and sorting data within a pivot table


 Open a workbook called Pivot Tables 02.
Excel Intermediate Page 100

 You can see that the names of the sales persons are listed in alphabetical
order.
 To reverse the sort order of the sales person names, first click on one of the
Sales Persons names within the data.
 Right click over one of the sales names and from the pop-up menu displayed
click on the Sort command. From the sub-menu displayed click on the Sort Z
to A.

 The sorted data will look like this.


Excel Intermediate Page 101

 To restore the sort order back to alphabetical A to Z order repeat the process
and select A to Z as the sort order.

 You can apply filters to the Pivot Table to control which records are displayed.
 Click on the down arrow displayed to the right of the Customer column field
heading.

 This will display a list of company names.


Excel Intermediate Page 102

 At present all the customers are selected and therefore shown on the Pivot
Table.
 Clear the selection boxes so that only ABC Company and KLM Company
are selected.

 Click on the OK button and the filtered Pivot Table will be displayed.
Excel Intermediate Page 103

 Only sales for ABC Company and KLM Company are displayed, the other
customers have been filtered out of the Pivot Table.

 Save your changes and close the workbook.

Automatically grouping data in a pivot table and renaming groups


 Open a workbook called Pivot Tables Grouping.
Excel Intermediate Page 104

 In this example we are going to automatically group the dates in the pivot
table by year.
 Right click over one of the cells containing a date and from the pop-up menu
displayed select the Group command.

 The Grouping dialog box will be displayed.

 Click on Months to de-select it & then click on Years. The Grouping dialog
box should now look like this.
Excel Intermediate Page 105

 Click on the OK button to close the Grouping dialog box and apply the
automatic grouping.

 As you can see, orders have now been grouped by year.

 You can rename any of the automatically created groups. To rename the
2007 group click on the cell containing the group name (in this case cell A7)
and type in a new name for the group, use the name Final Year, and press
Enter.
Excel Intermediate Page 106

 Save your changes and close the workbook.


Excel Intermediate Page 107

Paste Special options within Excel


Using Paste Special to add ranges
 Open a workbook called Paste Special Operations.

 Make sure that the Add worksheet tab is selected.

 To see the effect of the add operator, first select the range C3:C5.

 Press Ctrl+C to copy the selected range to the Clipboard.


 Select the range G3:G5.
Excel Intermediate Page 108

 Click on the down arrow under the Paste button located under the Home tab.
From the drop down menu displayed, click on the Paste Special command.

 This will display the Paste Special dialog box. Within the Operation section
of the dialog box, select Add.

 Click on the OK button.


Excel Intermediate Page 109

The value in cell C3 (i.e. 1) is added to the original contents of cell G3


(i.e. 2). So the result displayed in cell G3 is 1+2=3.

The value in cell C4 (i.e. 2) is added to the original contents of cell G4


(i.e. 4). So the result displayed in cell G4 is 2+4=6.

The value in cell C5 (i.e. 3) is added to the original contents of cell G5


(i.e. 6). So the result displayed in cell G5 is 3+6=9.

Using Paste Special to subtract ranges


 To see the effect of Subtract operations, click on the Subtract worksheet tab.

 Select the range C3:C5.


 Press Ctrl+C to copy the selected range to the Clipboard.
 Select the range G3:G5.
 Click on the down arrow under the Paste button located under the Home
tab. From the drop down menu displayed, click on the Paste Special
command.
Excel Intermediate Page 110

 This will display the Paste Special dialog box. Within the Operation section
of the dialog box, select Subtract.

 Click on the OK button.


Excel Intermediate Page 111

 The value in cell C3 (i.e. 1) is subtracted from the original contents of cell G3
(i.e. 2). So the result displayed in cell G3 is 2-1=1.

The value in cell C4 (i.e. 2) is subtracted from the original contents of cell G4
(i.e. 4). So the result displayed in cell G4 is 4-2=2.

The value in cell C5 (i.e. 3) is subtracted from the original contents of cell G5
(i.e. 6). So the result displayed in cell G5 is 6-3=3.

Using Paste Special to multiply ranges


 To see the effect of Multiply operations, click on the Multiply worksheet tab.

 Select the range C3:C5.


 Press Ctrl+C to copy the selected range to the Clipboard.
 Select the range G3:G5.
 Click on the down arrow under the Paste button located under the Home tab.
From the drop down menu displayed, click on the Paste Special command.

 This will display the Paste Special dialog box. Within the Operation section
of the dialog box, select Multiply.
Excel Intermediate Page 112

 Click on the OK button.

 The value in cell C3 (i.e. 1) is used to multiply the original contents of cell G3
(i.e. 2). So the result displayed in cell G3 is 2*1=2.

The value in cell C4 (i.e. 2) is used to multiply the original contents of cell G4
(i.e. 4). So the result displayed in cell G4 is 4*2=8.

The value in cell C5 (i.e. 3) is used to multiply the original contents of cell G5
(i.e. 6). So the result displayed in cell G5 is 6*3=18.

Using Paste Special to divide ranges


 To see the effect of Divide operations, click on the Divide worksheet tab.
Excel Intermediate Page 113

 Select the range C3:C5.


 Press Ctrl+C to copy the selected range to the Clipboard.
 Select the range G3:G5.
 Click on the down arrow under the Paste button located under the Home tab.
From the drop down menu displayed, click on the Paste Special command.

 This will display the Paste Special dialog box. Within the Operation section
of the dialog box, select Divide.

 Click on the OK button.


Excel Intermediate Page 114

 The value in cell C3 (i.e. 1) is used to divide the original contents of cell G3
(i.e. 18). So the result displayed in cell G3 is 18/1=18.

The value in cell C4 (i.e. 2) is used to divide the original contents of cell G4
(i.e. 18). So the result displayed in cell G4 is 18/2=9.

The value in cell C5 (i.e. 3) is used to divide the original contents of cell G5
(i.e. 18). So the result displayed in cell G5 is 18/3=6.

 Save your changes and close the workbook.

Using Paste Special ‘values’


 Open a workbook called Paste Special values. The worksheet contains the
following data.
Excel Intermediate Page 115

 The cells in the range C7:I10 all contain functions that are used to work out
the numbers displayed. For instance if you click on cell C7, you will see a
SUM function.

 Select the range B7:I10.

 Press Ctrl+C to copy the selected range to the Clipboard.


 Click on cell B13.
 Click on the Edit drop down menu and select the Paste Special command.
 Click on the down arrow under the Paste button located under the Home tab.
From the drop down menu displayed, click on the Paste Special command.
Excel Intermediate Page 116

 This will display the Paste Special dialog box. Click on the Values button,
within the dialog box and then click on the OK button.

 You will see a copy of the selected range displayed under the original data.
Excel Intermediate Page 117

 Click within any of the cells within the range C13:I16 and you will see that
each cell contains a value, not a function.

 Save your changes and close the workbook.

Using Paste Special transpose option


 Open a workbook called Paste Special Transpose.
Excel Intermediate Page 118

 Select the cell(s) containing the data you wish to copy to the Clipboard, in this
case the range A2:D6.

 Press Ctrl+C to copy the selected range to the Clipboard.


 Select the cell you want to paste the copied data into, in this case click on cell
A9.
 Click on the down arrow under the Paste button located under the Home
tab. From the drop down menu displayed, click on the Paste Special
command.
Excel Intermediate Page 119

 This will display the Paste Special dialog box.

 Select the Transpose check box and select OK. The data is transposed.
Excel Intermediate Page 120

 Save your changes and close the workbook.


Excel Intermediate Page 121

Printing Setup
Previewing a worksheet
 Always view a workbook in Print Preview mode prior to printing it. It allows you
a quick visual check over how the worksheet will look when printed.
 Click on the File Tab and then click on the arrow next to the Print command.
From the submenu, select Print Preview.

OR press Ctrl+F2.

 Save your changes and close the workbook.

Printing titles on every page when printing


 Open a workbook called Printing options 2.
 View the worksheet in Print Preview view by pressing Ctrl+F2. As you can see
the top row, containing the column titles is displayed on the first page.
Excel Intermediate Page 122

 Click on the Next Page arrow button, displayed at the bottom-centre of the page
to view the second page.

 As you can see the columns are displayed without a top row explaining what
each column relates to.

 We need to fix this as it would be very inconvenient to print out a long report and
always have to refer to the first page to know what each column relates to.

 Click on the Page Layout tab. Within the Page Setup group, click on the Print
Titles icon, as illustrated.

 This will display the Page Setup dialog box.


Excel Intermediate Page 123

 If necessary move the dialog box so that you can see the title row within the
worksheet.

TIP: To move a dialog box, click on the Title Bar at the top of the dialog box and
while pressing the mouse button, drag with the mouse. When you release the
mouse button the dialog box will have moved.

 Click in the Rows to repeat at top box, within the dialog box.
Excel Intermediate Page 124

 Click within the top row on the worksheet and your dialog box will look like this.

 Click on the OK button to close the dialog box.

 Press Ctrl+F2 to see the worksheet in Print Preview view. As you would expect
the title row is displayed across the top of the data.
Excel Intermediate Page 125

 Click on the Next Page arrow button, displayed at the bottom-centre of the page
to view the second page.

 You can see the second page also displays a title row at the top of the data.

TIP: You can use the same technique the repeat both rows and columns on
every page.

 Press Esc to exit from Print Preview view.

To view printing options


 Open a workbook called Printing options 3.
 Click on the File Tab and then click on the Print side tab.
Excel Intermediate Page 126

TIP: The keyboard shortcut to display the Print options is Ctrl+P.

The Printer and Setting page is displayed.

Selecting which pages to print


 Within the Pages section of the printer options, enter your starting and finishing
pages to be printed.
Excel Intermediate Page 127

Page orientation
 Within the Printer section of the printer options, click on the down arrow next to
the Printer Orientation section.

 Select the required option.


Excel Intermediate Page 128

Paper size
 Within the Printer section of the printer options, click on the down arrow next to
the Paper Size section.

 Select the required page size.

Margins
 Within the Printer section of the printer options, click on the down arrow next to
the margins section.
Excel Intermediate Page 129

 Select the required margin sizes.

 If you wish to set custom sized margins, click on the Custom Margins option.
This will display the Margins tab within the Page Setup dialog box.
Excel Intermediate Page 130

 You can enter custom sized margins as required.

Scaling
 Within the Printer section of the printer options, click on the down arrow next to
the scaling section.
Excel Intermediate Page 131

 Select the required option from the list displayed.

NOTE: You can click on the Custom Scaling Options link to display more
options.

Printing
 To print a document using the settings you have selected click on the Print
button.
Excel Intermediate Page 132

 Close any open documents, saving any changes that you have made and close
the Excel program.

You might also like