Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this...

175
WWP Learning and Development Ltd Page 1 MICROSOFT EXCEL VERSION 2007 & 2010 LEVEL 4

Transcript of Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this...

Page 1: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

WWP Learning and Development Ltd Page 1

MICROSOFT EXCEL VERSION 2007 & 2010

LEVEL 4

Page 2: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

WWP Learning and Development Ltd Page 2

NOTE

Unless otherwise stated, screenshots in this book were taken using Excel 2007 with a blue colour scheme and running on Windows Vista. There may, therefore, be minor visual differences if you are using a different colour scheme, using Excel 2010, or if you are running on a different version of Windows.

Separate screenshots and instructions are given where there is a significant difference between the versions or the operating systems.

In all other cases concepts, discussions, procedures and functionality are the same.

Page 3: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

WWP Learning and Development Ltd Page 3

CONTENTS

NOTE ................................................................................................................................................................2

CONTENTS .....................................................................................................................................................3

LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS.....................................7

Concept and Terms .....................................................................................................................................8 The Index Function ......................................................................................................................................8 The array form .............................................................................................................................................8 The reference form.......................................................................................................................................9 The Match Function...................................................................................................................................12 Match Type .................................................................................................................................................13 Examples for Combining Index and Match ...........................................................................................16 The Countif Function ................................................................................................................................17 The Countifs Function ..............................................................................................................................18 The Sumif Function ...................................................................................................................................21 The SumIfs Function .................................................................................................................................23 Exercise .......................................................................................................................................................26

Using Index and Match ........................................................................................................................................... 26 Using CountIf and SumIf ........................................................................................................................................ 26

LESSON 2 – WORKING WITH DATE FUNCTIONS ..........................................................................27

Concepts and Terms ..................................................................................................................................28 Exercise .......................................................................................................................................................31

To practice working with date formulas and functions. .......................................................................................... 31

LESSON 3 - EXPORTING AND IMPORTING DATA .........................................................................32

Exporting Data - Concept and Terms .....................................................................................................33 Database applications ...............................................................................................................................33 Text files ......................................................................................................................................................34 Importing Data ...........................................................................................................................................37 Importing Data From Text Files ..............................................................................................................38 Changing External Data Range Properties ............................................................................................40 Importing Data From Access ...................................................................................................................41 Importing Data from Other Sources .......................................................................................................42 Removing The Query Definition .............................................................................................................46 Importing Dynamic Data From The Web ..............................................................................................46 Exercise .......................................................................................................................................................50

Exporting and Importing Data ................................................................................................................................ 50

LESSON 4 - USING SCENARIOS AND GOAL SEEKING .................................................................51

Concepts and Terms ..................................................................................................................................52 Using Scenarios ..........................................................................................................................................52 Showing a scenario ....................................................................................................................................54 Deleting a scenario ....................................................................................................................................54 Editing A Scenario .....................................................................................................................................55 Creating A Scenario Summary Report ...................................................................................................56 Merging Scenarios .....................................................................................................................................57 Using Goal Seek .........................................................................................................................................59 Exercise .......................................................................................................................................................61

Use the Scenario Manager and Goal Seek to project sales. ...................................................................................... 61

LESSON 5 - SOLVING PROBLEMS ........................................................................................................62

Page 4: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Contents

WWP Learning and Development Ltd Page 4

Concepts and Terms ..................................................................................................................................63 Installing solver ..........................................................................................................................................63 Using Solver ...............................................................................................................................................64 Saving A Solution As A Scenario ............................................................................................................67 Changing A Solver Constraint .................................................................................................................68 Creating A Solver Report .........................................................................................................................69 Exercise .......................................................................................................................................................71

Use Solver with constraints ..................................................................................................................................... 71

LESSON 6 - USING DATA TABLES ........................................................................................................72

Concepts and Terms ..................................................................................................................................73 Creating A One-Variable Table ...............................................................................................................74 Two-Variable Data Tables ........................................................................................................................75 Exercise .......................................................................................................................................................77

Create one-variable and two-variable data tables. .................................................................................................... 77

LESSON 7 - WORKSHEET CONTROLS ................................................................................................78

Concepts and Terms ..................................................................................................................................79 Excel 2007 ....................................................................................................................................................79 Excel 2010 ....................................................................................................................................................80 Creating A Check BoxControl .................................................................................................................81 Manipulating Controls ..............................................................................................................................82 Selecting a Control .....................................................................................................................................82 Moving A Control .....................................................................................................................................82 Resizing a Control .....................................................................................................................................82 Deleting a Control .....................................................................................................................................83 Formatting A Control ................................................................................................................................83 Creating A List Box ...................................................................................................................................84 Formatting A List Box ...............................................................................................................................85 Creating Option Buttons ...........................................................................................................................86 Formatting An Option Button Group .....................................................................................................87 Creating A Spinner ....................................................................................................................................88 Formatting A Spinner ...............................................................................................................................89 Creating A Combo Box .............................................................................................................................90 Formatting A Combo Box .........................................................................................................................91 Completing the Worksheet ......................................................................................................................92 Exercise .......................................................................................................................................................94

To create a workbook which uses worksheet controls for entering data. .................................................................. 94

LESSON 8 - WORKING WITH TEMPLATES ........................................................................................95

Concepts and Terms ..................................................................................................................................96 Creating a Custom Template ...................................................................................................................97 Where are Custom Templates Stored? ...................................................................................................99 Using a Custom Template ......................................................................................................................103 Editing a Template ..................................................................................................................................104 Inserting A New Worksheet ..................................................................................................................105 Deleting Custom Templates ...................................................................................................................106 Creating Default Templates ...................................................................................................................108 Exercise .....................................................................................................................................................110

Create and use templates........................................................................................................................................ 110

LESSON 9 - USING MACROS ................................................................................................................111

Concepts and Terms ................................................................................................................................112 Opening A Workbook Containing Macros ..........................................................................................112

Page 5: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Contents

WWP Learning and Development Ltd Page 5

Excel 2007 ..................................................................................................................................................112 Excel 2010 ..................................................................................................................................................112 Running A Macro ....................................................................................................................................114 Exercise .....................................................................................................................................................117

Use macros in a workbook. ..................................................................................................................................... 117

LESSON 10 – RECORDING MACROS .................................................................................................118

Concepts and Terms ................................................................................................................................119 Recording a macro ...................................................................................................................................119 Using Relative References to Record a Macro .....................................................................................121 Deleting A Macro .....................................................................................................................................122 Assigning Shortcut Keys to Macros ......................................................................................................123 Assigning A Macro To The Quick Access Toolbar .............................................................................124 Removing A Custom Macro Button ......................................................................................................126 Creating a Worksheet Button to Run a Macro .....................................................................................127 Copying A Macro Button .......................................................................................................................128 Formatting A Macro Button ...................................................................................................................129 Moving/Sizing A Macro Button ...........................................................................................................130 Deleting A Worksheet Button ................................................................................................................131 Exercise .....................................................................................................................................................132

Recording macros. .................................................................................................................................................. 132 Create and work with macro buttons on a worksheet ............................................................................................ 132

APPENDIX A - USING SHARED WORKBOOKS ..............................................................................134

Concepts and Terms ................................................................................................................................135 Saving A Shared Workbook ...................................................................................................................135 Viewing Users Sharing A Workbook ....................................................................................................137 Viewing Shared Workbook Changes ....................................................................................................138 Changing Sharing Options .....................................................................................................................139 Managing Conflict Changes ...................................................................................................................140 Setting The Change History Options ....................................................................................................141 Cell Comments .........................................................................................................................................142 Adding A History Worksheet ................................................................................................................143 Reviewing Tracked Changes .................................................................................................................145 Remove a Workbook from Being Shared .............................................................................................146 Exercise .....................................................................................................................................................147

Share workbooks. .................................................................................................................................................... 147

APPENDIX B - CUSTOMISING EXCEL PREFERENCES ..................................................................148

Concepts and Terms ................................................................................................................................149 Excel Display Options .............................................................................................................................150 Excel Formula Options ...........................................................................................................................153 The Editing Options ................................................................................................................................155 Exercise .....................................................................................................................................................157

Customise Excel preferences. ................................................................................................................................. 157

APPENDIX C - THE WEB, HTML, PDF, XPS & XML FILE FORMATS ..........................................158

Concepts and Terms ................................................................................................................................159 Creating A Hyperlink .............................................................................................................................161 Adding a ScreenTip .................................................................................................................................162 Removing a hyperlink.............................................................................................................................163 Saving A Worksheet As A Web Page ...................................................................................................163 Using The Publishing Options ...............................................................................................................165 Opening an HTML File ...........................................................................................................................166

Page 6: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Contents

WWP Learning and Development Ltd Page 6

Saving as PDF or XPS ..............................................................................................................................167 Portable Document Format (PDF) .........................................................................................................168 XML Paper Specification (XPS)..............................................................................................................168 Make changes to a PDF or XPS file .......................................................................................................170 Exporting to Xml ......................................................................................................................................171 Exercise .....................................................................................................................................................173

Save and view worksheet ranges as web pages. ...................................................................................................... 173

INDEX ...........................................................................................................................................................174

Page 7: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

WWP Learning and Development Ltd Page 7

LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS

In this lesson, you will learn how to:

• Use the Index Function

• Use Match Function

• Use the Countif Function

• Use the SumIF Function

Page 8: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Advanced Lookup & Aggregation Functions

WWP Learning and Development Ltd Page 8

CONCEPT AND TERMS

Discussion In Excel, there are many functions designed to carry out tasks on tables of data. Some, like the database functions (see Excel Level 3) carry out calculations on a data table based on criteria that you provide. Others, like the text functions can manipulate data into a more useable form (eg. imported data that often needs cleaning up by removing redundant spaces, splitting up into separate columns, joining into a single cell, or converting from text to “proper” numbers and/or dates).

There is also a “family” of functions that fall under the Lookup and Reference category. These are designed to identify and/or refer to individual pieces of data in a table or list (eg. Vlookup, Hlookup, Offset, Indirect, etc.), or that provide information about a cell (eg. Row, Columns, Address, etc.).

The Index and Match functions are part of the Lookup and Reference category. Similarly to Vlookup and Hlookup, they are designed to find information in a table or list of data but can be more powerful under certain circumstances and made to extract the required information when Vlookup and Hlookup are unsuitable.

THE INDEX FUNCTION

Discussion In simple terms, the Index function extracts a piece of data that is at the intersection of a row and a column in a table or list. Relate it to a map where you are looking for a street that the index states is on page 69, row 2, column B; you go to the page, look across row 2 and down column B and the street will be found in the square where they meet.

The INDEX function has two forms: array and reference.

The array form

This is the more commonly used form of the Index function and is designed to return a value from where a row and a column meet where there is a single list or table selected. It has three arguments:

=INDEX ( array , row_num , column_num)

The array is the range for the table or list and row_numandcolumn_num are the row and column numbers of the table that you want the function to return what is at the intersection of. In the example below, we want to know how many people there are in Meeting Room C on 5 April.

Page 9: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Advanced Lookup & Aggregation Functions

WWP Learning and Development Ltd Page 9

The Index function could be used as follows: =INDEX ( B3:K8 , 3 , 5 )

This would return a value of 30 where B3:K8 is the table containing the occupancy data, 3 is the row of that table where Meeting Room C data can be found and column 5 where data for April the fifth can be found.

It is important to note two things when using the Index function:

1. The column number is not be confused with column letter. The Column_Num argument is always numeric.

2. Row_Num and Column_Num are the row and columns numbers of the array NOT the row and column numbers of the worksheet.

3. In the example below, the formula for finding how many people there are in Meeting Room C on 5 April still uses a Row_Num of 3 and a Column_Num of 4. The only thing to change is the array argument.

=INDEX ( D6:M11 , 3 , 5 )

The reference form

This is used to return a value from where a row and a column meet where there are multiple lists or tables to choose from. It takes four arguments:

=INDEX ( reference , row_num , column_num , area_num )

The reference is the multiple ranges that you want the formula to look in.

NB. It is important to separate the multiple ranges with commas and enter them inside brackets (see example below).

row_num and column_num are the row and column numbers of the table that you want the function to return what is at the intersection of.

Area_num is a numeric value indicating which of the ranges given in the reference argument the Index function must look at.

The example below contains three tables, one for April, one for May and one for June. To find how many people there are in Meeting Room C on 5 May when all three tables are given, the

Page 10: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Advanced Lookup & Aggregation Functions

WWP Learning and Development Ltd Page 10

reference form of the Index function would have to be used with the area_num argument set to 2. The function would be:

=INDEX((B3:K8,B13:K18,B23:K28),3,5,2)

This would return a value of 6 because that is what the Index function finds at the intersection of row 3 and column 5 in the second of the three ranges given.

Procedure (array form) 1. To determine the contents of the cell in the third row, fourth column of a single list,

first select the cell where the information is to be displayed. 2. Click the Formulas tab on the Ribbon. 3. Click the Lookup & Reference command in the Function Library group.

4. Select INDEX in the list of functions. 5. In the Select Arguments box, click on array, row_num, column_num.

Page 11: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Advanced Lookup & Aggregation Functions

WWP Learning and Development Ltd Page 11

6. Click the OK button. 7. In the Function Arguments dialog box, insert the range cell reference (or name) in

the Array box. 8. In the Row_num box, enter the number of the row where the data exists. 9. In the Column_num box, enter the number of the column where the data exists.

10. Click the OK button.

Procedure (reference form) 1. To determine the contents of the cell in the third row, fourth column of the second

table in a collection of multiple lists, first select the cell where the information is to be displayed.

2. Click the Formulas tab on the Ribbon. 3. Click the Lookup & Reference command in the Function Library group.

4. Select INDEX in the list of functions. 5. In the Select Arguments box, click on array, row_num, column_num.

Page 12: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Advanced Lookup & Aggregation Functions

WWP Learning and Development Ltd Page 12

6. Click the OK button. 7. In the Function Arguments dialog box, insert the multiple ranges in the Reference

box. The individual ranges must be separated by commas and typed inside brackets, eg. (B3:K8,B13:K18,B23:K28). NB Do not be misled by the #VALUE! error; the reference is correct!

8. In the Row_num box, enter the number of the row where the data exists. 9. In the Column_num box, enter the number of the column where the data exists. 10. In the Area_num box enter the index number of the table given in Reference where

the data exists. Index numbers equate to the order that the individual tables or lists have been entered in the Reference argument. So in the example above, B3:K8 would be 1; B13:K18 would be 2 and B23:K28 would be 3.

11. Click the OK button.

THE MATCH FUNCTION

Discussion In simple terms, the MATCH function finds the position of an item in a row or column.

On its own, Match is seldom used but it is a useful and powerful function to nest (combine) into other functions where a frequently arguments for the Match function are:

The Match function has three arguments:

=MATCH(Lookup_value,Lookup_array,Match_type)

• Lookup_value is the value you use to find the position of in the column or a row of a table.

• Lookup_array is the row or the column that you want the Lookup_value looked up in.

• Match_type - is the number -1, 0, or 1. The use of these numbers is explained fully in the examples below.

Page 13: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Advanced Lookup & Aggregation Functions

WWP Learning and Development Ltd Page 13

In the example below, we need to find the position of the word Francis in the Name column. A Match function could be used as follows:

=MATCH(“Francis” , A2:A16 , FALSE)

The result would be 4, because the word Francis is in the fourth position (or cell) in the range A2:A16).

Similarly:

=MATCH(“Area” , A1:G1 , FALSE) would return 5 because the word Area is in the fourth position (or cell) of the range A1 to G1.

The lookup value does not need to be entered directly into the formula, it can be written in a cell and the cell reference used in the function. The example below shows the Match function looking for the contents of cell B1 in the range A2 to A16. As above, the result would be 4.

Similarly, in the above example =MATCH ( B2 , A4:G4, FALSE) would return a result of 5.

Match Type

The Match_type argument fines tunes how the Match function looks for the result.

It can be set to three values

• 0 (or FALSE) – look for an exact match only. If one is not found #NA is returned ;

• 1 (or TRUE) – look for the lower value; or

• -1 (no equivalent text value) – looks for the higher value.

Page 14: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Advanced Lookup & Aggregation Functions

WWP Learning and Development Ltd Page 14

0 (or FALSE) is almost exclusively used when looking up text values, eg. Names, Codes, or alphabetic characters. It tells the Match function to find the lookup value exactly as spelled (not case sensitive). In the example above, FALSE is used for this reason. If the lookup value cannot be found in the list (the lookup array), Match will return #NA (not available).

In all cases where you want a Match function to look up precise text values use FALSE.

1 (or TRUE) is typically used in tables where the lookup value is a number that falls within a range.

Consider the example above, we need to know where in the Interest List Beale’s £2,350 falls. 2350 is not exactly in Interest List but falls between 0 and 5000. So, where does the Match function go to?

Well, if 0 (or FALSE) were used, the answer would be #NA, because 2350 is not EXACTLY in the list (the lookup array). By using 1 (or TRUE), however, the Match function would return 1, the nearest match to 2350 going UP the list (assuming the lookup array given to the Match function is E2 to E7).In other words, it forces Match always to return the position of the lower value that the lookup value falls in.

All Interest Bands equate to the position at the lower end of the range

that the Amount falls in

NB – For a match_type of 1 (or TRUE) to work correctly, the look_up array MUST be sorted in ascending order by the first column.

Match returns 1 because 0 is the nearest value to 2350 going UP the list

Page 15: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Advanced Lookup & Aggregation Functions

WWP Learning and Development Ltd Page 15

Like match_type1, -1 (no text equivalent) is typically used in tables where the lookup value is a number that falls within a range; the difference being that the list is sorted in a descending order.

The following example is similar to the one above but the Interest List (the lookup array) is sorted in a descending order. To extract the appropriate Interest Band this time, a match_type of -1 must be used.

The Match function this time would return 5 for Beal because 2350 falls between 0 and 5000 and as with a match_type of1 (or TRUE), the Match function is designed always to go to nearest value UP the table. Hence, it goes to 5000, which is in position 5.

Important – For a match_type of -1 to work correctly, the lookup_array MUST be sorted in descending order.

Procedure 1. To determine the position, within an array of data, of a particular item/value, first

select the cell where the result is to be displayed. 2. Click the Formulas tab. 3. Click the Lookup & Reference command in the Function Library group. 4. Select Match in the functions list. 5. In the Function Arguments dialog box, click in the Lookup_value box. 6. Insert the value to be found. 7. In the Lookup_array box, insert the array or range of cells containing the value to be

looked up. 8. In the Match_type box, insert the value to be used. 9. Click the OK button.

Page 16: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Advanced Lookup & Aggregation Functions

WWP Learning and Development Ltd Page 16

EXAMPLES FOR COMBINING INDEX AND MATCH

Discussion A drawback of the Vlookup and Hlookup functions is that their lookup_value must be in the first column (Vlookup) or the first row (Hlookup) of the table or list. By combining Index and Match, your lookup_value can be in any column or row of the table or list.

In the example below, we need to look up information about people using their Code. Because Code is not at the left of the table (and we cannot move it) we will have to combine Index and Match.

At a simpler level, Match is useful when nested in a Vlookup function to make the entering of a column index number more flexible.

The example below allows us to use a Vlookup to find a person’s code (because it’s at the left of the table) but also allows us to enter a column heading which the match function will convert to the appropriate index number.

Page 17: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Advanced Lookup & Aggregation Functions

WWP Learning and Development Ltd Page 17

THE COUNTIF FUNCTION

Discussion The CountIF function allows you to count the number of cells within a given range based on the criteria that is set.

The syntax for a CountIF function is =COUNTIF(range,criteria)

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.

A common use for the CountIf function is counting the number of times that a word appears in a column of data. For example, in a list of names and addresses you may wish to count the number of times a particular town or city is repeated in a column and hence, the number of people living in that town or city.

Procedure 1. Click the cell where the result is to be displayed. 2. Click the Formulas tab. 3. In the Function Library group, click the More Functions command. 4. Select Statistical from the sub menu.

5. Click on Countif. 6. In the Function Arguments box, click in the Range box. 7. Insert the range where the count will take place. 8. In the Criteria box, enter the criteria you wish to count by.

Page 18: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Advanced Lookup & Aggregation Functions

WWP Learning and Development Ltd Page 18

9. Click the OK button.

Criteria can be expressed in various forms, such as:

• A constant text or numerical value, eg.100 or "apples" (text must be put in quote marks).

• A cell reference, eg. B20

• A conditional expression, eg. “>100”or “>B20” (must be put in quote marks).

• A calculation in a cell, eg. =20 * 10%, =B20 + B21, =AVERAGE(D3:D30).

For calculations entered directly into the Criteria argument, omit the = sign.

You can use the wildcard characters in the criteria - the question mark (?) and the asterisk. A question mark matches any single character; an asterisk matches any sequence of characters, eg.

• “Ma*” will count all cells that start with the letters ma, eg. Manchester, Macclesfield, Madagascar, etc.

• “??e*” will count all cells where the first two characters can be anything, the third character must be an e and subsequent characters (if any) can be anything, eg. Aberdeen, Sheffield, Great Yarmouth.

If you want to count an actual question mark or asterisk, type a tilde (~) preceding the character.

THE COUNTIFS FUNCTION

Discussion The long awaited function for counting the number of rows in a table based on multiple criteria finally arrived in Excel 2007. The CountIfs function can take up to 127 separate pairs of range and criteria.

The syntax for the CountIfs function is a follows:

=COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2]…)

NB: Each additional range must have the same number of rows and columns as the criteria_range1 argument otherwise you will get a #VALUE error.. The ranges, however, do not have to be adjacent to each other.

In the example below, we want to count the number of rows in the table where there is the word Marketing in the Department column and the letter M in the Status column.

Page 19: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Advanced Lookup & Aggregation Functions

WWP Learning and Development Ltd Page 19

To achieve this, we use a CountIfs functions where:

• criteria_range1 is the column where the word Marketing can be found.

• criteria1 is the word Marketing.

• criteria_range2 is the column where the letter M can be found.

• criteria2 is the letter M

Hence:

=COUNTIFS(C3:C17,"Marketing",F3:F17,"M")

…would return an answer of 4.

Procedure 1. Click the cell where the result is to be displayed. 2. Click the Formulas tab. 3. In the Function Library group, click the More Functions command. 4. Select Statistical from the sub menu.

Page 20: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Advanced Lookup & Aggregation Functions

WWP Learning and Development Ltd Page 20

5. Click on COUNTIFS. 6. In the Function Arguments box, click in the Criteria_range1 box. 7. Enter the range where the first set of criteria can be found. 8. In the Criteria1 box, enter the criteria you wish to count in Criteria_range1.

9. Click in the Criteria_range2 box. 10. Enter the range where the second set of criteria can be found. 11. In the Criteria2 box, enter the criteria you wish to count in Criteria_range2. 12. If necessary, continue adding sets of criteria range and corresponding criteria. 13. When done, click the OK button.

Criteria can be expressed in various forms, such as:

• A constant text or numerical value, eg.100 or "apples" (text must be put in quote marks).

• A cell reference, eg. B20

• A conditional expression, eg. “>100” or “>B20” (must be put in quote marks).

• A calculation in a cell, eg. =20 * 10%, =B20 + B21, =AVERAGE(D3:D30).

For calculations entered directly into the Criteria argument, omit the = sign.

Page 21: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Advanced Lookup & Aggregation Functions

WWP Learning and Development Ltd Page 21

You can use the wildcard characters in the criteria - the question mark (?) and the asterisk. A question mark matches any single character; an asterisk matches any sequence of characters, eg.

• “Ma*” will count all cells that start with the letters ma, eg. Manchester, Macclesfield, Madagascar, etc.

• “??e*” will count all cells where the first two characters can be anything, the third character must be an e and subsequent characters (if any) can be anything, eg. Aberdeen, Sheffield, Great Yarmouth.

If you want to count an actual question mark or asterisk, type a tilde (~) preceding the character.

THE SUMIF FUNCTION

Discussion The SumIF function allows you add cells within a given range based on the criteria that is set.

The syntax for a SumIF function is SumIF(range,criteria, sum_range)

Range - is the range of cells that you want evaluated by criteria.

Criteria - is the criteria in the form of a number, expression, or text that defines which cells will be added.

Sum_range – the actual cells to add.

In similar vein to the CountIf function, the SumIf function looks for a criteria in one range and then sums a total for corresponding data in another range.

NB: It is necessary only to give the first cell of the Sum_range. Excel will automatically size it to the correct shape and size as the Range argument. Ranges and Sum_range do not have to be adjacent to one another.

The example below sums the total salaries for the Marketing department.

Page 22: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Advanced Lookup & Aggregation Functions

WWP Learning and Development Ltd Page 22

Procedure 1. Click the cell where the result is to be displayed. 2. Click the Formulas tab. 3. In the Function Library group, click the Math & Trig command.

4. Click on SUMIF. 5. In the Range box, enter the range where the criteria can be found. 6. In the Criteria box, enter the criteria you want to sum by. 7. In the Sum_range box, enter the first cell containing the data that you want to sum

up.

8. Click the OK button.

Criteria can be expressed in various forms, such as:

• A constant text or numerical value, eg. 100 or "apples" (text must be put in quote marks).

• A cell reference, eg. B20

• A conditional expression, eg. “>100” or “>B20” (must be put in quote marks).

• A calculation in a cell, eg. =20 * 10%, =B20 + B21, =AVERAGE(D3:D30).

Page 23: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Advanced Lookup & Aggregation Functions

WWP Learning and Development Ltd Page 23

For calculations entered directly into the Criteria argument, omit the = sign.

You can use the wildcard characters in the criteria - the question mark (?) and the asterisk. A question mark matches any single character; an asterisk matches any sequence of characters, eg.

• “Ma*” will count all cells that start with the letters ma, eg. Manchester, Macclesfield, Madagascar, etc.

• “??e*” will count all cells where the first two characters can be anything, the third character must be an e and subsequent characters (if any) can be anything, eg. Aberdeen, Sheffield, Great Yarmouth.

If you want to count an actual question mark or asterisk, type a tilde (~) preceding the character.

THE SUMIFS FUNCTION

Discussion As with CountIfs, SumIfs sums up data in a range based on multiple criteria in other ranges.

The syntax of the SumIfs function is:

=SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)

Note that sum_range is the first argument in the SumIfs function unlike the SumIf function where it comes last.

NB: Unlike the range and criteria arguments in the SUMIF function, in the SUMIFS function each criteria_range argument must contain the same number of rows and columns as the sum_range argument. In other words, you must give the full range for all arguments, not just the first cell.

In the example below, we want to count the total salaries paid to males in the Marketing department.

Procedure 1. Click the cell where the result is to be displayed. 2. Click the Formulas tab.

Page 24: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Advanced Lookup & Aggregation Functions

WWP Learning and Development Ltd Page 24

3. In the Function Library group, click the Math & Trig command.

4. Click on SUMIFS. 5. In the Function Arguments box, click in the Sum_range box.

6. Enter the range containing the cells that you want to sum up. 7. In the Criteria_range1 box, enter the range where the first set of criteria can be found

to sum up by. 8. In the Criteria1 box enter the criteria forCriteria-range1. 9. Continue adding criteria ranges and criteria for up to 127 sets. 10. Click the OK button.

Page 25: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Advanced Lookup & Aggregation Functions

WWP Learning and Development Ltd Page 25

Page 26: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Advanced Lookup & Aggregation Functions

WWP Learning and Development Ltd Page 26

EXERCISE

Using Index and Match

1. Open the file Functions Practice. 2. Open the Exam sheet if necessary. 3. Use the range, E4:E9 and a MATCH function to award the correct Merit Grade to

Angie (should be 3). 4. Copy down the formula to award Merit Grades to all the other students. 5. On the Room Bookings sheet of the workbook, create an INDEX function in cell B16 to

calculate the occupancy for whichever room number and date are entered into cells B13 and B14 (should be 80).

6. Change the room number to 4 and the date to 3. The formula should recalculate to 40.

7. Change cell B11 to 75, the formula should recalculate to Langley.

Using CountIf and SumIf

1. Open the Stock sheet, 2. Use the SUMIF function to calculate the necessary totals in cell E15 to E17. 3. Use the COUNTIF function to arrive at the figures required in cells E21 to E23. 4. Save and close the file

Page 27: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

WWP Learning and Development Ltd Page 27

LESSON 2 – WORKING WITH DATE FUNCTIONS

In this lesson, you will learn how to:

• Calculate and manipulate dates

Page 28: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Working with Date Functions

WWP Learning and Development Ltd Page 28

CONCEPTS AND TERMS

Discussion When you enter a date into a cell, Excel formats the date and stores it as the serial number that represents that date on the calendar. Excel treats dates as numbers so that it can perform calculations on them, such as determining how many days a bill is past due.

You can either type a specific date into a worksheet or use a date function to enter a date. The date function is often used when the year, day, and month information already exist in separate cells in the worksheet.

Excel also provides a date function that inserts the current date as a field that automatically updates each time you open the workbook.

The most commonly used date functions are described in the following table:

Function Description

=TODAY()

Displays the current date in a date format.

This function does not use arguments.

If you format a cell containing this function to a General style, it will display the date as a whole number (integer). Day 1 was 01/01/1900.

=NOW()

Displays the current date and time in a date format.

This function does not use arguments.

If you format a cell containing this function to a General style, it will display the date as a whole number and the time as a decimal fraction of the day. Eg. midnight is 0.00, noon is 0.50 and 6pm is 0.75.

=DATE(year,month,day)

Can be used to combine separate cells containing day, month and year into one complete date.

You enter the number of the month, day, and year as the arguments. You can also reference cell addresses, if one or more arguments are stored in a cell. Eg.

= DATE(2010,11,19) returns 19/11/2010

=DAY(serial_number)

Displays the day that a date falls on. Useful for splitting whole dates into their component parts Eg.

Assuming cell A1 contains the date 19/11/2010,

=DAY(A1) returns 19.

=MONTH(serial_number) Displays the month that a date falls on. Useful for splitting whole dates into their component

Page 29: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Working with Date Functions

WWP Learning and Development Ltd Page 29

parts Eg.

Assuming cell A1 contains the date 19/11/2010,

=MONTH(A1) returns 11.

=YEAR(serial_number)

Displays the year that a date falls on. Useful for splitting whole dates into their component parts Eg.

Assuming cell A1 contains the date 19/11/2010,

=YEAR(A1) returns 2010.

= NETWORKDAYS (start_date,end_date,holidays)

Returns the number of whole working days between start_date and end_date.

Working days exclude weekends and any dates identified in holidays. The holidays argument is normally a range in the workbook containing a list of Bank Holiday dates for the time period in question.

Procedure 1. To use a date function, first select the cell where you want to insert the function. 2. Click the Formulas tab. 3. Click the Date and Time command in the Function Library group.

4. Select the date function that you wish to use. 5. In the Function Arguments dialog box, enter the required information.

Page 30: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Working with Date Functions

WWP Learning and Development Ltd Page 30

6. Click the OK button.

Page 31: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Working with Date Functions

WWP Learning and Development Ltd Page 31

EXERCISE

To practice working with date formulas and functions.

1. Open the file, Functions Practice. 2. Open the Invoice sheet. 3. Create formulas to calculate the Days Since Invoiced. 4. Create an additional column named Payments Deadline to show if

payments are overdue (Tip: subtract Days Since Invoice from Terms in Days).

5. Open the Staff sheet. 6. Type a function into cell B8 to automatically show the current date. 7. Use cell B8 in a formula to calculate the Years’ Service for each

employee. Format the numbers to one decimal place. 8. Save and close the file.

Page 32: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

WWP Learning and Development Ltd Page 32

LESSON 3 - EXPORTING AND IMPORTING DATA

• In this lesson, you will learn how to:

• Export data to other applications

• Export to XML

• Import data

• Import data from text files

• Change external data range properties

• Import data from other applications

• Remove the query definition

• Import dynamic data from the Web

Page 33: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Exporting and Importing Data

WWP Learning and Development Ltd Page 33

EXPORTING DATA - CONCEPT AND TERMS

Discussion Microsoft Excel can export data to many other applications. It does this by enabling you to save files in formats that can be recognised by the receiving applications. Excel can save files in formats of older versions of Excel. It can also save files in text formats, or in formats recognized by various non-Microsoft spreadsheet and database programs.

Database applications

If you are exporting data for use in a database application, you should remove any worksheet titles or other extraneous text. Row 1 of the worksheet you are exporting should start with the field names; or, if you are excluding field names, the first record of field data.

Data suitable for exporting easily to an external database

Data NOT suitable for exporting easily to an external database

Page 34: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Exporting and Importing Data

WWP Learning and Development Ltd Page 34

Text files

A text file is a format for exporting data to other applications. Think of it as a common language that most applications can understand.

A text file is typically used to export data to another spreadsheet or database application that is not listed in the Excel Save as type: list.

The most popular text file type is “comma delimited” although Excel can also save them as “tab delimited” or “space delimited”. Basically, the Excel spreadsheet is saved with commas (or tabs, or spaces) separating each column and a line break (a hard return) separating each row. The host application then simply converts the commas (or tabs or spaces) back to columns and the line breaks back to rows to create tables of its own that it can use.

Example of a comma separated text file

Excel can only save a single worksheet at a time as a text file. Therefore, if your workbook contains multiple sheets, you will have to save as a text file each sheet separately. The following message will appear if you try to save a multiple sheet workbook as a text file. The

Page 35: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Exporting and Importing Data

WWP Learning and Development Ltd Page 35

correct response is to click OK and then repeat the process for all other sheets containing data that you want to export.

Text files cannot save “features” either. This includes all types of formatting, charts, Pivot Tables and graphic objects. The following message appears when you try to save as a text file. The correct response is to click Yes.

Not saving formatting and features is not a problem, because the purpose of exporting data to another application is to use that application’s functionality to analyse and manipulate the raw data. Excel features and formatting are irrelevant for that purpose and anyway, the host application will usually have similar (or better) features available.

Because of the limitations of text files and advances in programming, especially with regards to Web integration, a new file exchange format has been developed known as XML (Extensible Markup Language). For further information on XML, refer to Appendix A on page 174).

Procedure 1. Click the Office button (Excel 2007) or the File tab (Excel 2010). 2. Click Save As. 3. Select a location to save the file to; this will vary depending on which version of

Windows you are using. 4. Enter a name for the file. 5. Select the format for the file in the Save as type: drop down list. 6. Click OK.

Page 36: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Exporting and Importing Data

WWP Learning and Development Ltd Page 36

Saving as comma separated values(CSV) in Windows XP

Saving as comma separated values (CSV) in Windows Vista

Page 37: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Exporting and Importing Data

WWP Learning and Development Ltd Page 37

Saving as comma separated values (CSV) in Windows 7

IMPORTING DATA

Discussion Excel has the capability to retrieve (import) data from external sources into a worksheet. For example, Excel can use data from mainframe databases or from other applications such as Microsoft Access. It can also use data that has been created or saved in a text file format or data from a web site. Once the external data is imported into a worksheet, you can use Excel’s comprehensive analysis tools to analyse the data. By retrieving or importing the data from another source, you save the time it would take to retype the information into the worksheet.

When you retrieve data from an external source, you define the data you want to import by selecting the original data source and the types of data (fields) you want to import. This combined data is the query definition, which is saved in the worksheet. The query definition links the imported data to its original source. You can break the link between the imported data and its source data at any time.

After importing the data, you can use the shortcut menu or the Data ribbon to refresh the data range, edit the text import or query, or change the properties of the data range.

You can refresh external data by right-clicking any cell in the imported data range and then selecting the Refresh command. You can also use the Refresh button on the Data ribbon to refresh the data range or the Refresh All button to refresh all imported data ranges in the workbook.

By default, external data will be imported into the worksheet into newly inserted cells. Existing data in the worksheet that falls within this range will be shifted to the right. You should save an existing workbook before you import external data, since you cannot use the Undo feature to reverse the action.

Page 38: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Exporting and Importing Data

WWP Learning and Development Ltd Page 38

Importing Data From Text Files

Excel can import data saved in a text file format directly into a worksheet. The text file format is commonly used when data is exported from mainframes and other database applications.

Database information contains field names and field data. When that information is exported to a text file, the fields must be separated, or delimited. The characters that separate fields are known as delimiters. Common delimiters include tabs, commas, or spaces. When working with text-formatted data, Excel can import files containing the following formats: Text (tab delimited - .txt), CSV (comma delimited - .csv), or Formatted Text (space delimited - .prn).

You use the Text Import Wizard to convert the text data and place it in the proper cells in the worksheet. When importing delimited data, the Text Import Wizard displays the data in columns and enables you to format each column or prevent selected columns from being imported. When importing fixed width data, you can adjust the width of the columns before placing them in the worksheet.

To import comma (.csv) or space (.prn) delimited files, you need to select All Files from the Files of type list in the Select Data Source dialog box.

Procedure 1. To import data from a text file, first select the worksheet into which you intend to

import the data. 2. Click the Data tab. 3. In the Connections group, click the Get External Data button. 4. Click on From Text. 5. In the Import Text File dialog box, locate and select the file you want to import. 6. Click the Import button. 7. In the first page of the Text Import Wizard, select the options you want. 8. Click the Next button. 9. In the second page of the Wizard, select the appropriate delimiter. 10. Click the Next button. 11. In the third page of the Wizard, select each column in turn in order to specify the

data held in that column. 12. Click the Finish button. 13. In the Import Data dialog box, indicate the location for the data. 14. Click the OK button.

Page 39: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Exporting and Importing Data

WWP Learning and Development Ltd Page 39

Page 40: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Exporting and Importing Data

WWP Learning and Development Ltd Page 40

CHANGING EXTERNAL DATA RANGE PROPERTIES

Discussion You can change the properties of an external data range before or after you import it. Some properties are important to change before the data is imported, such as whether the data should be inserted as new cells or whether it should overwrite existing data. Other elements can be changed at a later time without consequence.

By default, an external data range only refreshes when you manually refresh the link. You can set the link to automatically refresh each time you open the workbook. In addition, you can set the link to refresh after a specified time interval.

Excel provides a variety of options you may want to set when you initially import or refresh the data. If you have formatted the imported data, you may want to disable the option that automatically resets column widths and enable the option that maintains the current cell formatting.

If the amount of data in the external source changes after it has been imported, you can select how you want the imported data to refresh. Excel provides options to insert either cells or rows to accommodate additional data, as well as an option to overwrite data in existing cells.

If you have added columns for data analysis or calculation to the right of the imported range, you can have Excel automatically fill in the formulas for adjacent columns whenever you refresh the data.

You can open the External Data Range Properties dialog box before you import a range by selecting the Properties button in the Import Data dialog box. The Import Data dialog box opens as the last step in importing data.

Page 41: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Exporting and Importing Data

WWP Learning and Development Ltd Page 41

Procedure 1. To change external data range properties in Excel, with the right mouse button, click

on any cell within the imported range.

Excel 2007 Excel 2010

2. In the menu, click on Data Range Properties… 3. In the External Data Range Properties dialog box:

• select or deselect options under Refresh control as desired;

• select or deselect options under Data formatting and layout as desired;

• click the OK button.

IMPORTING DATA FROM ACCESS

Discussion You may want to work with Access data in an Excel workbook in order to take advantage of Excel’s data analysis and charting features, the flexibility in data arrangement and layout, or the many functions that are not available in Access.

To bring data into Excel from Access, you can copy the data from an Access datasheet and paste it into an Excel worksheet, connect to an Access database from an Excel worksheet, or export data into an Excel worksheet from Access.

The method described below shows how to use the Excel Data tab on the Ribbon to import Access data with a link back to Access so that if the data changes in the Access table or query, the imported data can be updated too (refreshed). For other methods, see Excel or Access Help.

To bring Access data that can be refreshed into Excel, you can create a connection, often stored in an Office Data Connection file (.odc), to the Access database and then retrieve all of the data from a table or query. The main benefit of connecting to Access data instead of importing it is that you can periodically analyze this data in Excel without repeatedly copying or exporting the data from Access. After you connect to the data, you can also automatically refresh (or update) your Excel workbooks from the original Access database whenever the database is updated with new information. For example, you may want to

Page 42: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Exporting and Importing Data

WWP Learning and Development Ltd Page 42

update an Excel summary budget report that you distribute every month so that it contains the current month's data.

Procedure 1. Click the cell where you want to put the data from the Access database. 2. On the Data tab, in the Get External Data group, click From Access.

3. Locate and double-click the Access database that you want to import. 4. In the Select Table dialog box, click the table or query that you want to import, and

then click OK. 5. In the Import Data dialog box, do the following:

• Under Select how you want to view this data in your workbook, do one of the following:

o To view the data as a table, select Table.

o To view the data as a Pivot Table, select PivotTable report.

o To view the data as a PivotChart and PivotTable report, select PivotChart and PivotTable report.

Optionally, click Properties to set refresh, formatting, and layout options for the imported data, and then click OK.

• Under Where do you want to put the data? do one of the following:

o To return the data to the location that you selected, click Existing worksheet.

o To return the data to the upper-left corner of the new worksheet, click New worksheet.

6. Click OK. Excel puts the external data range in the location that you specify

IMPORTING DATA FROM OTHER SOURCES

Discussion You can use Microsoft Query to import information from many database applications.

Page 43: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Exporting and Importing Data

WWP Learning and Development Ltd Page 43

The Query Wizard, part of Microsoft Query, guides you through the steps to create a query and is opened using the From Other Sources command in the Get External Data group on the Data ribbon.

This method is helpful when you create a query if you are new to the process, or if you only need to create a simple query using a single table. For more complex queries, you can work directly with Microsoft Query (search for query in Excel Help for more details).

Using the Query Wizard, you select the database file, table, and fields from which you will import the data; create any desired filter criteria; select the desired fields in which to sort the data; and finally, place the data in a specific location in the worksheet.

You can use the Save Query button on the last page of the Query Wizard to save the query to a query file (.dqy).This file can then be opened and run in Excel or Microsoft Query. By default, the query is saved with the workbook.

You must use Microsoft Query if you wish to import data from a combination of tables in the database. You can run the Query Wizard and use the Choose Columns dialog box to select fields from more than one table. When you select Next, the Query Wizard opens a Query window for you to create the relationships between tables. After joining the tables, you can select the File menu from the Microsoft Query menu bar and then the Return Data to Microsoft Excel command to insert the data into the worksheet.

You can create a connection to a new data source by selecting the New Data Source option and OK in the Choose Data Source dialog box. You can then name the data source, select the driver, and connect to the desired data source. By default, all tables are available, but you can select to connect to only one table.

Page 44: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Exporting and Importing Data

WWP Learning and Development Ltd Page 44

Procedure 1. To create a database query, first select the Data tab. 2. Click the From Other Sources command.

3. Click on From Microsoft Query. 4. Click the name of the data source you want to use. 5. Ensure there is a tick against Use the Query Wizard to create/edit queries. 6. Click the OK button. 7. In the Select Database dialog box, locate and select the database containing the data

you want. 8. Click the OK button. 9. In the Query Wizard select the columns to use by clicking the + in the Available

tables and columns window. 10. Select the fields to be used, in turn, and click the > button to include them in the

query. 11. Click the Next button. 12. In the next page of the Query Wizard, set any criteria for filtering. 13. Click the Next button. 14. Set up any sort order you want. 15. Click the Next button. 16. Click the Save Query… button. 17. Type a name and click the Save button. 18. To return the data to Excel, click the Finish button. 19. In the Import Data dialog box, select the options you want. 20. Click the OK button.

Page 45: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Exporting and Importing Data

WWP Learning and Development Ltd Page 45

Page 46: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Exporting and Importing Data

WWP Learning and Development Ltd Page 46

REMOVING THE QUERY DEFINITION

Discussion When you import data into a worksheet from an external source, you create a link to the original data source. The worksheet and the original data source are linked by the query definition, which is saved in the worksheet. You can break the link between the imported data and its source data at any time by removing the query definition from the worksheet.

Removing the query definition allows you to retain a permanent version of the data that cannot be refreshed and make modifications to the cells without the risk of the data being overwritten.

Procedure 1. To break the link between imported data and its source, click the Unlink button in

the External Table Data group. 2. In the Message box, click on OK to confirm the break in the link.

IMPORTING DYNAMIC DATA FROM THE WEB

Discussion Excel has the capability of importing data from a web page located on the Internet or an intranet site. You can retrieve a table from a web page to analyse its data with Excel’s analysis tools.

Page 47: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Exporting and Importing Data

WWP Learning and Development Ltd Page 47

You must have a browser installed to use the New Web Query dialog box to import data from a web page on the Internet or an intranet site. In addition, you must be able to connect to the Internet to import data from the World Wide Web.

When importing data from the Internet or an intranet site, Excel creates a refreshable link to the original data source.

Imported data can be static or dynamic. A static data source is one that does not normally change or need to be refreshed. However, you may want to refresh the data if you make changes to the imported data on the worksheet and want to return to the original data. Dynamic data, on the other hand, is usually in a constant state of change. Real-time data is the actual reported data with little delay. Stock market quotes and currency exchange rates on the Internet are examples of real-time data.

When importing tables using the New Web Query dialog box, each table on the web page appears with a small arrow icon located in its upper, left corner. These arrow icons enable you to select the table you want to import.

In addition to selecting one specific table, you can import all the tables on the web page or the web page itself by selecting multiple arrow icons. When importing XML data from a web page, you should use the Options… button on the toolbar to select the Full HTML formatting option in the Web Query Options dialog box.

You can use the Save Query button in the New Web Query dialog box to save the query to a query file (.iqy). This file can then be opened and run in another Excel workbook. By default, the query is saved with the workbook.

Page 48: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Exporting and Importing Data

WWP Learning and Development Ltd Page 48

Procedure 1. To import data using a Web Query, first select the worksheet into which you want

to insert the data. 2. In the Data ribbon, click the Get External Data button. 3. Click the From Web button. 4. In the New Web Query dialog box, type the web address of the web page

containing the data you want to import. 5. Click the Go button. 6. If necessary, click the Show Icons button on the toolbar to display the arrows. 7. Select the data to import. 8. Click the Options… button. 9. Select the desired options. 10. Click the OK button. 11. Click the Import button. 12. In the Import Data dialog box, specify where the data is to be imported. 13. If necessary, click the Properties… button to change external data range settings. 14. Click the OK button.

Page 49: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Exporting and Importing Data

WWP Learning and Development Ltd Page 49

Page 50: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Exporting and Importing Data

WWP Learning and Development Ltd Page 50

EXERCISE

Exporting and Importing Data

1. Open Imptex. 2. In the Sales worksheet, import the Salesdpt text file. 3. Select the comma as a delimiter. Do not import the Hire Date or Status

fields. (Hint: You need to skip each column separately.) Place the table starting in cell A6 in the worksheet.

4. On the Customers worksheet, import into cell A4, the Customers table from a Microsoft Access database named Wsgdata.

5. Open Products.htm from the Student data folder in your browser and copy the football products table.

6. Paste the table to cell B23 in the Equipment worksheet. 7. As soon as you have pasted, click the Paste Options button in the

bottom right of the pasted area and select Create Refreshable Web Query.

8. Confirm the table that you want to import by clicking the yellow arrow next to it in the New Web Query dialog box. Click Import.

9. Type Qty Price (100) in cell G23. Enter the formula =C24*100*0.45 in cell G24.

10. Change the external data properties to fill down formulas in adjacent rows and refresh the football table. Then, select cells F22:F29 and use the Format Painter to copy the format to cell G22:G29.

11. Remove the query definition from the data range. 12. Save the workbook as an XML data file to the student data folder with

the name Wsgxml. 13. Copy cells A4:D52 (excluding the contract date data) in the Customers

worksheet to cell A1 in the Credit Limits worksheet. 14. Export the Credit Limits worksheet as a tab delimited text file with the

name Lmtxport. 15. Close Lmtxport without saving the changes. 16. In Microsoft Word, open the Lmtxport text file to observe the text

format. 17. Close all open applications without saving any changes.

Page 51: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

WWP Learning and Development Ltd Page 51

LESSON 4 - USING SCENARIOS AND GOAL SEEKING

In this lesson, you will learn how to:

• Use the Scenario Manager

• Create a scenario

• Display a scenario

• Edit a scenario

• Create a scenario summary report

• Use Goal Seek

Page 52: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Scenarios and Goal Seek

WWP Learning and Development Ltd Page 52

CONCEPTS AND TERMS

Discussion The ability to perform a what-if analysis is one of the most powerful functions Excel provides. A what-if analysis allows you to substitute differing values and data in a worksheet so that you can compare various, possible outcomes.

Some of these come as Excel add-ins (programs to provide additional functionality) such as the Analysis Toolpack and Solver. Scenarios and Goal Seek are available as standard.

USING SCENARIOS

Discussion The Scenario Manager allows you to change quickly and easily, cell values on a spreadsheet in order to see the effect and create various outcomes, viz. “what-if analyses.”

With the Scenario Manager, you can create a variety of scenarios; in each scenario, the worksheet data is modified to produce a specific set of results. Different scenarios yield different results to enable you to speculate on a number of possible outcomes.

The first step in creating a scenario is to select the changing cells; changing cells store the data you want to replace in creating a what-if analysis.

Changing cells usually play a key part in the formula. You can define up to 32 changing cells per scenario. You can identify changing cells by their address or by a range name. Each changing cell in a scenario is then assigned a projected what-if value.

Once you have created a scenario, you can view it in the worksheet. Each scenario should be saved with a unique, descriptive name.

Once you have created a group of scenarios in a worksheet, you can then create a PivotTable report or a summary to compare them.

Each scenario displays the result of inputting a different set of values into the changing cells of a worksheet. You should give each scenario you create a unique, descriptive name.

You must also indicate the changing cells, which can be adjacent or non-adjacent. If you select the changing cells before you open the Scenario Manager, their addresses or names will appear in the Changing cells box by default. If preferred, you can select the changing cells from the Add Scenario dialog box as well.

With the use of Range names your scenarios values dialogue will display the cell names rather than an absolute cell reference making it easier to see the values you are changing.

It is a good idea to create a scenario for the original set of worksheet values, so that you can easily switch back to that display, as well as use the original values in scenario reports.

Procedure Creating a scenario

1. Click the Data tab.

Page 53: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Scenarios and Goal Seek

WWP Learning and Development Ltd Page 53

2. Click the What-If Analysis button in the Data Tools group. 3. Click the Scenario Manager command.

4. Click the Add… button.

5. In the Scenario name: box, type a name that identifies the scenario. 6. In the Changing cells: box, select or type the cells you want to modify in the

scenario. 7. In the Comments: box, type an explanatory note regarding that particular scenario. 8. Click the OK button.

9. In the Scenario Values box, type values for each of the displayed changing cells. 10. Click the OK button.

11. The Scenario Manager box now displays the scenario.

Page 54: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Scenarios and Goal Seek

WWP Learning and Development Ltd Page 54

12. Click the Close button.

Showing a scenario

1. To display a scenario, first click the Data tab. 2. Click the What-If Analysis button. 3. Click the Scenario Manager… button. 4. Select the scenario you want to display. 5. Click the Show button. 6. The chosen scenario data is now displayed. 7. Click the Close button.

Deleting a scenario

1. To delete a scenario, first click the Data tab. 2. Click the What-If Analysis button. 3. Click the Scenario Manager… button. 4. Select the scenario you want to delete. 5. Click the Delete button. 6. The chosen scenario data is deleted. 7. Click the Close button.

Page 55: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Scenarios and Goal Seek

WWP Learning and Development Ltd Page 55

EDITING A SCENARIO

Discussion You can edit any scenario you have created. You can change the values in the changing cells, or you can indicate different changing cells altogether.

Procedure 1. To edit values in a scenario, first click the Data tab. 2. In the Data Tools group, click the What-If analysis arrow. 3. Click on Scenario Manager… 4. Select the name of the scenario you want to edit in the Scenarios list box. 5. Click the Edit… button.

6. In the Edit Scenario dialog box, reselect the Changing cells that you want to edit, if

necessary.

7. Click the OK button. 8. In the Scenario Values dialog box, type a new value for the cell you want to change.

Page 56: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Scenarios and Goal Seek

WWP Learning and Development Ltd Page 56

9. Click the OK button. 10. To display the effect, click the Show button.

11. Click the Close button. 12. The effect for that scenario is now displayed.

CREATING A SCENARIO SUMMARY REPORT

Discussion You can create a scenario summary report, which lists all the scenarios you have created in a side-by-side format so that you can compare them.

When you create a scenario summary report, the Scenario Manager automatically inserts a Scenario Summary sheet in the workbook and places the report on it. This sheet allows you to easily view and print the scenario summary report.

A scenario summary report appears in an outline format.

Procedure 1. To create a scenario summary report, first click the Data tab. 2. Click the What-If Analysis button. 3. Click the Scenario Manager… button. 4. In the Scenario Manager dialog box, click the scenario you want to view.

Page 57: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Scenarios and Goal Seek

WWP Learning and Development Ltd Page 57

5. Click the Summary… button. 6. In the Scenario Summary dialog box, click the OK button.

7. A Scenario Summary worksheet is displayed with the report.

MERGING SCENARIOS

Discussion Scenarios can only be shown in the sheet that they were created. Sometimes, you may want to try out scenarios on a sheet, using values from the changing cells of scenarios on another sheet.

For example, you may have a different sheet for each country that you do business in (eg. UK, USA and Japan), each sheet with its own independent scenarios. A colleague asks to see what would happen if you try out the UK figures on the USA and Japan scenarios (Scenario

Page 58: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Scenarios and Goal Seek

WWP Learning and Development Ltd Page 58

Manager is, after all, a “what-if” tool).Too achieve this, you have to copy the scenarios from the UK sheet to the USA and Japan sheet, which you do by merging scenarios.

In simpler terms, merging scenarios is copying them from one sheet to another.

Procedure 1. Select the sheet that you want to merge the (copy) the scenarios to. 2. Click the Data tab. 3. Click the What-If Analysis button. 4. Click the Scenario Manager… button. 5. Click the Merge… button.

6. Select the sheet containing the scenarios that you want to merge (copy) from.

7. Click OK. The scenarios are merged into the sheet and can be shown as previously

described.

Page 59: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Scenarios and Goal Seek

WWP Learning and Development Ltd Page 59

If scenarios are merged into a sheet already containing scenarios with the same name, Excel uses the same name and adds the current date added to the end.

USING GOAL SEEK

Discussion Often a situation arises in which you know the value you want a formula to return, but not the values needed to arrive at that result. For example, you may want to borrow money to purchase a £4000 home entertainment system; you can afford to borrow the money at £150 per month for two years. You can use Goal Seek to determine the interest rate needed to meet your requirements.

When you use Goal Seek, Excel performs the time-consuming task of trial-and-error experimentation by changing the variable value until it arrives at the desired result.

In order to use Goal Seek, you must specify the following parameters:

Page 60: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Scenarios and Goal Seek

WWP Learning and Development Ltd Page 60

Parameters Description

Set cell The cell containing the formula

To value The value you want the formula to return

By changing cell The cell containing the value to be changed

Procedure 1. To use the Goal Seek tool, click the Data tab. 2. In the Data Tools group, click the What-If Analysis button. 3. In the list, click on Goal Seek… 4. Click in the Set Cell: box and type or select the cell you want to change. 5. Click in the To Value: box and type the result value you want. 6. Click in the By changing Cell: box and select, or type, the address of the cell you

want Excel to change. 7. Click the OK button. 8. In the Goal Seek Status dialog box, you can see the result and click the OK button.

Page 61: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Scenarios and Goal Seek

WWP Learning and Development Ltd Page 61

EXERCISE

Use the Scenario Manager and Goal Seek to project sales.

1. Open Repsales. 2. View the formula in cell C7. The projected Qtr 2 sale is calculated using

the Qtr 1 sales and a growth factor of 5% (cell D2). 3. Create a scenario named Low Sales. Make D2 the changing cell and

leave its value at 5%. 4. Create another scenario named High Sales. Enter 20% as the value of

D2 for this scenario. 5. Create a third scenario named Best Guess; make the value of D2 12%. 6. View each of the scenarios. 7. Edit the Best Guess scenario; make the changing cell value 10%. Then,

view the Best Guess scenario. 8. Create a scenario summary using the result cell C14. Then, display the

Scenario Summary worksheet. 9. Return to Sheet1 and use Goal Seek to determine the growth

percentage necessary in order for the Qtr2 sales to reach £500,000, using the Best Guess scenario.(Hint: Make sure you are showing the Best Guess scenario and then use cell D2 as the changing cell in the Goal Seek dialog box.). The result should be 14.4%.

10. Cancel the Goal Seek Status dialog box and then close the workbook without saving it.

Page 62: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

WWP Learning and Development Ltd Page 62

LESSON 5 - SOLVING PROBLEMS

In this lesson, you will learn how to:

• Use Solver

• Save a solution as a scenario

• Restore the original values

• Change a constraint

• Create a Solver report

• View solutions using scenarios

Page 63: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Solving Problems

WWP Learning and Development Ltd Page 63

CONCEPTS AND TERMS

Discussion Solver is a similar tool to Goal Seek and scenarios, but provides more options to restrict the range of values for different cells that can affect the result.

It allows you to solve problems by working backwards.

If you know the desired outcome, you can use Solver to find the variables that produce that result.

INSTALLING SOLVER

Discussion Solver is not part of the standard Excel application as normally installed, it is an Add-In (often referred to as a “plug-in.”).

Add-Ins are additional Excel components that are not commonly used and as a result, have to be installed on your computer. There are many third party (non-Microsoft) Add-Ins that help Excel do useful and clever things that it cannot normally do, or that enhance some of the things that it can do.

These can be found and downloaded from the Internet although it is wise to consult with your IT department first in case they have objections on grounds of security and computer software safety. It is unlikely that in the working environment you will be able to install these programs yourself anyway.

There are, however, a selection of Add-Ins that come with Excel and that are perfectly safe and suitable for use; one of these is Solver.

Procedure 1. Click the Office Button (Excel 2007) or the File tab (Excel 2010). 2. Click Excel Options. 3. Click Add-Ins at the left.

Page 64: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Solving Problems

WWP Learning and Development Ltd Page 64

4. Select Excel Add-ins from the Manage: list at the bottom of the dialog box. 5. Click Go…. 6. Click in box next to Solver Add-in.

7. Click OK.

USING SOLVER

Discussion You use Solver by selecting the Solver command from the Analysis group at the far right of the Data tab on the Ribbon.

Page 65: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Solving Problems

WWP Learning and Development Ltd Page 65

If there is no Analysis group on the Ribbon, see the previous section about installing Solver.

After you have entered all necessary information into the Solve Parameters dialog box, you can solve the problem. Solver tries various inputs until it reaches an answer that satisfies all the constraints and other criteria. Each try is called an iteration. If a solution is not found within a default number of iterations, a message box asks if you want to continue.

You can specify the following items in the Solver Parameters dialog box:

Parameter Description Set Target cell The cell containing the formula you want Solver to use

Equal To Whether to set the target cell to its maximum value, its minimum value, or a specified value

By Changing cells The variable cells that Solver can change in order to reach the desired target cell value

Subject to the Constraints

You can set constraints or limitations on the changing cells, the target cell, or other cells in the worksheet

You can continue to add constraints without closing the Add Constraint dialog box by selecting the Add button and entering the desired constraints. When you are finished, you can press the [Enter] key to close the Add Constraint dialog box.

Solver Parameters dialog box (Excel 2007)

Page 66: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Solving Problems

WWP Learning and Development Ltd Page 66

Solver Parameters dialog box (Excel 2010)

Procedure 1. To use Solver, first click the Data tab. 2. In the Analysis group, click the Solver button. 3. Select the target cell. 4. Set the Equal To: option to the one you require. 5. In the By Changing Cells: box, select, or type, the range of cells the solver must use

to compare against the target cell value. 6. Click the Add button. 7. In the Add Constraint dialog box, specify the first cell constraint. 8. If necessary, click on Add to specify more cell constraints.

9. Click the OK button. 8. In the Solver Parameters dialog box, click the Solve button. The Solver Results

dialog box opens with the results.

Page 67: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Solving Problems

WWP Learning and Development Ltd Page 67

Solver Results Window (Excel 2007)

Solver Results Window (Excel 2010)

10. Once Solver has found a solution, the suggested values are automatically inserted into the worksheet. You can keep the Solver values in the worksheet, or you can restore the original values. • To accept the solution, click Keep Solver Solution.

• To reject the solution, click Restore Original Values.

11. Click the OK button. If you choose to restore the original values, the Solver solution is lost, unless you have saved it as a scenario.

SAVING A SOLUTION AS A SCENARIO

Discussion Once Solver has arrived at a solution, you can view one of three available reports, restore the original values, or save the results as a scenario. Saving the results as a scenario allows you to view them at any later time; you can store the results of several solutions.

Procedure 1. To save a Solver solution as a scenario, first use Solver to solve the problem. 2. In the Solver Results dialog box, click the Save Scenario… button.

Page 68: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Solving Problems

WWP Learning and Development Ltd Page 68

3. In the Save Scenario dialog box, type a name for the scenario. 4. Click the OK button. 5. In the Solver Results dialog box, click the OK button. 6. Opening the Scenario Manager shows the saved Solver solution.

Excel 2007

Excel 2010 / Windows XP

CHANGING A SOLVER CONSTRAINT

Discussion Once you have used Solver in a worksheet, Excel retains the Solver settings. You can open the Solver Parameters dialog box and change those settings. This option allows you to change constraints and run Solver again.

Procedure 1. To run Solver with a different constraint, first click the Data tab. 2. In the Analysis group, click the Solver button. 3. In the Solver Parameters dialog box, select the constraint that you wish to change. 4. Click the Change button. 5. Make the necessary changes for that constraint. 6. Click OK. 7. Repeat 3 to 6 above for other constraints that you wish to change. 8. Click the Solve button. 9. The Solver Results dialog box will be displayed indicating the result to be accepted,

rejected or saved as a scenario.

Page 69: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Solving Problems

WWP Learning and Development Ltd Page 69

CREATING A SOLVER REPORT

Discussion Solver provides three reports, each of which displays different information on how Solver reached the solution.

• The Answer report lists the original and final values of the target and the changing cells, as well as the effect of the constraints.

• The Sensitivity report indicates how sensitive the model is to changes in the changing cells and the constraints.

• The Limits report lists the upper and lower limits imposed on the target and changing cells.

You can choose any or all of the reports from the Solver Results dialog box. Excel inserts a new worksheet in the workbook for each report you select.

Procedure 1. To create a Solver Report, first create a Solver result. 2. Click the Data tab. 3. In the Analysis group, click the Solver button. 4. In the Solver Results box, click the report you require from the Reports list box.

Excel 2007

Excel 2010

5. Click the OK button.

Page 70: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Solving Problems

WWP Learning and Development Ltd Page 70

6. A new worksheet is inserted displaying the report for that result.

Page 71: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Solving Problems

WWP Learning and Development Ltd Page 71

EXERCISE

Use Solver with constraints

1. Open Sports. 2. Use Solver to find the maximum total profits from shipping both small

and large packages. (Hint: Select cell E13 as the target cell and Max as the option to equal.)

3. Select the range C4:D4 as the cells to be changed. 4. Add the constraint that the stock used to create packages cannot

exceed inventory. (Hint: Select the range E6:E10 as the cell reference, use the <= operator, and select the range B6:B10 as the constraint cells.)

5. Add a second constraint that at least five large packages must be created. (Hint: Select cell D4 as the cell reference, select the>= operator, and type 5 as the constraint.)

6. Solve for the answer. Save the new solution as a scenario named Best Case. Then, restore the original values to the worksheet.

7. Change the constraint in cell D4 to 7 and solve for the new result. Save the new solution as a scenario named Large Shipments and restore the original values to the worksheet.

8. Use the Scenario Manager to view the Large Shipments solution. Then, show the Best Case solution and close Scenario Manager.

9. Open Solver and solve using the defined parameters. Then, create and view an Answer report.

10. Close the workbook without saving it.

Page 72: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

WWP Learning and Development Ltd Page 72

LESSON 6 - USING DATA TABLES

In this lesson, you will learn how to:

• Use data tables

• Place formulas in data tables

• Create a one-variable table

• Create a two-variable table

Page 73: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Data Tables

WWP Learning and Development Ltd Page 73

CONCEPTS AND TERMS

Discussion You can use a data table to vary one or two values in a formula and display all possible results in a table format.

A data table is a range of cells that shows how changing certain values in your formulas affects the results of the formulas. Data tables provide a shortcut for calculating multiple versions in one operation and a way to view and compare the results of all of the different variations together on your worksheet

To create a data table, you first indicate the input cells (the cells containing the variable values in the formula).The input values are then substituted in the formula and the result of each calculation is placed into an output cell in the data table.

When you create a data table, the placement of the formula used in the calculation varies, depending on the type of data table you are creating. If a one-variable data table is arranged in columns, the formula used in the calculation is placed in the cell at the top of the output column.

In the following diagram, column B is the output column and the formula must be placed in cell B3.

If a one-variable data table is arranged in rows, the formula is placed in the cell to the left of the output row.

In the following diagram, row 4 is the output row and the formula must be placed in cell A4.

In a two-variable data table, both rows and column are used for input data, and the formula used in the calculations must be placed above the column input cells and to the left of the row input cells.

In the following diagram, column B contains one set of variable input values and row 3 contains the other set of input values. Therefore, the formula must be placed in cell B3.

Page 74: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Data Tables

WWP Learning and Development Ltd Page 74

CREATING A ONE-VARIABLE TABLE

Discussion When you create a one-variable data table, you can enter the input values either across a row or down a column.

If the one-variable data table consists of two columns, the first column is the input column and contains all possible values for the variable. The second column is the output column. In addition, the cell directly above the output column must contain the formula used in calculating the data table.

If the one-variable data table consists of two rows, the top row is the input row, the second row is the output row, and the cell to the left of the output row must contain the formula.

The input cell is critical when creating a data table. It is the cell containing the variable value and must be included in the formula. As the variable values are entered into the data table, the result of each calculation appears in the corresponding cell in the output column.

Page 75: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Data Tables

WWP Learning and Development Ltd Page 75

Procedure 1. To create a one-variable (column) data table, first select the cell immediately above

the output column. 2. Enter the formula you want to use. 3. Press the [Enter] key to confirm the entry. 4. Select the range containing the formula, the input column, and the output column. 5. Click the Data tab. 6. In the Data Tools group, click the What-If Analysis button. 7. Click the Data Table… button.

8. In the Data Table dialog box, click in the Column input cell: text box. 9. Enter, or select, the input cell. 10. Click the OK button. 11. The results are displayed in your one column data table.

TWO-VARIABLE DATA TABLES

Discussion You can create a two-variable data table that evaluates two different values in a formula. A two-variable data table uses both an input column and an input row. The input row is the first row and the input column is the first column in the data table. You enter the formula you want to calculate in the cell above the input column and to the left of the input row.

A two-variable data table references two input cells: one for column input data and one for row input data; both input cells must be included in the formula. The formula calculates each of the possible combinations of the row and column input cells and places the results in the corresponding, intersecting cell in the data table.

Page 76: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Data Tables

WWP Learning and Development Ltd Page 76

Procedure 1. To create a two-variable data table, first select the cell above the column input values

and to the left of the row input values. 2. Enter the formula you want to use. 3. Select the complete data table. 4. Click the Data tab. 5. In the Data Tools group, click the What-If Analysis button. 6. Click the Data Table… button. 7. In the Data Table dialog box, click in the Row input cell: text box. 8. Enter, or select, the input cell. 9. In the Data Table dialog box, click in the Column input cell: text box. 10. Enter, or select, the input cell. 11. Click the OK button. 12. The results are displayed in your two-variable data table.

Page 77: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Data Tables

WWP Learning and Development Ltd Page 77

EXERCISE

Create one-variable and two-variable data tables.

1. Open Commrate. 2. In cell B5, enter a formula to multiply the Unit Price value in cell A2 by

the Quantity value in cell B2. 3. Create a one-variable data table in the range B4:G5. (Hint: The row

input cell is the quantity in cell B2.) 4. In cell A11, enter a formula that multiplies the sales figure in cell A8 by

the commission rate in cell B8. 5. Create a two-variable data table in the range A11:G16. (Hint: The row

input cell is cell B8 and the column input cell is cell A8.) 6. Close the workbook without saving it.

Page 78: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

WWP Learning and Development Ltd Page 78

LESSON 7 - WORKSHEET CONTROLS

In this lesson, you will learn how to:

• Use Worksheet Form Controls

Page 79: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Worksheet Form Controls

WWP Learning and Development Ltd Page 79

CONCEPTS AND TERMS

Discussion The various buttons, boxes and drop-down lists normally seem in dialogue boxes can be used directly on a worksheet. Without doing anything special, you can enable users to enter data onto a purpose-made worksheet using a variety of these controls.

The worksheet below shows some of the uses to which various controls may be put, including option boxes, list boxes, check boxes, and radio buttons

Advantages of using worksheet controls include:

• Making it easier for users who are not proficient with spreadsheets to enter data;

• Being able to restrict the type of data entered into a cell by, for example, letting the user select from a list;

• Being able to limit the range of data being entered to say, a number between 1 and 100;

• Protecting a worksheet so that data can only be entered via the control, thus preventing other data and formulas from damage.

A control is created by using the Controls group of the Developer ribbon. The Developer tab is not normally included on the Ribbon by default. You will need to show it as follows:

Excel 2007

1. Click the Office Button. 2. Click Excel Options. 3. Click the Show Developer tab in the Ribbon tick box.

List Box

Combo Box

Option Buttons

Spinner

Check Box

Page 80: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Worksheet Form Controls

WWP Learning and Development Ltd Page 80

4. Click OK.

Excel 2010

1. Click the File tab. 2. Click Options. 3. Click Customize Ribbon at the left. 4. Click to place a tick mark in the box to the left of Developer in the Main Tabs list at

the right of the dialog box.

5. Click OK.

Page 81: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Worksheet Form Controls

WWP Learning and Development Ltd Page 81

CREATING A CHECK BOXCONTROL

Discussion A Check Box consists of a caption and a small box into which a check mark can be placed by clicking it with the mouse. A Check Box is used for setting Yes/No or True/False values.

Procedure 1. To create a Check Box Control, first click the Developer tab. 2. In the Controls group, click the Insert button.

3. Click the icon for the control you want to insert on the worksheet. 4. Move (do not drag) the mouse cursor on to the worksheet. 5. Drag to create the control. 6. Type the text to be used as the caption for that control. 7. Deselect the new control by either clicking the [Esc] key, or by clicking anywhere on

the worksheet.

Page 82: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Worksheet Form Controls

WWP Learning and Development Ltd Page 82

MANIPULATING CONTROLS

Discussion Selecting a Control

As with all objects, you must select a control before you can edit, move, copy or set the properties. Small white boxes called sizing handles appear around the edges of a selected control.

By default, sizing handles appear around a control when you first create it. It can be deselected by clicking away from the control onto the spreadsheet, or by pressing [the [Esc] key Thereafter, when you point at a control, the mouse pointer changes to a "pointing finger". The control may then be reselected by holding down the [Ctrl] key and clicking it with the mouse.

Procedure 1. To select a control, point to the control you want to select. 2. Hold down the [Ctrl] key. 3. Click the control. 4. Release the [Ctrl] key.

Moving A Control

By pointing at the border of a selected control, you can move it to another position on the worksheet. When you re-position a control from one location to another, its size stays the same size. If you wish to copy a control, hold down the [Ctrl] key and drag to move a copy of that control to the proposed new location. When a control is selected, you can also move it by using the arrow keys.

Procedure 1. To move a control, first hold down the [Ctrl] key. 2. Move the mouse cursor to the border of the control. 3. Drag the control to reposition it on the worksheet. 4. Once it is positioned, release the mouse button.

Resizing a Control

By pointing at a sizing handle and clicking and dragging, you to change the size or proportions of a control. By dragging out from the centre of the control, the object becomes larger. If you drag towards to centre of a control, the control becomes smaller.

If you wish to resize a control proportionally, hold down the [Shift] key as you drag.

To resize a control proportionally from its centre, press the [Ctrl] key as you drag.

When you resize a control, you change its dimensions, not the size of the text.

Page 83: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Worksheet Form Controls

WWP Learning and Development Ltd Page 83

Procedure 1. To resize a control, select the control you want to resize. 2. Move the mouse cursor to a sizing handle. 3. Drag the sizing handle to resize the control.

Deleting a Control

Any control may be deleted by selecting that control and pressing the [Del] key.

FORMATTING A CONTROL

Discussion By linking a Check Box to a cell, you can get the linked cell to show either a TRUE or FALSE value depending on whether the Check Box has a tick mark in it or not. The value thus returned can be used, for example, in a logical function.

Procedure 1. To format a control, first use the right button of the mouse to click the control you

wish to format. 2. From the shortcut menu, select Format Control…

3. In the Format Control dialog box, click the Control tab. 4. In the Cell link: box, insert the cell reference where you want the value of the control

to display. 5. Click the OK button. 6. Clicking on this control will cause either TRUE or FALSE to be displayed.

Page 84: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Worksheet Form Controls

WWP Learning and Development Ltd Page 84

CREATING A LIST BOX

Discussion List boxes are used to enable users to select from a list of suitable entries. As worksheet controls, they can be formatted to list items from a table and given control properties to return a numeric value in a cell. This value corresponds to the position of the selected item in the list and can be used in an INDEX function to display the relevant data.

The chosen entry can be used in an INDEX function to show the appropriate data.

Advantages of using a List Box are:

• Restricting users to authorised cell entries only

• Speedier data entry as no typing is involved.

Procedure 1. To create a List Box, first click the Developer tab. 2. In the Controls group click the Insert button.

Page 85: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Worksheet Form Controls

WWP Learning and Development Ltd Page 85

3. In the Form Controls, click the List Box icon. 4. On the worksheet, drag to create the control.

5. Click the Esc key to deselect the new control.

FORMATTING A LIST BOX

Discussion As worksheet controls, List Boxes can be formatted to list items from a table and given control properties to return a numeric value in a cell. This value corresponds to the position of the selected item in the list and can be used in an INDEX function to display the relevant data.

Procedure 1. To format a List Box, first click the right mouse button on the control you want to

format. 2. In the shortcut menu, click on Format control… 3. In the Format Control dialog box, click the Control tab. 4. In the Input range: box, enter the range of cells containing the list which is to be

displayed in the List Box. 5. In the Cell link: box, enter the cell on the worksheet where you want the value of the

List Box to display.

Page 86: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Worksheet Form Controls

WWP Learning and Development Ltd Page 86

6. Click the OK button. 7. The List Box is populated.

CREATING OPTION BUTTONS

Discussion These are usually used in groups, they represent mutually exclusive choices, so only one can be selected at a time.

To group Option Buttons together, a Group Box is first created which consists of a frame with a title. Option buttons are then created over the Group Box.

Procedure 1. To create a Group Box with Option buttons, first click the Developer tab. 2. In the Controls group, click the Insert button. 3. Click the Group Box icon.

Page 87: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Worksheet Form Controls

WWP Learning and Development Ltd Page 87

4. On the worksheet, drag to create the Group Box.

5. In the Controls group, click the Insert button and select the Option Button icon.

6. Drag within the Group Box to place the Option button. 7. Type the text to accompany the button. 8. Add further Option buttons in the Group Box as required.

9. Press the [Esc] key or click away from the control on the worksheet to deselect it.

FORMATTING AN OPTION BUTTON GROUP

Discussion A group of Option buttons is linked to a worksheet cell. When you link one Option Button to a cell, all the buttons in the same group are linked to the same cell.

The value of the cell will have a numeric value depending on which Option Button has been selected from the group. The number of the button is based on the order in which it was placed on the worksheet, ie. the first button to have been created will return a value of 1; the second, 2 etc.

The value thus returned can be used in functions to return the appropriate data.

Procedure 1. To format an Option Button, first click the right mouse button on the control you

want to set the properties for.

Page 88: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Worksheet Form Controls

WWP Learning and Development Ltd Page 88

2. From the menu, select Format Control… 3. If necessary, click the Control tab.

4. Choose the Value to be checked or unchecked as required. 5. Click in the Cell link: box. 6. Insert the cell reference where you want the value of the Check Box to display. 7. Click the OK button. 8. Click the [Esc] key. 9. The second Option Button in the same Group Box automatically takes the next value.

CREATING A SPINNER

Discussion These are used to enable users to enter numeric values into a cell without having to type the data. Spinners are usually formatted to restrict values between a range and are set to a

suitable incremental rate in order to select relevant values more quickly .

Procedure 1. To create a Spinner button, first click the Spinner button icon in the Form Controls

group.

Page 89: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Worksheet Form Controls

WWP Learning and Development Ltd Page 89

2. On the worksheet, drag to place the Spinner.

3. Deselect by pressing the [Esc] key.

Spinner icons in the Form Controls must not be confused with the Scroll Bar button, which although of similar appearance, works in a different way.

FORMATTING A SPINNER

Discussion A Spinner is linked to a worksheet cell. When you "rotate" the Spinner with the mouse by clicking either its up arrow to increase the value or its down arrow to decrease its value, the selected value is displayed in the cell to which the Spinner control is linked. This value can then be used in formulas and functions in a variety of different ways.

Procedure 1. To format a Spinner, use the right mouse button to click the Spinner you want to set

properties for.

2. From the menu, click on Format Control… 3. If necessary, click the Control tab.

Page 90: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Worksheet Form Controls

WWP Learning and Development Ltd Page 90

4. Click in the Current Value: box and type the Spinner’s default value. 5. Click in the Minimum Value: box and type the lowest value that you want the

Spinner to allow. 6. Click in the Maximum Value: box and type the highest value that you want the

Spinner to allow. 7. In the Incremental change: box, type the value you want the Spinner to “rotate” each

time it is clicked. 8. Click in the Cell link: box. 9. Select the cell on the worksheet where you want the value of the value to be

displayed. 10. Click the OK button. 11. Deselect the Spinner control on the worksheet.

CREATING A COMBO BOX

Discussion Combo boxes (often called Drop-down Boxes) are similar to List Boxes in the sense that they

enable users to select from a list of suitable entries .

The difference is that the Combo Box shows only the currently selected item, whereas the List Box shows several items.

Procedure 1. To create a Combo Box, first click the Developer tab. 2. In the Controls group click the Combo Box icon.

Page 91: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Worksheet Form Controls

WWP Learning and Development Ltd Page 91

3. On the worksheet drag to create the control.

4. Deselect the control.

FORMATTING A COMBO BOX

Discussion As with List Boxes, Combo Boxes can be formatted to list items from a table, and given control properties to return a numeric value in a cell. This value corresponds to the position of the selected item in the list and can be used in an INDEX (and other) functions to display the relevant data.

Procedure 1. To format a Combo Box, first click the right mouse button on the Combo Box control

you want to set properties for.

2. In the menu, select Format Control… 3. If necessary, click the Control tab.

Page 92: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Worksheet Form Controls

WWP Learning and Development Ltd Page 92

4. Click in the Input range: box. 5. Enter the range containing the list to display in the Combo Box. 6. Click in the Cell link: box. 7. Select the cell on the worksheet where you want the value to be displayed. 8. In the Drop down lines: box, enter the number of lines required in the Combo Box. 9. Click the OK button. 10. Deselect the control.

COMPLETING THE WORKSHEET

Discussion

Once the controls and associated formulas on your workbook have been created, formatted and tested to your satisfaction, you can improve the appearance and functionality of the spreadsheet by:

• hiding column A so that the returned values do not show;

• removing gridlines;

• giving the cells behind the controls a grey background. This will make them look more like a dialog box and will show up any 3D shading better;

• defining a print area and appropriate page set-up options, so that just the booking form prints out with a suitable layout;

• adding protection to the worksheet so that only areas relevant to the user can be accessed.

Page 93: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Worksheet Form Controls

WWP Learning and Development Ltd Page 93

Page 94: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Worksheet Form Controls

WWP Learning and Development Ltd Page 94

EXERCISE

To create a workbook which uses worksheet controls for entering data.

1. Open the file Tool Hire. 2. Create a Combo Box in cell C5 that lists items for hire. These are given

on the Tables Sheet. Link this control to cell A5. 3. Create a Spin Button in cell C7 with what you consider to be

appropriate settings, which returns its value in cell C7. 4. Create a Check Box in cell C9 to return a value in cell A9. 5. Test that your controls and formulas work correctly. 6. Hide column A. 7. Set up a print range for the Agreement Form part of the worksheet. 8. Save and close the file.

Optional Extra

1. Create a group of Option Buttons on your worksheet to apply a discount to the invoice. Base your option buttons on the "Discount" table in the Tables Sheet and add/amend formulas as necessary to calculate an appropriate deduction to the Hire Charge.

2. Save and close the workbook.

Page 95: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

WWP Learning and Development Ltd Page 95

LESSON 8 - WORKING WITH TEMPLATES

In this lesson, you will learn how to:

• Work with templates

• Save a workbook as a template

• Use a template

• Edit a template

• Insert a new worksheet

• Delete a template

• Create default templates

Page 96: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Working with Templates

WWP Learning and Development Ltd Page 96

CONCEPTS AND TERMS

Discussion A template is a special type of workbook you can use as a model for creating new workbooks. Anything that can be saved in a workbook can be included in a template. For example, if you create a weekly budget report that contains standard text and formulas, you can save the workbook as a template and then use the template to create your weekly budget reports. Thereafter, you will not need to enter the standard text and formulas each time you create the weekly budget report.

New Workbook dialog box showing Installed Templates (Excel 2007)

New Workbook window (Excel 2010)

Page 97: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Working with Templates

WWP Learning and Development Ltd Page 97

Templates are a time saver when you are creating workbooks that have the same general look, even if they contain different data.

Templates can also help ensure a consistent appearance throughout similar workbooks.

Procedure 1. To create a workbook using one of the templates provided with Excel, click the

Office button (Excel 2007) or the File tab (Excel 2010). 2. Click the New command.

Excel 2007 Excel 2010

3. In the New Workbook dialog box, select a template type from the Templates pane at the left of the window (Excel 2007) and at the top centre (Excel 2010).

Excel 2007 Excel 2010

4. Select the template that you want from those displayed. 5. Click the Create button. 6. The template is opened as a new workbook.

CREATING A CUSTOM TEMPLATE

Discussion To create a template, you must first design a workbook that contains the formulas, cell attributes, and text you want to appear in all workbooks based on the template. After you have saved this workbook as a template, you can use it as the basis for future workbooks.

Page 98: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Working with Templates

WWP Learning and Development Ltd Page 98

You can save text, formatting, styles, formulas, macros, graphics, and display settings in a template. You can format a new, unsaved workbook and save it as a template, or you can save an existing workbook as a template.

Procedure 1. With the workbook open, click the Office button (Excel 2007) or the File tab (Excel

2010).

Excel 2007 Excel 2010

2. Click the Save As button. 3. In the File name: box, type a name for the template. 4. Click the down arrow in the Save as type: box.

Using Windows XP

Page 99: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Working with Templates

WWP Learning and Development Ltd Page 99

Using Windows Vista

Using Windows 7

5. Select Excel Template. 6. Click the Save button.

WHERE ARE CUSTOM TEMPLATES STORED?

Discussion By default, templates you create and that appear when the My Templates command is invoked are stored in your own personal settings in a folder named Templates.

Page 100: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Working with Templates

WWP Learning and Development Ltd Page 100

NB: The Templates folder is the default folder for ALL custom templates that you create in any of the Office applications (ie. Word, PowerPoint, Outlook, etc.). Beware of deleting files from it unless you know that they are definitely not required as templates in other applications.

DO NOT DELETE Normal.docx or you may lose any custom styles or macros that you have created in Word.

The location of the Templates folder varies depending on how your IT department has set up your profile and what version of Windows you are using. The best way of identifying where your templates are stored is to look under File Locations in Word Options.

Procedure 1. Launch Microsoft Word. 2. Click the Office button (Word 2007) or the File tab (Word 2010). 3. Click Word Options (Word 2007) or Options (Word 2010). 4. Select Advanced in the pane at the left. 5. Scroll down to the bottom of the right-hand pane. 6. Click the File Locations… button. 7. Select User templates.

8. Click Modify…to see more clearly the full path to the default location for all

personal templates that you create. 9. Change the location if you wish and click OK, or click Cancel to leave as is. 10. Click OK. 11. Click OK.

Page 101: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Working with Templates

WWP Learning and Development Ltd Page 101

Excel 2007

Excel 2010

Important: The templates folder is normally hidden. If you cannot “see” it in an Explorer window, you must unhide it as in the following procedures.

Procedure Windows XP

1. Double click (My) Computer on the desktop or open Windows Explorer. 2. Select the Tools menu. 3. Select Folder Options. 4. Click the View tab.

Page 102: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Working with Templates

WWP Learning and Development Ltd Page 102

5. Select the Show hidden files and folders option button. 6. Click OK.

Windows Vista and Windows 7

1. Double click Computer on the desktop or open Windows Explorer.

2. Click the Organise button on the toolbar 3. Click Folder and Search Options.

4. Select the View Tab. 5. Select the Show hidden files and folders option button.

6. Click OK.

Page 103: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Working with Templates

WWP Learning and Development Ltd Page 103

You can tailor the Templates folder by creating sub folders for different types or categories of template. Each folder that you create will appear as a tab in the My Templates dialog box (but only if it contains at least one file).

Sub folders created in the Templates folder show up as tabs in the New dialog box

USING A CUSTOM TEMPLATE

Discussion You can use a template when you want to create a workbook based on a standard model. For example, if you create a weekly budget report, you can use a weekly budget template each time you create the report.

When you create a workbook from a template, a copy of the template opens as a new workbook with a default name assigned by Excel. When you then save the workbook, you can use the default name, or you can type a new one. Saving changes made to the workbook does not affect the template itself.

Page 104: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Working with Templates

WWP Learning and Development Ltd Page 104

Procedure Open a template to use as a workbook

1. Click the Office button (Excel 2007) or the File tab (Excel 2010). 2. Click New. 3. Select My templates....

Excel 2007 Excel 2010

4. In the New dialog box, select the template you wish to use.

5. Click OK. 6. The template is opened as a new workbook of your style.

Save a template as a workbook

1. To save a template that you have opened as a workbook, either click the Save button on the Quick Access Toolbar or click the Office button (Excel 2007) or the File tab (Excel 2010) and select Save from the menu at the left.

2. In the Save As dialog box, name the new workbook in the File name: box 3. Select the location for the workbook. The method for doing this will vary depending

on which version of Windows you are using. 4. Click the Save button. 5. Use the newly saved workbook to enter data as required.

EDITING A TEMPLATE

Discussion You can change the content and formats of a template. For example, if you create and save a template for your weekly budgets and you need to add an additional line item, you can open, modify, and resave the template with the new line item. In addition, you can modify or update the default templates provided by Excel.

Page 105: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Working with Templates

WWP Learning and Development Ltd Page 105

Changes to a template affect only new workbooks created from that template; workbooks created from the template before the changes were made to it are not changed.

Procedure 1. To edit a template, first click the Office button (Excel 2007) or the File tab (Excel

2010). 2. Click New command. 3. Select the template that you want to edit. 4. Click the OK button. 5. Make the changes you require to the template. 6. Click the Office button (Excel 2007) or the File tab (Excel 2010). 7. Click the Save As command. 8. Click the Save as type: down arrow and select Excel Template from the list. 9. Type a new file name for the template or the same name if you just want to replace it. 10. Click the Save button. 11. Click the Yes button, if necessary to replace the template file.

INSERTING A NEW WORKSHEET

Discussion When you insert a worksheet into the current workbook, you can base it on an existing template, or you can select it from any available template; if the template you select contains more than one worksheet, all the worksheets in the template are inserted. For example, if you are working on a quarterly workbook, you can insert a worksheet based on the weekly budget template.

Excel automatically assigns a name to an inserted worksheet. You can change the default name, as desired.

In any workbook you can insert your own template as a new worksheet. When inserted it will retain the name you gave to the worksheet(s).

Procedure 1. To insert a template as a worksheet into an open workbook, right click the sheet tab

where you want to insert the new worksheet. 2. From the menu, click the Insert… command.

Page 106: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Working with Templates

WWP Learning and Development Ltd Page 106

3. In the Insert dialog box, select the desired template.

4. Click the OK button.

DELETING CUSTOM TEMPLATES

Discussion You can delete a template you no longer use in order to prevent confusion between new and old version templates. Deleting unwanted templates keeps your New dialog box from becoming overcrowded.

Procedure 1. To delete a template, click the Office button (Excel 2007) or the File tab (Excel 2010). 2. In the menu, select on New. 3. Select My Templates…. 4. In the New dialog box, right click the template you want to delete. 5. Select Delete from the menu.

Page 107: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Working with Templates

WWP Learning and Development Ltd Page 107

Windows XP

Windows Vista

6. In the Message box, click on Yes to confirm the deletion.

Windows XP

Windows Vista and Windows 7

Page 108: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Working with Templates

WWP Learning and Development Ltd Page 108

7. If you accidentally delete a template, you can restore it from the Recycle Bin to its original location.

You can remove recently used templates by right clicking it and selecting Remove Template. This does not delete the file but merely removes the shortcut to it from the dialog box.

Removing a recently used template shortcut (Excel 2007)

Removing a recently used template shortcut (Excel 2010)

CREATING DEFAULT TEMPLATES

Discussion Whenever you create a new blank workbook or insert a new worksheet without selecting a template, Excel uses the default Workbook template and the default Worksheet template, respectively.

Page 109: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Working with Templates

WWP Learning and Development Ltd Page 109

You can create your own default workbook template. If you want Excel to use your custom template as the default workbook template, you must store it in the XLSTART folder.

The location of the XLSTART folder can vary depending on which version of Windows and/or Office you are using. It is best, therefore, to do a search for XLSTART bearing in mind that it is a hidden folder and hence, needs to be made visible before searching (see page Error! Bookmark not defined.).

In addition, the default workbook template must be named Book, since Excel recognizes the default workbook template by its file name. If a Book template exists in the XLSTART folder, Excel will use it whenever you click the New button.

Similarly, you can create a default worksheet template in the XLSTART folder named Sheet. If a Sheet template exists in the XLSTART folder, Excel will use it whenever you insert a new worksheet. (The Worksheet icon in the Insert dialog box is a link; selecting it will insert the default Sheet template if one exists; otherwise, selecting it will insert a blank worksheet.)

Page 110: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Working with Templates

WWP Learning and Development Ltd Page 110

EXERCISE

Create and use templates.

1. Open Tenntmp. 2. Save the workbook as a template called tennis. Close the template. 3. Use the tennis template to create a new workbook. 4. In the new workbook, change the months to Apr, May, and Jun in the

range B7:D7. 5. Change the title in cell A3 to read Second Quarter Sales - Southeast. 6. Save the workbook as a template named tennis2q. Then, close it. 7. Create a new workbook based on the tennis template. 8. Insert a new worksheet based on the tennis2q template. 9. Close the workbook without saving it. 10. Delete both the tennis and the tennis2q templates.

Page 111: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

WWP Learning and Development Ltd Page 111

LESSON 9 - USING MACROS

In this lesson, you will learn how to:

• Define macros

• Open a workbook containing macros

• Run a macro

Page 112: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Macros

WWP Learning and Development Ltd Page 112

CONCEPTS AND TERMS

Discussion A macro is a program you can create to automatically perform frequently used operations. It contains all the commands, mouse movements, and user actions necessary to complete a task.

Macros can save you considerable time because you can use them to automate repetitive, time-consuming tasks. You can use macros for simple tasks you perform frequently or for complex tasks that require consistency.

OPENING A WORKBOOK CONTAINING MACROS

Discussion Excel 2007

When you open a workbook containing macros, VBA, or other software code, Excel displays a security warning to let you know the workbook might contain harmful code that may harm your computer.

Excel 2007

On clicking the Options… button on the Security Warning, Excel 2007 gives you the following dialog box to confirm enabling or disabling the macro(s). You will need to repeat this procedure each time you open the workbook.

Excel 2010

On clicking the Enable Content button, macros are instantly enabled without further need for confirmation. To leave macros disabled, do not click the Enable Content button.

Page 113: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Macros

WWP Learning and Development Ltd Page 113

Excel 2010

If you click Enable Content, the workbook becomes a “Trusted Document.” This means that you will not see the security warning when you open the workbook the following time; any macros in it will be instantly enabled.

You can manage your trusted documents using the Trusted Documents pane in Options > Trust Center > Trust Center Settings... button.

Managing Trusted Documents in Excel 2010

Procedure 1. To open a workbook with macros, click the Office button. 2. Click on Open. 3. Locate the workbook with macros you want to open. 4. Click the Open button. 5. In the Security Warning Message Bar, click the Options… button (Excel 2007) or

Enable Content (Excel 2010).

Additionally in Excel 2007 only

6. Choose the option you want (eg. Enable this content). 7. Click the OK button.

The Security Warning in the above procedure falls under the Disable all macros with notification option in Excel Options > Trust Center> Trust Center Settings > Macro Security.

If you are confident that ALL workbooks opened on your computer contain safe content, you can choose the Enable all macros (not recommended, potentially dangerous code can run) option in the Macros Settings. You will not then receive any security warnings at all when opening workbooks containing potentially harmful content.

Page 114: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Macros

WWP Learning and Development Ltd Page 114

Excel 2007

Excel 2010

RUNNING A MACRO

Discussion Running a macro is just like carrying out a command in Excel. Macros can be run via:

• the Macro dialog box (View tab > Macros >View Macros… );

Page 115: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Macros

WWP Learning and Development Ltd Page 115

• a shortcut key (keystroke);

• a custom button on the Quick Access Toolbar;

Or

• a worksheet button.

.

Where a macro is stored determines its availability. Macros stored in the Personal Macro Workbook are always available for any workbook that is open. Macros stored in a specific workbook are only available when that workbook is open.

Storing macros and understanding how to create them is covered more fully in the next lesson.

Procedures Using the Macro dialog box

1. Select the View tab on the Ribbon. 2. Click the upper half of the Macros button. 3. In the Macros dialog box, select the macro that you want to run. 4. Click the Run button. 5. The macro runs.

Using A Shortcut Key

A macro shortcut key consists of holding down the [Ctrl] key and simultaneously pressing another key that has been assigned to the macro. If an uppercase letter has been assigned to run the macro, you need to hold down the [Ctrl] key AND the [Shift] key simultaneously, while pressing the letter assigned to the macro.

Page 116: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Macros

WWP Learning and Development Ltd Page 116

If you don’t know the shortcut key for a macro, you can find it as follows:

1. Select the View tab on the Ribbon. 2. Click the upper half of the Macros button. 3. In the Macros dialog box, select the Macro you to see the shortcut key for. 4. Click the Options… button. 5. Click Cancel.

Assigning macros is covered more fully in the next lesson on page 122.

Page 117: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Macros

WWP Learning and Development Ltd Page 117

EXERCISE

Use macros in a workbook.

1. Open Exer81 and enable the macros. 2. Run the Sort_RegionSales macro. Notice that the macro sorts the data,

first by region in ascending order, and then by annual sales in descending order.

3. Run the Sort_LastName macro. Notice that the macro sorts the data by last name in ascending order.

4. Use the [Ctrl+r] shortcut key to run the Subtotals_Region macro. 5. Close the workbook without saving it.

Page 118: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

WWP Learning and Development Ltd Page 118

LESSON 10 – RECORDING MACROS

In this lesson, you will learn how to:

• Record a macro

• Assign a shortcut key

• Record a macro using relative references

• Delete a macro

Page 119: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Recording Macros

WWP Learning and Development Ltd Page 119

CONCEPTS AND TERMS

Discussion A macro can be created using the macro recorder. Excel records the macro as you perform the steps that you want it to repeat later. The steps you perform are translated into the Visual Basic for Applications (VBA) programming language and stored as code in a module (or module sheet).

Modules are stored in Excel workbooks. You cannot see a module from Excel, you have to open the Visual Basic Editor application and view it from there. Think of a module as an invisible sheet in a workbook that can only be seen in the Visual Basic Editor.

The Visual Basic Editor allows you to manage your modules (move, copy, delete them), edit recorded code and/or add additional code of your own. Writing VBA code from scratch is a complex topic and outside the scope of this course book but it is possible to understand recorded code and make some simple changes to it.

RECORDING A MACRO

Discussion During the macro recording process, you name the macro and optionally assign a shortcut key to run it by later and/or enter descriptive information about it. Macro names cannot contain spaces nor can they contain certain special characters and punctuation marks.

There are also certain words “reserved” for special reason (too numerous to mention) that cannot be used (eg. Date, If, or Next). If you give a macro an unacceptable name in the Record Macro dialog box, the following message will appear when you click OK.

In short, it is best to keep to letters and numbers only, as long as a number is not the first character!

In addition to naming the macro, you must select the location where you want to store the macro. Macros can be stored in the current workbook, a new workbook, or the Personal Macro Workbook.

This Workbook or New Workbook, therefore, are good places to store macros that are specific to that workbook only, ie. it carries out actions that are suitable for or possible in that workbook only.

Storing a macro in This Workbook or New Workbook also makes the macro more “portable.” If you save the workbook in a shared folder on your network, or sent it to someone as an email attachment, anyone opening that workbook will also be able to run the macro.

Page 120: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Recording Macros

WWP Learning and Development Ltd Page 120

The Personal Macro Workbook is a special workbook that Excel creates for you the first time you record a macro in it (named Personal.xlsb). Excel keeps it hidden (to keep it out of harm’s way!) but it can be viewed and edited in the Visual Basic Editor.

The Personal Macro Workbook is automatically saved and opened when you close or launch Excel. If you see the following message when you close Excel, it is a good idea to click Yes or Save, else risk losing any macros that you have created in the Personal Macro Workbook!

The Personal Macro Workbook is stored with your profile and hence, only available to you personally when you log on to a computer with your logon name and password. It is, therefore, a good place to store macros of a “general purpose” nature that you want to use on any workbook at any time.

Procedure 1. Select the View tab. 2. Click the lower half of the Macros button in the Macros group. 3. Click Record Macro.

4. Type a name in the Macro name: box. 5. In the Shortcut key: box, type a letter if required. 6. In the Store macro in: box, click the arrow and choose from the list. 7. In the Description: box, type your own description of the operation of the macro. 8. Click OK.

9. Carry out the desired commands for the macro. 10. When you have finished recording, click the lower half of the Macros button.

Page 121: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Recording Macros

WWP Learning and Development Ltd Page 121

11. Select Stop Recording.

Or

Click the Stop button in the Status Bar at the bottom left-hand corner of the Excel window below below the first sheet tab.

Windows XP

Windows Vista

Windows 7

The Stop button changes to when NOT recording. You can also start recording a new macro by clicking this button.

USING RELATIVE REFERENCES TO RECORD A MACRO

Discussion Absolute and relative references refer to how a macro records cell locations. When you record a macro, the macro recorder typically uses absolute references. For example, if you enter the label Annual Sales Report in cell A4 while recording a macro, that label will always appear in cellA4 whenever you run the macro, no matter which cell is active when the macro is run.

When you use relative references while recording a macro, Excel records cell references relative to the active cell. For example, if you type the label Annual Sales Report in the cell to the left of the active cell while recording a macro, that label will always be entered into the cell to the left of whichever cell is active when you run the macro. Relative references give a macro more flexibility.

Page 122: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Recording Macros

WWP Learning and Development Ltd Page 122

Procedure 1. To use relative references to record a macro, first open a workbook in which to

record a macro. 2. Click the View tab. 3. Click the lower half of the Macros button in the Macros group. 4. Select Record Macro…. 5. In the Macro dialog box, click in the Macro name: box and enter the new macro

name. 6. Assign a shortcut key to the macro, if desired. 7. Choose where to store the macro. 8. Provide a description for the macro. 9. Click the OK button. 10. Record the desired macro steps. 11. Click the Stop Recording button.

DELETING A MACRO

Discussion If you no longer use a macro, you can delete it. Some macros are used in other macros hence you should make sure that the macro being deleted is not needed by other macros.

If a macro is stored in a workbook, the workbook must be open in order to delete the macro.

If the macro is stored in the Personal Macro Workbook (which automatically loads as a hidden window every time you launch Excel), it must be unhidden before the macro can be deleted.

You can unhide the Personal Macro Workbook by:

• selecting the View tab and then clicking the Unhide command in the Window group.

• selecting Personal in the Unhide dialog box and click OK. This allows the Personal

Macro Workbook to be accessed.

Page 123: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Recording Macros

WWP Learning and Development Ltd Page 123

Procedure 1. To delete a macro, first open the workbook containing the macro(s) you want to

delete. See above about unhiding the Personal Macro Workbook 2. Click the View tab. 3. Click the top half of the Macros button in the Macros group. 4. In the Macro dialog box, click the macro name to be deleted. 5. Click the Delete key. 6. Confirm by clicking Yes in the message box.

If you have unhidden the Personal Macro Workbook to delete a macro from it, it is advisable to rehide it afterwards. This is to prevent it being closed, deleted or reused for other purposes. Remember, its sole purpose is to store your personal macros!

You can rehide the Personal Macro Workbook by:

• activating the Personal.xlsb workbook;

• selecting the View tab and then clicking the Hide command in the Window group.

• The workbook is immediately hidden.

ASSIGNING SHORTCUT KEYS TO MACROS

Discussion You can assign a shortcut key to a macro, either when you create the macro or after the macro has been created. After a shortcut key has been assigned to a macro, the macro runs whenever the shortcut key is pressed. All macro shortcut keys must begin with the [Ctrl] key followed by any character or with the [Ctrl+Shift] key combination followed by any character.

Shortcut keys are assigned as you are recording a macro by entering the desired shortcut key in the Record Macro dialog box.

If you assign a shortcut key while the macro is being created, it appears as a comment in the module. When a shortcut key is assigned to an existing macro, this comment is not automatically created. You can edit the macro text, however, to add the comment manually.

Page 124: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Recording Macros

WWP Learning and Development Ltd Page 124

You should avoid assigning macro shortcut keys that are the same as the standard Excel shortcuts such as [Ctrl+B], [Ctrl+S], because the standard Excel shortcut will be overridden by the macro shortcut.

Procedure 1. To assign a shortcut key to an existing macro, first open the workbook with the

macro that you want to assign a shortcut key to. If the macro is in the Personal Macro Workbook, it should be open already.

2. Click the View tab on the Ribbon. 3. Click the top half of the Macros button in the Macros group. 4. Select the macro that you want to assign or change a shortcut key for. 5. Click the Options… button. 6. In the Macro Options dialog box, click in the Shortcut key: box. 7. Type the letter you want to use. 8. Click the OK button. 9. Close the Macro dialog box.

ASSIGNING A MACRO TO THE QUICK ACCESS TOOLBAR

Discussion Once a macro has been created, you can assign it to a button on the Quick Access Toolbar. When you move the mouse cursor over a macro button on the Quick Access Toolbar, a ScreenTip is displayed, showing a name or description nor the macro.

Assigning macros to toolbar buttons is best done for macros that are stored in the Personal Macro workbook.

To add a macro button the Quick Access Toolbar, you have to customise it. This can be done by clicking the small drop down arrow at the right of the Quick Access Toolbar and selecting More commands… in the menu.

Page 125: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Recording Macros

WWP Learning and Development Ltd Page 125

Any available macros are listed in the macros list at the left of the Customize Quick Access Toolbar dialog box and can be added as commands to the toolbar. The command can than have its image changed and a descriptive name added to display as a ScreenTip.

Procedure 1. To assign a macro to a toolbar, click the Customize Quick Access Toolbar list arrow. 2. Click on More Commands…. 3. Select Macros in the Choose commands from: drop down box. 4. Ensure the Customize Quick Access Toolbar box (at the top right) displays For all

documents. 5. Select the macro you are going to add to the toolbar. 6. Click the Add button. 7. Use the Move Up and Move Down arrow buttons to arrange the commands in the

order you require on the toolbar. 8. Click the Modify… button. 9. In the Modify Button box, type a descriptive name for the button. 10. Select an icon from the list. 11. Click the OK button. 12. Click the OK button to close the Options box. 13. The macro button is displayed on the Quick Access Toolbar.

Page 126: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Recording Macros

WWP Learning and Development Ltd Page 126

REMOVING A CUSTOM MACRO BUTTON

Discussion Once a macro has been assigned to a menu, it is available to all worksheets.

If you no longer want the macro to appear on the Quick Access Toolbar, you can remove the macro button from the toolbar.

Procedure 1. To remove a macro button from the Quick Access Toolbar, click the Customize

Quick Access Toolbar drop down arrow. 2. Click on More Commands…. 3. Ensure the Customize Quick Access Toolbar box displays For all documents. 4. Click the macro you want to remove from the toolbar from the list at the right. 5. Click the Remove button. 6. Click the OK button. 7. The macro button is removed from the Quick Access Toolbar.

Page 127: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Recording Macros

WWP Learning and Development Ltd Page 127

You do not have to have a workbook open in order to delete a custom macro button.

CREATING A WORKSHEET BUTTON TO RUN A MACRO

Discussion You can create a macro button directly on a worksheet. This is best done for macros that are stored in a workbook and that are specific to the sheet where the button is created.

Worksheet macro buttons macro are quite literally drawn anywhere onto the sheet using the mouse pointer. You can have as many as you need on a sheet to run macros that perform actions on that sheet.

To draw a worksheet button, you must install the Developer tab to the Ribbon. In the Developer tab you will find the necessary command to draw the button. After you have drawn the macro button, you must assign a macro to it. You can then size the macro button and position it anywhere on the worksheet.

To install the Developer tab:

Excel 2007 Excel 2010

Click the Office Button. Click the File tab

Click the Excel Options… button Click the Options button

Ensure Popular is selected in the pane at the left

Select Customize Ribbon in the pane at the left

Click the check box at the left of Show Developer Tab in Ribbon.

Click the check box at the left of Developer in the list of Main tabs at the right of the dialog box

Click OK. Click OK.

Procedure 1. To create a macro button, first, if necessary, ensure the macros are enabled. 2. Click the Developer tab. 3. In the Controls group, click the Insert button. 4. Click the button icon. 5. On the worksheet, drag to create the button. 6. If you hold down the [Shift] key while dragging, the button will be square. 7. If you hold down the [Ctrl] key while dragging, the button will be drawn outward

from the centre. 8. If you hold down the [Alt] key while dragging, the button will be aligned to cell

gridlines. 9. In the Assign Macro dialog box, select the macro to assign to the button. 10. Click OK. 11. Select the name for the button. One that will describe the macro that it runs. 12. Deselect the button by clicking back onto the worksheet.

Page 128: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Recording Macros

WWP Learning and Development Ltd Page 128

COPYING A MACRO BUTTON

Discussion You can create new macro buttons quickly by copying existing ones. This option is useful in adding several similar macro buttons to a worksheet.

When you copy a macro button, the pasted macro buttons will always be the same size and shape as the copied macro button.

Procedure 1. To copy a macro button, first ensure the macros are enabled. 2. Activate the worksheet button that you want to copy by right clicking it. 3. Hold down the [Ctrl] key and drag the button BY ITS EDGE to where you want the

copy created. 4. Deselect the new macro button. 5. Right click the new macro button. 6. In the menu, select Assign Macro…

7. In the Assign Macro dialog box, select the macro to be assigned to the new button.

Page 129: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Recording Macros

WWP Learning and Development Ltd Page 129

8. Click the OK button. 9. Double click the text on the new button. 10. Type the text you want to be displayed on the new button. 11. Deselect the new button. 12. Click the button to test the operation of the macro if necessary.

FORMATTING A MACRO BUTTON

Discussion You can format text on a macro button in much the same way as you format text on a worksheet. You can select the entire button and apply the same formats to all the button text, or you can select individual characters in the button text to format.

To select a macro button for editing, hold the [Ctrl] key as you click the macro button; otherwise, the macro attached to the button runs when you click it.

Procedure 1. To format the text on a macro button, first enable the macros, if not already done. 2. Right click the macro button whose text you want to format. 3. From the shortcut menu, select Format Control…

Page 130: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Recording Macros

WWP Learning and Development Ltd Page 130

4. In the Format Control dialog box, select text options as required. 5. Click the OK button. 6. Deselect the macro button.

MOVING/SIZING A MACRO BUTTON

Discussion You can move or size a macro button in the same way that you move or size any graphic object on a worksheet. In order to move or size a macro button, you must first select it.

To select a macro button, hold the [Ctrl] key as you click it (or right click it), otherwise, the macro attached it will run instead.

Procedure 1. To move, or resize, a macro button, activate it first by holding down the [Ctrl] key

while you click it (or right click it). 2. Drag the button BY ITS EDGE to the intended location. 3. Resize a macro button by dragging one of the sizing handles (little white circle) on

the corners or along the edges.

Page 131: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Recording Macros

WWP Learning and Development Ltd Page 131

4. When finished, deselect the button.

DELETING A WORKSHEET BUTTON

Discussion You can delete any macro button you no longer need. Deleting unused macro buttons protects you from accidentally running a macro that is outdated or no longer works correctly.

When you delete a macro button, only the button is deleted; the attached macro remains intact.

Procedure 1. To delete a macro button, hold down the [Ctrl] key while selecting the button to be

deleted. 2. Press the [Delete] key to remove the button.

Page 132: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Recording Macros

WWP Learning and Development Ltd Page 132

EXERCISE

Recording macros.

1. Open Exer82 and enable the macros. 2. Display the Last Year worksheet, if necessary. In cell A1, begin

recording a macro named Today. Store the macro in the current workbook.

3. Using relative references, perform the following steps to record the Today macro: Add bold and a red font colour to the active cell Change the font size to 12 Type =today() Press [Enter]

4. Stop recording the macro. Clear the format and contents from cell A1. 5. View the macro in the Visual Basic Editor window, displaying

Module3 in the Code window, if necessary. Then, close the Visual Basic Editor window.

6. Add the Today macro to the Quick Access Toolbar. Name the custom item Today.

7. Display the Projections worksheet. Use the Today command on the Quick Access Toolbar to run the Today macro in cell A1.

8. Clear the format and contents from cell A1. 9. Assign the [Ctrl+Shift+T] shortcut key to the Today macro. 10. Use the shortcut key to run the Today macro in cell A1 in the Last Year

worksheet. 11. Remove the Today command from the Quick Access Toolbar. 12. Delete the Today macro. 13. Close the workbook without saving it.

Create and work with macro buttons on a worksheet

1. Open Exer85 and enable the macros. 2. Display the Developer ribbon. 3. Draw a macro button in the range M7:M8. Assign the Eastern macro to the macro

button and change the button text to Eastern Sales. Then, italicize the button text. 4. Deselect the Eastern Sales button and click it to test it. 5. Drag to create a copy of the Eastern Sales button. Position its top, left corner at the

top, left corner of cell M3. Assign the Clear Output macro to the macro button and rename it Clear Report.

6. Deselect the Clear Report button and then click it to test it. 7. Move the Clear Report button below the Eastern Sales button, aligning it to the top,

left corner of cell M10. 8. Widen the Clear Report button to extend across both columns M and N.

Page 133: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Recording Macros

WWP Learning and Development Ltd Page 133

9. Delete both macro buttons. 10. Close the workbook without saving it.

Page 134: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

WWP Learning and Development Ltd Page 134

APPENDIX A - USING SHARED WORKBOOKS

In this lesson, you will learn how to:

• Use shared workbooks

• Save a shared workbook

• View users sharing a workbook

• View shared workbook changes

• Change the update frequency

• Highlight changes

• Manage conflicting changes

• Resolve conflicting changes

• Set change history options

• Add a History worksheet

• Review tracked changes

• Merge shared workbook files

Page 135: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Shared Workbooks

WWP Learning and Development Ltd Page 135

CONCEPTS AND TERMS In Excel, more than one user can review or edit a workbook at the same time. For example, in a worksheet tracking orders, it may be necessary for several people to enter, review, and edit data, such as, a data entry person, an inventory manager, a purchasing manager, and the shipping department.

Shared workbooks allow more than one person to access the information stored in a workbook at the same time. Shared workbooks are placed on a shared network resource, such as a network drive or folder.

Using a shared workbook is similar to using an exclusive workbook; certain Excel features, however, are not available in shared workbooks.

When a workbook is shared, you cannot perform the following tasks:

• Delete worksheets

• Merge or split cells

• Define or apply conditional formats and data validation

• Insert and delete blocks of cells

• Add or edit charts, pictures, objects, or hyperlinks

• Use the Drawing tools

• Assign, change, or remove passwords in individual worksheets or in the workbook itself, although existing passwords remain in effect

• Work with scenarios

• Group or outline data

• Insert automatic subtotals

• Create data tables

• Create or modify PivotTables

• Work with macros

• Change dialog boxes or menus

• Protect or unprotect worksheets or the workbook

• Add or change Microsoft Excel 4 dialog boxes

• Change or delete array formulas

• Use a data form to add new data

• Work with XML data

SAVING A SHARED WORKBOOK

Discussion You can share workbooks with other users. For example, after you have created an order entry workbook, you can share the workbook with other users who need to enter orders.

Page 136: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Shared Workbooks

WWP Learning and Development Ltd Page 136

A shared workbook must be stored on a shared network drive or in a shared folder. Any individual with access to the shared drive or folder can access the file.

If you want to limit access to a shared workbook, you can assign a password to it before you share it. Then, only those users who know the password can open the workbook.

After saving a workbook as a shared file, the text [Shared] appears next to the workbook name on the title bar.

Procedure 1. To enable workbook sharing, first open the workbook you want to share. 2. Click the Review tab. 3. Click the Share Workbook button. 4. Click the Editing tab. 5. Select the Allow changes by more than one user at the same time check box. 6. Click the OK button. 7. Click the OK button to save the workbook.

Page 137: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Shared Workbooks

WWP Learning and Development Ltd Page 137

VIEWING USERS SHARING A WORKBOOK

Discussion More than one user can use a shared workbook at the same time. In the Shared Workbook dialog box, you can see which users are working on a shared workbook at any given time.

Excel lists users by their user name. You can change your user name in the User name box on the Popular page (Excel 2007) in the Excel Options dialog box or in Excel 2010, the General page.

Excel 2007

Excel 2010

Page 138: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Shared Workbooks

WWP Learning and Development Ltd Page 138

VIEWING SHARED WORKBOOK CHANGES

Discussion When more than one user is sharing a workbook, each user works in a separate copy of the workbook. When one user saves changes, the changes are saved to the single shared workbook on the shared resource. Before you save your copy of the shared workbook, you can view the changes made by other users.

Changes appear in a different colour for each user; the row and column headings of changed cells are highlighted; a collared border appears around each changed cell; and a comment marker appears in the upper, left corner of each changed cell. When accessed, each comment box indicates the date and time of the change, the user who made the change, and the actual change itself. As soon as you modify the workbook, however, the change indicators are removed from it.

Excel can only highlight those changes made to cell contents, including moving and pasting cell contents and inserting or deleting rows and columns. Other changes, such as formatting, are not highlighted.

Changes made by all users since you last used a workbook appear when you open the workbook.

If a comment is attached to a changed cell, both the comment and the details of the change appear in a single comment box.

The boxes around highlighted cells print when you print the shared workbook. To hide the highlighting for printing, deselect the Highlight changes on screen option in the Highlight Changes dialog box.

Procedure 1. To view the changes made to a shared workbook, first click the Track Changes

button in the Changes group of the Review ribbon 2. Click on Highlight Changes… 3. Choose options as you want. 4. Click the OK button 5. Changes are indicated by a coloured cell corner 6. Moving the mouse cursor to a highlighted cell displays a comment indicating who

changed what and when

Page 139: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Shared Workbooks

WWP Learning and Development Ltd Page 139

CHANGING SHARING OPTIONS

Discussion You can determine how often changes made by other users are updated to a shared workbook. By default, saved changes are updated each time you save the workbook. You can, however, specify that changes be updated at timed intervals, from 5 to 1440 minutes. For example, if Friday is a major shipping day and you are working in the order entry workbook, you can update changes every fifteen minutes to see which orders have been shipped.

If you have configured a shared workbook to be updated at a timed interval, you can also have Excel save the file at the same time.

Procedure 1. To change the update frequency of a shared workbook, first click the Review tab. 2. In the Changes group, click the Share Workbook button. 3. In the Share Workbook dialog box, click the Advanced tab. 4. In the Update changes section, select from the available options. 5. Click the OK button.

Page 140: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Shared Workbooks

WWP Learning and Development Ltd Page 140

MANAGING CONFLICT CHANGES

Discussion If more than one user is working in a shared workbook, and each user is saving changes, the changes made may conflict with one another. Conflicting changes refer to changes made to the same cell by two different users and come into play when more than one user saves changes to the shared workbook.

You can decide how you want to resolve conflicting changes; you can review the conflicting changes, or you can have your changes override the conflicting changes saved previously.

Each user can independently set conflicting changes options. All users, however, have the same priority; consequently, the user who saves the shared workbook last can have his or her changes override all conflicting changes.

Procedure 1. To resolve conflicting changes, open the Share Workbook dialog box 2. Click the Advanced tab. 3. In the Conflicting changes between users section, select the most appropriate

option 4. Click the OK button.

Page 141: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Shared Workbooks

WWP Learning and Development Ltd Page 141

SETTING THE CHANGE HISTORY OPTIONS

Discussion When Excel tracks changes in a workbook, it creates a change history. The change history tracks the details of each change made to a shared workbook.

You can specify the number of days you want to maintain the change history. For example, if the turn-around time for an order in an order entry workbook is forty-five days, you can modify the change history to track changes for forty-five days, thereby synchronizing it with the shipping cycle.

Procedure 1. To indicate how long to keep changes, open the Share Workbook dialog box. 2. Click the Advanced tab. 3. In the Track changes section, select whether or not to keep the changes history and,

if so, for how long. 4. When selected, click the OK button.

Page 142: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Shared Workbooks

WWP Learning and Development Ltd Page 142

CELL COMMENTS

Discussion Any cell on a worksheet can contain a comment. A cell containing a comment shows a red triangle in the right upper corner of the cell.

Comments are hidden, by default, and are visible only when the mouse cursor is held over a cell with a red triangle.

Procedure Adding a comment

1. To create a comment, first click the cell to which you intend to add a comment. 2. Click the Review tab. 3. In the Comments group, click the New Comment button. 4. Type your comment in the comment box. 5. Click outside the comment box when you have finished typing the comment (or

press the [Esc] key).

Page 143: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Shared Workbooks

WWP Learning and Development Ltd Page 143

Editing a Comment

1. To edit a comment, first click the cell with the comment you wish to edit. 2. Click the Review tab. 3. In the Comments group, click the Edit Comment button. 4. Make any changes you wish using the conventional text editing tools. 5. Press the [Esc] key twice to close the comment box.

Deleting a comment

When a comment needs to be deleted, the cell containing the comment is selected and the Delete button in the Comments group is pressed.

ADDING A HISTORY WORKSHEET

Discussion You can display the change history in a separate worksheet.

A History worksheet is added to the end of the shared workbook and displays the following information:

Page 144: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Shared Workbooks

WWP Learning and Development Ltd Page 144

Variable Description Action Number A number assigned to the change

Date The date the change was made

Time The time the change was made

Who The name of the user who made the change

Change The type of change made (e.g., cell change, inserted row, etc.)

Sheet The sheet on which the change was made

Range The cell or range in which the change was made

New Value The new cell value

Old Value The replaced cell value

Action Type Displays Won if a later change discarded an existing change

Losing Action Displays the row number in the History worksheet of the discarded or losing action

AutoFilter arrows allow you to filter the information in the History worksheet.

The changes displayed on the History worksheet depend on the When, Who, and Where options selected in the Highlight Changes dialog box.

The History worksheet is removed from the workbook as soon as you save or close the workbook.

Procedure 1. To add a History worksheet to a shared workbook, first open the shared workbook. 2. Click the Review tab. 3. In the Changes group, click the Track Changes button. 4. Click on Highlight changes.

Page 145: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Shared Workbooks

WWP Learning and Development Ltd Page 145

5. Remove all checks from the When, Who, and Where, check boxes. 6. Click to put a check in the List changes on a new sheet check box. 7. If a message box is displayed, you must remove the checks in the When, Who and

Where boxes. 8. The History worksheet is added to the workbook.

NB The following message may sometimes appear when creating a history of changes.

REVIEWING TRACKED CHANGES

Discussion You can review changes made to a shared workbook and accept or reject them as desired. For example, if a user entered incorrect information in a data entry workbook, you can reject all changes made by that user.

When you review changes, all changes meeting the selected criteria appear. You can then either accept or reject changes individually or all at one time.

If the file is not saved or has unresolved conflicts when you review changes, Excel prompts you to save the file and resolve the conflicts.

Procedure 1. To review tracked changes, first open the shared workbook you wish to review. 2. Click the Review tab. 3. In the Changes group, click the Track Changes button. 4. Click the Accept/Reject Changes button. 5. In the Select Changes to Accept or Reject dialog box, choose the options you want

from the When, Who, and Where , boxes. 6. Click the OK button. 7. In the Accept or Reject Changes dialog box, click on one of the accept or reject

buttons as required. 8. The Accept and Reject buttons will allow you to appraise each change before

deciding. 9. The Accept All and Reject All buttons do not give you the chance to look at each

change in turn. 10. When the changes have been accepted, or rejected, click the Close button.

Page 146: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Shared Workbooks

WWP Learning and Development Ltd Page 146

REMOVE A WORKBOOK FROM BEING SHARED

Discussion There may come a time when you want to restore a shared workbook to exclusive use only. If other users have the workbook open while this is done, they will be unable to save their changes. Restoring a workbook to exclusive use also deletes any change history contained in the workbook so should, ideally, only be done after any tracked changes have been accepted or rejected.

Procedure 1. Open the workbook you want to remove from shared use. 2. Select the Review tab. 3. Click the Share Workbook command. 4. Click the Editing tab. 5. Deselect the Allow changes by more than one user at the same time check box. 6. Click the OK button. 7. Click Yes to the warning message.

Page 147: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Using Shared Workbooks

WWP Learning and Development Ltd Page 147

EXERCISE

Share workbooks.

1. Open Less5ex. 2. Share the workbook. At the same time, select options to automatically update

changes every 10 minutes, to keep the change history for 45 days, and to review conflicting changes.

3. Pair off with another student. Each student in a pair must open the same, shared workbook.

4. The first student should add 100 to each of the values in the Feb column and then save the file.

5. The second student should add 100 to each of the values in the Mar column and then save the file.

6. Highlight tracked changes for all changes not yet reviewed, by everyone, and for the entire worksheet.

7. The second student should change the Jan, Week1 figure to 3700 and save the file. 8. The first student should change the Jan, Week1 figure to 3650 and save the file. The

first student should then accept the other student’s changes in the Resolve Conflicts dialog box.

9. Add a History worksheet to the workbook, for all changes made by all users. Then, review the History worksheet.

10. Close all open workbooks without saving them.

Page 148: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

WWP Learning and Development Ltd Page 148

APPENDIX B - CUSTOMISING EXCEL PREFERENCES

In this lesson, you will learn how to:

• Set Display options

• Set Formula options

• Set Editing options

Page 149: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Customising Excel Preferences

WWP Learning and Development Ltd Page 149

CONCEPTS AND TERMS

Discussion The options, in the Show/Hide group on the View ribbon, and in the Sheet options group of the Page Layout ribbon, allow you to choose which elements appear in and around the worksheet window.

The Excel Options dialog box contains many items for you to customise your view and the way in which Excel is required to calculate and display objects.

Some options, such as Formulas, Gridlines and Row & column headers, affect only the active worksheet. Other options affect all the worksheets in a workbook.

By default, gridlines appear on the screen to define each cell in a worksheet. Deselecting the Gridlines option hides the screen gridlines; when the gridlines are hidden, you can use borders to define specific areas in a worksheet.

Procedure 1. To select options to be displayed on screen, first click the View tab. 2. In the Show/Hide group, click to set, or remove, the checks in the following options: • Ruler (only available in Page Layout and Page Break Preview) • Gridlines • Message Bar • Formula Bar • Headings

Page 150: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Customising Excel Preferences

WWP Learning and Development Ltd Page 150

EXCEL DISPLAY OPTIONS

Discussion You can customise the way Excel is displayed when you are working on a worksheet. In Excel 2007, all display options are in the Advanced pane of the Excel Options dialog box. In Excel 2010, there is a separate Display pane of the Options dialog box PLUS a section in the Advanced pane. All these options allow you to change the way you view a worksheet or workbook to suit your needs.

Excel 2007

Page 151: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Customising Excel Preferences

WWP Learning and Development Ltd Page 151

Excel 2010

Procedure Display option

1. To change the workbook display options, click the Office button (Excel 2007) or the File tab (Excel 2010).

2. Click the Excel Options button (Excel 2007) or the Options button (Excel 2010). 3. In the left pane, click Advanced. 4. Click the Display options for this workbook list arrow. 5. Select the option where you want to apply display options. 6. Select the workbook display options you want: 7. Show horizontal scroll bar to display horizontal scroll bars. 8. Show vertical scroll bar to display vertical scroll bars. 9. Show sheet tabs to display worksheet tab(s). 10. Group dates in the AutoFilter menu to group the list of dates at the bottom of the

AutoFilter menu in a date filter. 11. For objects, show All or Nothing as to whether to display objects. 12. Click the OK button.

Excel 2007

Page 152: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Customising Excel Preferences

WWP Learning and Development Ltd Page 152

Excel 2010

Advanced display option

1. To change the advanced options, first click the Office button (Excel 2007) or the File tab (Excel 2010).

2. Click the Excel Options button. 3. In the left pane, click on Advanced. 4. Click the When calculating this workbook list arrow. 5. Select the option where you wish to apply the display options. 6. Set the calculating options you want. 7. Update links to other documents. 8. Set precision as displayed. 9. Use 1904 date system. 10. Save external link values. 11. In the General section, select the options you want. 12. Provide feedback with sound. 13. Provide feedback with animation. 14. Ignore other applications that use Dynamic Data Exchange (DDE). 15. Add to update automatic links. 16. Show add-in user interface errors. 17. Scale content for A4 or 8.5 x 11” paper sizes. 18. When you have finished setting options, click the OK button.

Page 153: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Customising Excel Preferences

WWP Learning and Development Ltd Page 153

Excel 2007

Excel 2010

EXCEL FORMULA OPTIONS

Discussion In addition to the display options, the Advanced pane in the Excel Options also provides options when calculations are being performed in a worksheet. The precision option can be used to change stored values in cells from the full precision of 15 digits.

Performing calculations is one of the most important parts of the use of Excel and you can customise the way Excel handles your formulas.

Procedure 1. To set formula options, first click the Office button or File tab in Excel 2010. 2. Click the Excel Options button.

Page 154: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Customising Excel Preferences

WWP Learning and Development Ltd Page 154

3. In the left pane, click on Formulas. 4. Set the calculation options to your requirements. 5. Workbook calculation: • Automatic • Automatic except for data tables • Manual. • Enable iterative calculation used to allow nested calculations.

6. Set the formula options to your requirements. • R1C1 reference style used to label columns and rows numerically. • Formula AutoComplete • Use the table name in formulas • Use GetPivotData functions for PivotTable references

7. When you have set your options, click the OK button.

Excel 2007

Page 155: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Customising Excel Preferences

WWP Learning and Development Ltd Page 155

Excel 2010

THE EDITING OPTIONS

Discussion You can use the options on the Editing options section in the Excel Options dialog box to control basic copying, editing, and data entry tasks.

The default direction of the active cell after pressing the [Enter] key is down. When you enter data into a cell and press the [Enter] key, the active cell moves down one row.

If you are entering data across a row, instead of down a column, it would be more efficient to have the active cell move to the right. You can change the direction of the active cell movement to up, down, right, or left.

Procedure 1. To set the editing options, first click the Office button (Excel 2007) or the File tab

(Excel 2010). 2. Click the Excel Options (Excel 2007) or Options button (Excel 2010). 3. In the left hand pane, click on Advanced. 4. In the Editing options section, set options as you need for: • After pressing Enter • Automatically insert a decimal point • Enable fill handle and drag-and-drop • Allow editing directly in cells • Extend data range formats and formulas • Enable automatic percent entry • Enable AutoComplete for cell values • Zoom on roll with Intellimouse

Page 156: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Customising Excel Preferences

WWP Learning and Development Ltd Page 156

• Alert user for time consuming operations • Use system separators

5. When you have set your options, click the OK button.

Excel 2007

Excel 2010

Page 157: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 Customising Excel Preferences

WWP Learning and Development Ltd Page 157

EXERCISE

Customise Excel preferences.

1. Open Custopt. 2. Hide the gridlines and zero values. 3. Change the Move selection after Enter option so that the active cell

moves to the right after pressing [Enter]. 4. Enter the following information into row 8, pressing [Enter] after typing

each entry. QTY PART # UNIT

PRICE

5 LT460 45.95

5. Change the number of sheets in a new workbook to 5. 6. Create a new workbook. The workbook should contain five worksheets. 7. Save the new workbook to the student data folder as Regtenq2. 8. Reset the Move selection after Enter option to Down, reset the Sheets in

new workbook to 3. 9. Close all open workbooks without saving them.

Page 158: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

WWP Learning and Development Ltd Page 158

APPENDIX C - THE WEB, HTML, PDF, XPS & XML FILE FORMATS

In this lesson, you will learn how to:

• Preview a web page

• Create a hyperlink

• Edit a hyperlink

• Remove a hyperlink

• Save a worksheet as a web page

• Use publishing options

• Open an HTML file

• Save a workbook in a PDF or XPS format

• Export a workbook in an XML format

Page 159: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 The Web, HTML and XML Files

WWP Learning and Development Ltd Page 159

CONCEPTS AND TERMS

Discussion Excel provides the tools necessary in order to create and save your workbooks as a Web page, and to publish them on the Web. Any workbook can easily be saved as a Web document and viewed in a Web browser.

You can share a workbook or worksheet with other users by publishing it to the Internet or to an intranet, where users can view it in a browser.

Workbooks or worksheets must be saved in an HTML format before they can be viewed in a browser. If a multiple sheet workbook is viewed in a browser, the sheet tabs appear in the browser and can be used to view the other sheets.

You can use the Web Page Preview command to view how the data in the workbook or worksheet will appear in a browser before you save it in HTML format.

PREVIEWING A WEB PAGE

Discussion Any Excel worksheet can be viewed as if it were already on the Web by previewing the Web page. By previewing the workbook you want to publish on the Web, you can see if there are any changes, problems, or errors that must be fixed.

Procedure To view a workbook as a Web page, you have to add a command button to the Quick Access toolbar as follows:

1. Click the Customise Quick Access Toolbar drop down arrow and select More Commands....

2. Select All Commands from the Choose commands from: list.

Page 160: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 The Web, HTML and XML Files

WWP Learning and Development Ltd Page 160

3. Scroll down the list at the left (almost to the bottom) and select Web Page

Preview.

4. Click the Add >> button. 5. Click OK. 6. Click the Web Page Preview button.

7. The workbook is displayed as a Web page in your browser. 8. If there is more than one worksheet, view each worksheet in turn.

Page 161: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 The Web, HTML and XML Files

WWP Learning and Development Ltd Page 161

CREATING A HYPERLINK

Discussion Hyperlinks are cells or graphic objects that you can use to link to web pages or other files. Clicking a hyperlink opens the related web page or workbook.

The Insert Hyperlink button allows you to specify the file or URL to which you want to link.

When a cell is hyperlinked, the text in the cell appears in blue, underlined characters. In addition, when you point to a hyperlinked cell or object, the mouse pointer changes into a pointing hand, and the location of the hyperlinked page appears in a ScreenTip.

Instead of displaying the hyperlinked page location, you can substitute customised text in a ScreenTip.

You can create a link to another place within the same file using a Bookmark. You can also use a bookmark to indicate a location in a target file. By specifying a location within the target file, that section of the file appears whenever you click the link. A location in a

Page 162: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 The Web, HTML and XML Files

WWP Learning and Development Ltd Page 162

workbook can include a cell address, a range of cells, a worksheet name, or a defined cell name.

You can also type a hyperlink directly into a worksheet cell. Excel automatically recognizes URLs (web page addresses) when they are entered into a cell and formats them as hyperlinks.

Procedure 1. To create or edit a hyperlink, first select the cell or object where you intend to create

or edit a hyperlink. 2. Click the Insert tab. 3. In the Links group, click the Hyperlink button (or press [Ctrl+K]. 4. In the Link to: bar, select one of: 5. Existing File or Web Page 6. Place in this document 7. Create New Document 8. E-mail Address 9. In the Text to display: box, type a name if necessary. 10. In the Look in: box, locate the target for the Hyperlink. 11. When you have made your selections, click the OK button. 12. The cell chosen for the Hyperlink is now blue and underlined, indicating its status.

A typical web page URL can be typed as www.webpagename.com.

To refer to a file stored on a local or network drive, the protocol file:\\ must precede the path to the file (eg., file:\\c:\data\equip.xls).

Adding a ScreenTip

1. To create a ScreenTip for a Hyperlink, first select the Hyperlink you intend to have a ScreenTip.

2. Click the Insert tab. 3. In the Links group, click on Insert Hyperlink. 4. In the Edit Hyperlink dialog box, click the ScreenTip… button. 5. In the Set Hyperlink ScreenTip dialog box, type the text you want for the

ScreenTip. 6. Click the OK button. 7. In the Edit Hyperlink dialog box, click the OK button. 8. When the mouse cursor is held over the Hyperlink, the ScreenTip is displayed.

Page 163: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 The Web, HTML and XML Files

WWP Learning and Development Ltd Page 163

Removing a hyperlink

1. To remove a Hyperlink, use the right mouse button to click the cell or object containing the Hyperlink.

2. From the menu, select the Remove Hyperlink item. 3. You can also use the Edit Hyperlink dialog box to remove a Hyperlink.

SAVING A WORKSHEET AS A WEB PAGE

Discussion You can use the Save as Web Page command to convert your Excel file to the HTML (Hypertext Markup Language) file format, the file format used by web pages. When you save an Excel file as a HTML file, the file can be viewed by web browsers (such as Internet Explorer and Netscape Navigator). An Excel file can be linked from and to other web pages, as well as become part of a web on the Internet or an intranet.

Web pages can be saved to a folder or directly to a web server or FTP site.

When you save a worksheet as a Web page, you can save it using the Web Page, or Single File Web Page, format. The Web Page format saves your worksheet as a HTML file and a folder that stores any supporting files, such as worksheets, graphics, etc. where Excel selects the considered most appropriate graphic format based on the image’s content. A Single File Web Page saves all the elements of a Web site, including the text and graphics, in one file in the MHTML format, which is supported by Internet Explorer 4.0.1 or later.

Page 164: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 The Web, HTML and XML Files

WWP Learning and Development Ltd Page 164

Procedure 1. To save a workbook or worksheet as a web page, first open the workbook you intend

to set up as a web page. 2. Click the Office button (Excel 2007) or the File tab (Excel 2010). 3. In the Office menu, click on Save As. 4. In the Save As dialog box, locate, and select, the destination for the saved file. 5. In the File name: box, type the name for the file. 6. In the Save as type: box, select Web Page or Single File Web Page accordingly. 7. Click the Change Title… button if you wish to alter the title. 8. In the Set Page Title dialog box, type the required name. 9. Click the OK button. 10. Click the Save button. 11. If necessary, click on Yes in the Message box to keep the workbook formatting.

In addition to saving the entire workbook, you can save a worksheet or selected range as an HTML file.

In the Publish... dialog box, you can select whether you want the web page to automatically update when the Excel worksheet that it was created from is changed, change the location that you are saving it to or specify that you want it opened in your browser upon saving it.

Page 165: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 The Web, HTML and XML Files

WWP Learning and Development Ltd Page 165

You can also change the title that appears on the web page before you save it. The title of a web page appears in the title bar of the browser. The web page title differs from the file name.

USING THE PUBLISHING OPTIONS

Discussion You can set additional Web options by clicking the Publish button in the Save as (Web Page) dialog box.

You can select the item you want to publish. Items include the entire workbook, specific worksheets, or a range of cells. In addition, you can view items previously published from the workbook.

Enabling the AutoRepublish every time this workbook is saved option guarantees that the most recent changes to the workbook are always saved to the published web page.

You can select the Open published web page in browser option to display the published web page in the web browser as soon as it is saved.

Page 166: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 The Web, HTML and XML Files

WWP Learning and Development Ltd Page 166

Procedure 1. To save and publish a worksheet as an interactive web page, first select the range

you want saved as a Web page. 2. Click the Office button. 3. Click on Save As. 4. Specify the location for the Web page. 5. Specify the file name. 6. Select whether to use the Selection: Sheet, or Entire Worksheet option. 7. If necessary, type in a Title by using the Change Title… button. 8. Click the Publish… button. 9. In the Publish as Web Page dialog box, use the Choose: list arrow to select the items

you want to publish. 10. Select, or clear, the AutoPublish every time this workbook is saved check box. 11. Select, or clear, the Open published web page in browser check box. 12. When the options have been set, click the OK button.

OPENING AN HTML FILE

Discussion When you save an Excel worksheet or part of an Excel worksheet as an HTML file, the HTML file does not automatically appear. You must open the HTML file to view the new format. You can open the HTML file in Excel or your browser.

Procedure 1. To open a HTML file while in Excel, first locate the folder containing the HTML file. 2. Click the Office button (Excel 2007) or the File tab (Excel 2010). 3. In the menu, click Open. 4. In the Files of type: box, select All Web Pages.

Page 167: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 The Web, HTML and XML Files

WWP Learning and Development Ltd Page 167

5. Clicking the Open button arrow allows you to select from the options, one of which

is to open the file in your Browser. 6. The HTML file is displayed in Excel (or interactively in your Browser if you so

choose).

SAVING AS PDF OR XPS

Discussion Sometimes you want to save files so that they cannot be modified, but you still want them to be easy to share and print. With Excel 2010 that you can convert files into PDF or XPS formats without needing additional software or add-ins. Use this when you want a document that:

• Looks the same on most computers

• Has a small file size

• Complies with an industry format

Examples include resumes, legal documents, newsletters, files intended to only be read and printed, documents intended for professional printing.

NB Once you have saved a document as a PDF or XPS file, you cannot convert it back to a Microsoft Office file format without specialised software or a third-party add-in.

You can also save files as PDF or XPS in Excel 2007 but you need to download an Add-In from the Microsoft website.

Page 168: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 The Web, HTML and XML Files

WWP Learning and Development Ltd Page 168

(http://www.microsoft.com/downloads/en/details.aspx?FamilyID=f1fc413c-6d89-4f15-991b-63b07ba5f2e5&displaylang=en

It is very likely that in the working environment, your IT department will have installed this extra component on your computer.

Portable Document Format (PDF)

PDF preserves document formatting and enables file sharing. When the PDF format file is viewed online or printed, it retains the format that you intended. Data in the file cannot be easily changed, and can be explicitly set to prohibit editing. The PDF format is also useful for documents that will be reproduced using commercial printing methods. PDF is accepted as a valid format to many agencies and organizations, and viewers are available on a wider variety of platforms than XPS.

Important To view a PDF file, you must have a PDF reader installed on your computer such as the Acrobat Reader, available from Adobe Systems.

XML Paper Specification (XPS)

XPS is a platform-independent technology that also preserves document formatting and enables file sharing. When the XPS file is viewed online or printed, it retains exactly the format that you intended, and the data in the file cannot be easily changed. XPS embeds all fonts in the file so they appear as intended, regardless of whether the specified font is available on the recipient's computer, and has more precise image and colour rendering on the recipient's computer than PDF.

Procedure (Excel 2007) 1. Click the Office Button. 2. Hover the mouse pointer over the Save as command. 3. Select PDF or XPS.

4. In the File Name box, enter a name for the file. 5. In the Save as type list, select PDF (*.pdf) or XPS Document (*.xps).

Page 169: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 The Web, HTML and XML Files

WWP Learning and Development Ltd Page 169

6. If you want the file to open in the selected format after saving, select the Open file

after publishing check box (only available if you have a PDF reader program installed, eg Acrobat).

7. If the document requires high print quality, click Standard (publishing online and printing).

8. If file size is more important than print quality, click Minimum size (publishing online).

9. Click Options to set the page to be printed, to choose whether markup should be printed, and to select output options. Click OK when finished.

10. Click Save.

Procedure (Excel 2010) 1. Click the File tab. 2. Click Save & Send.

3. Select Create PDF/XPS Document. 4. Click the Create PDF/XPS button.

Page 170: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 The Web, HTML and XML Files

WWP Learning and Development Ltd Page 170

5. In the File Name box, enter a name for the file. 6. In the Save as type list, select PDF (*.pdf) or XPS Document (*.xps).

7. If you want the file to open in the selected format after saving, select the Open file

after publishing check box (only available if you have a PDF reader program installed, eg. Acrobat).

8. If the document requires high print quality, click Standard (publishing online and printing).

9. If file size is more important than print quality, click Minimum size (publishing online).

10. Click Options to set the page to be printed, to choose whether markup should be printed, and to select output options. Click OK when finished.

11. Click Save.

MAKE CHANGES TO A PDF OR XPS FILE

Discussion Because the purpose of PDF and XPS files is to keep them from being modified, you cannot easily convert or save a PDF or XPS file into another file format if you do not have the source file.

Procedure 1. Open the original Excel file and make your changes. 2. Save the file in PDF or XPS format again.

Or

Use a third-party application, such as Adobe Acrobat Professional, or visit Microsoft Office Marketplace to find other conversion products. After you purchase a third-party solution, follow the vendor's instructions about how to install and use it.

Page 171: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 The Web, HTML and XML Files

WWP Learning and Development Ltd Page 171

EXPORTING TO XML

Discussion XML (Extensible Markup Language) is a data interchange format that can be used to integrate data from different systems running on different platforms. XML is used to summarize content, maintain structure, and provide compatibility between systems.

XML allows developers to describe and deliver structured data from any application in a standard, consistent way. Developers create their own customized tags, which allow commands to be inserted into a document that specify how the document should be presented. XML can be thought of as an outline, in which all of the elements have been defined.

XML was not designed to replace HTML. Rather, it was designed to enhance the limitations of HTML. HTML is used to control the presentation of data, while XML is designed to define the structure of the data. XML tags describe the data, but do not define the document formatting. Separating the data from its formatting allows the presentation of the same data in different formats.

XML documents are known as “well-formed” documents. They must adhere to certain conventions and protocols. XML features are built into Office 2007 and Office 2010 applications, such as Microsoft Excel, Word, PowerPoint, and Access, to support the exchange of data.

You can export a workbook to a well-formed XML file by saving the workbook as an XML spreadsheet. However, you cannot save an individual worksheet or selection to an XML file; you must save the entire workbook.

Excel also creates an XML document that is saved when you publish an entire workbook as a web page (HTML document). Excel creates the XML document in a subfolder under the folder containing the saved web page. XML documents are not created if you save a single worksheet or selection to a web page.

Other files associated with XML documents are stylesheets (.xsl) and schemas (.xsd). Stylesheets can be applied to XML documents to control the appearance of XML data on a web page. Schemas define the structure of the data with a format that web browsers and other programs that recognize XML software, understand.

You can open an XML spreadsheet directly in Excel or import XML data from a web page or web server. You can create, edit, or view an XML document in Notepad. Notepad is often used to create HTML and XML documents because it is an ASCII editor, which prevents you from saving the file with formatting or special characters that may cause errors.

Page 172: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 The Web, HTML and XML Files

WWP Learning and Development Ltd Page 172

Procedure 1. To save an Excel file as XML, use the Save As dialog box 2. Select XML Data from the Save as type: list. 3. Click OK.

Page 173: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 The Web, HTML and XML Files

WWP Learning and Development Ltd Page 173

EXERCISE

Save and view worksheet ranges as web pages.

1. Open Region16. 2. Display the Northeast sheet, if necessary. 3. Create a hyperlink in the merged cell D12. Link it to the Regnlink workbook. 4. Try the link and then close the Regnlink workbook. 5. Select the range A1:E13 in the Northeast worksheet. 6. Save the range to the student data file as a web page. Name it nehtml1. Change its

title to Northeast Q1 Sales. 7. Open nehtml1 in Excel. Preview nehtml1 in the browser. Try the link. Then, close

the browser window and the nehtml1 html file. 8. Publish the Central worksheet. Name it Central and change its title to Central Q1

Sales. Have it Autorepublish every time the worksheet is saved, and have the published web page open in a browser after you publish it. Then, close the browser.

9. Hide the Web toolbar. 10. Close all open workbooks without saving them.

Page 174: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

WWP Learning and Development Ltd Page 174

Index

A

Absolute references using in macros.................................................... 122

D

Data changing external data range properties ................ 41 exporting to other applications .............................. 34 importing ............................................................... 38 importing dynamic from the Web ......................... 47 importing from other applications ......................... 43 importing from text files........................................ 39 removing the query definition ............................... 47 solving problems ................................................... 64

Data tables ................................................................. 74 creating one-variable ............................................. 75 creating two-variable ............................................. 76 placing formulas in ................................................ 74

Date functions ............................................................ 29

E

Exporting data to other applications ....................................... 34 to XML ................................................................ 172

F

Functions date ........................................................................ 29

G

Goal Seek ................................................................... 60

H

HTML files opening in Excel .................................................. 167 saving worksheets as ........................................... 164

Hyperlinks creating ................................................................ 162

I

Importing changing external data range properties ................ 41 data ........................................................................ 38 data from other applications .................................. 43 data from text files ................................................. 39 dynamic data from the Web .................................. 47 removing the query definition ............................... 47

M

Macro buttons .......................................................... 128 copying ................................................................ 129 creating ................................................................ 128 deleting ................................................................ 132 formatting ............................................................ 130 moving................................................................. 131

sizing ................................................................... 131 Macros

assigning a shortcut key ....................................... 124 defining ................................................................ 113 deleting ................................................................ 123 opening a workbook containing........................... 113 recording .............................................................. 120 removing custom menu items .............................. 127 using absolute references ..................................... 122 using relative references ...................................... 122

MATCH function using ...................................................................... 13

Menus removing custom menu items .............................. 127

P

Preferences setting Edit options .............................................. 156 setting View options ............................................ 150

Publishing web pages ............................................... 166

S

Scenario Manager ...................................................... 53 Goal Seek .............................................................. 60

Scenarios creating .................................................................. 53 creating a summary report ..................................... 57 editing .................................................................... 56 saving Solver solutions as ...................................... 68 using the Scenario Manager .................................. 53

Shortcut keys assigning to macros ............................................. 124

Solver ......................................................................... 64 changing constraints .............................................. 69 creating reports ...................................................... 70 restoring the original values .................................. 68 saving a solution as a scenario ............................... 68

T

Templates ................................................................... 97 creating default .................................................... 109 deleting ................................................................ 107 editing .................................................................. 105 inserting a new worksheet ................................... 106 saving a workbook as ............................................ 98 using to create a workbook .................................. 104

Tracked changes managing conflicting ........................................... 141 reviewing ............................................................. 146 setting change history options ............................. 142

W

Web pages previewing ........................................................... 160 using publishing option ....................................... 166

Workbooks

Page 175: Excel 2010: Level 1 - Key Training · LESSON 1 –ADVANCED LOOKUP AND AGGREGATION FUNCTIONS In this lesson, you will learn how to: • Use the Index Function • Use Match Function

Microsoft Excel 2007/2010 - Level 4 The Web, HTML and XML Files

WWP Learning and Development Ltd Page 175

adding a History worksheet ................................. 144 changing the update frequency for shared ........... 140 managing conflicting changes ............................. 141 opening those containing macros ........................ 113 reviewing tracked changes .................................. 146 saving as a template ............................................... 98 saving shared ....................................................... 136 setting change history options ............................. 142 sharing ................................................................. 136 viewing shared changes ....................................... 139 viewing users sharing .......................................... 138

Worksheets

adding History ..................................................... 144 inserting based on a template ............................... 106 using publishing options ...................................... 166

World Wide Web importing dynamic data ......................................... 47

X

XML exporting to .......................................................... 172 saving workbooks as ............................................ 172