You are on page 1of 210

Advanced

Training Manual

Excel 2007
training.csulb.edu

Table of Contents
SECTION 1: Advanced Topics ...................................................................................................... 1
Lesson 1.1: Setting Excel Options ......................................................................................................... 2
Changing Your User Name ..................................................................................................................................3 Changing your Default Font ................................................................................................................................ 5 Changing Your Default File Format ....................................................................................................................6 Setting Formula Options ......................................................................................................................................8 Changing the Appearance of Your Excel Interface ............................................................................................ 13

Lesson 1.2: Excel and Windows .......................................................................................................... 16


Searching for Documents ................................................................................................................................... 16 Using Office Diagnostics ................................................................................................................................... 20 Checking for Updates......................................................................................................................................... 23 Starting Excel Automatically when Windows Boots ........................................................................................... 25

Lesson 1.3: Using the Excel Viewer..................................................................................................... 27


What is the Excel Viewer?.................................................................................................................................. 27 Downloading the Excel Viewer .......................................................................................................................... 28 Using Excel Viewer ............................................................................................................................................ 31

Section 1: Review Questions ................................................................................................................ 38

SECTION 2: Getting the Most from your Data .......................................................................... 40


Lesson 2.1: Getting the Most From Your Data .................................................................................. 41
Using Automatic Outlining ................................................................................................................................ 41 Displaying and Collapsing Levels...................................................................................................................... 43 Grouping Data Manually ................................................................................................................................... 45 Creating Subtotals.............................................................................................................................................. 49

Lesson 2.2: PivotTables ........................................................................................................................ 52


What is a PivotTable? ........................................................................................................................................ 52 Creating a PivotTable ........................................................................................................................................ 53 Creating a PivotTable Frame ............................................................................................................................ 58 Specifying PivotTable Data................................................................................................................................ 60 Rearranging PivotTable Data ............................................................................................................................ 63

Lesson 2.3: More About PivotTables .................................................................................................. 70


Modifying PivotTable Calculations ................................................................................................................... 70 Formatting a PivotTable .................................................................................................................................... 73 Refreshing a PivotTable ..................................................................................................................................... 77 Charting a PivotTable ........................................................................................................................................ 78 Creating a PivotTable Based on External Data ................................................................................................. 83

Lesson 2.4: Exploring Scenarios.......................................................................................................... 90


What is a Scenario? ........................................................................................................................................... 90 Creating a Scenario ........................................................................................................................................... 91 Creating a Scenario Summary Report ............................................................................................................... 94 Saving Multiple Scenarios.................................................................................................................................. 96

Lesson 2.5: What If Analysis ............................................................................................................... 98


Using a One and Two Input Data Table ............................................................................................................ 98 Using Goal Seek ............................................................................................................................................... 106 Using Solver ..................................................................................................................................................... 108

Section 2: Review Questions .............................................................................................................. 117

SECTION 3: Excel and the Internet ......................................................................................... 119


Lesson 3.1: Excel and Hyperlinks ..................................................................................................... 120
What is a Hyperlink? ........................................................................................................................................ 120 Inserting Hyperlinks ......................................................................................................................................... 122 Modifying Hyperlinks ....................................................................................................................................... 123 Using Hyperlinks in Excel ................................................................................................................................ 127

Lesson 3.2: Saving Workbooks as Web Pages ................................................................................. 131


HTM and MHTML Files .................................................................................................................................. 132 Saving a Workbook as a Web Page .................................................................................................................. 134 Saving a Worksheet as a Web Page ................................................................................................................. 136 Saving a Chart as a Web Page ......................................................................................................................... 137 Saving a Range as a Web Page ........................................................................................................................ 139

Lesson 3.3: Getting Data from the Internet ..................................................................................... 142


Importing from an External Data Source ........................................................................................................ 142 Creating a Web Query ..................................................................................................................................... 145 Saving a Web Query ......................................................................................................................................... 148 Refreshing a Web Query .................................................................................................................................. 150

Lesson 3.4: Excel and Office Servers ................................................................................................ 153


Publishing to a Document Server..................................................................................................................... 153 Saving to a Document Management Server ..................................................................................................... 156 Using Excel with Excel Services ...................................................................................................................... 158

Section 3: Review Questions .............................................................................................................. 165

SECTION 4: Advanced Excel Tasks ......................................................................................... 167


Lesson 4.1: Creating and Using Shared Workbooks ....................................................................... 168
Sharing a Workbook......................................................................................................................................... 169 Opening and Editing a Shared Workbook ........................................................................................................ 172 Tracking Changes ............................................................................................................................................ 173 Resolving Conflicts in a Shared Workbook ...................................................................................................... 177

Lesson 4.2: Using Custom AutoFill Lists .......................................................................................... 180


What is an AutoFill List? ................................................................................................................................. 180 Creating a Custom AutoFill List ...................................................................................................................... 181 Modifying a Custom AutoFill List .................................................................................................................... 183 Using a Custom AutoFill List ........................................................................................................................... 184

Lesson 4.3: Using the VLOOKUP Function..................................................................................... 186


Using VLOOKUP to Find Data ....................................................................................................................... 186 How to Find an Exact Match with VLOOKUP ................................................................................................ 189 Finding the Closest Match with VLOOKUP .................................................................................................... 190

Lesson 4.4: Linking, Consolidating, and Combining Workbooks ................................................. 191


Linking Workbooks .......................................................................................................................................... 191 Consolidating Workbooks ................................................................................................................................ 194 Combining Worksheets..................................................................................................................................... 197

Section 4: Review Questions .............................................................................................................. 200

Index ........................................................................................................................................... 202

SECTION 1: Advanced Topics


In this section you will learn how to:

Change your user name in Excel Change the default color scheme for Excel Set up formula options Change the default font for your workbooks Change the default file format for your workbooks Search for Excel documents Use Office diagnostics Check for updates Download Excel viewer Use the Excel viewer Start Excel on Windows boot

Microsoft Office Excel 2007 Advanced

Lesson 1.1: Setting Excel Options


As you know, Excel 2007 provides a host of features and functions that you can use to analyze, calculate, share, and format your data. What you may not know is that Excel 2007 also allows you to fine tune a number of its features by setting up Excel s options.

In this lesson, you will learn how to use the Excel Options window to change your user name, your default font, your default file format, your formula options, and the overall appearance of your Excel 2007 interface.

Microsoft Office Excel 2007 Advanced

Changing Your User Name


When you create a document with Excel 2007, your Excel user name will appear in the Properties dialogue box under the Summary tab. If you want another name to appear there, you can change your user name from within Excel. Also, if you must contribute to a shared workbook (see lesson 4.1) it is a good idea to enter a user name that can easily identify the work that you do. To enter a username in Excel 2007, first display the Office menu by clicking the Office menu button.

When the Office menu appears, click the Excel Options button near the bottom to display the Excel Options window.

When the Excel Options window appears, select the Popular option from the panel on the left.

Microsoft Office Excel 2007 Advanced

At the bottom of the Options Window, you will see a Personalize your Copy of Office heading, with a text field labeled User Name just under the heading.

You will see the currently active Office user name in the User name field. To change this name, just type in a new user name in the field, removing the old one. After you have done this, simply click the OK button at the lower right of the Excel Options window.

Now the new user name that you entered will appear in the properties of your Excel documents. It will also be used to identify you and any changes you make when working on a shared workbook.

Instructor Note: When you change the user name in Excel using Excel Options, the changes will effect the other applications in Office as well. This means that the new user name will appear in the properties of Word documents or PowerPoint presentations as well.

Microsoft Office Excel 2007 Advanced

Changing your Default Font


If you prefer to do most of your work with a particular font style and size, but you dont like the inconvenience of selecting a new font and font size every time you start Excel, you should consider changing the default font and font size in the Excel Options window. To do this, first display the Excel options window by clicking the Excel options button at the bottom of the Office menu, and then click the Popular option from the panel on the left.

When the pane is displayed, you will see options for changing the default font type and font size under the When creating new workbooks heading.

From the Use this font drop list, select the font type that you prefer, and then select the font size that you prefer from the Font Size drop list.

In this example, the font type has been changed to Times New Roman and a font size of 16 has been selected. If you click the OK button in the Excel Options window, you will see the following alert.

Microsoft Office Excel 2007 Advanced

This alert is simply telling you that the default font change will not take effect until you close and restart Excel 2007. To implement your changes, click the OK button on the alert and close Excel 2007. When you open Excel again, the new font and size that you specified will be used by default. Here is Excels default font.

Here is the new default font.

You can easily change the default font to another type or size if you wish by following the directions provided previously.

Changing Your Default File Format


If you find yourself constantly saving files as another file format (other than Excel 2007s default format of .xlsx), you can change the default file type from Excel 2007 to another type that is more appropriate to the work you are doing. For example, you may be using Excel 2007 to create several workbooks that must be compatible with Excel 98 or Excel 2003. Rather than specifying this file type in the Save As dialogue whenever you save a workbook, you can make this your default file format in the Excel Options window. Moreover, you can even change the default folder that your workbooks will be saved in.

Microsoft Office Excel 2007 Advanced

To change your default file format, click the Excel Options button at the bottom of the Office menu. When the Excel Options window appears, click the Save option from the panel on the left. In the Excel Options window, you will now see a Save Workbooks heading, with options to change the default file format and the default save location visible beneath.

Select the file format you want as your default from the Save files in this format drop list. To change where your files will be saved, type the path to your default save location in the Default Save Location field.

In this example, the default file type has been changed to Excel 97-2003 workbook, and the default save location is now C:\Documents and Settings\Jim\Budget2007. (Remember when typing in a folder path, folder names are separated with a \ backslash.) To implement the changes you make, click the OK button on the lower right of the Excel Options window.

Microsoft Office Excel 2007 Advanced

Setting Formula Options


Excel 2007 provides some interesting options for working with formulas and modifying how Excel calculates. To get access to these options, you must display the Excel Options window by clicking the Excel options button on the Office menu. When the Excel Options window appears, click the word Formulas in the panel on the left to reveal the following formula options.

If you let your pointer hover over the information icons ( ) beside each error rule, an information box will appear with a message describing the given rule. Under the Calculation Options heading, you will see radio buttons and other controls for specifying how Excel calculates formulas.

Microsoft Office Excel 2007 Advanced

In this image, you can see three radio buttons on the left labeled Automatically, Automatically except for data tables, and Manually. By default, Excel formulas are calculated automatically. This means that when you change a value in a cell that is referenced in a formula, Excel recalculates the given workbook automatically, finding a new result for every formula that references the value you changed. This feature is in part what makes Excel such a powerful tool. You just enter the values that you want in the cells and the spreadsheet calculates everything for you automatically. Sometimes, you may have a workbook that has multiple complex formulas or array formulas that reference huge cell ranges. In cases like this, automatic calculation may be a problem because of the length of time it takes to perform all of the calculations required. If your spreadsheet really bogs down in a situation like this, you may want to specify that Excel calculates the spreadsheet manually, or only when you click the Calculate Now or Calculate Sheet option under the Calculation Options button on the Formulas Ribbon.

When you calculate your workbook manually, the formulas in your sheets will not recalculate every time you change a referenced value. This can help Excel perform better when you are dealing with a very large workbook with a lot of formulas to be evaluated. If you select the Automatically except for data tables option, the workbook will be recalculated automatically when you change cell values, except for the dependent cells that are in Excel data tables. On the right side of the calculation options area, you will see a check box labeled Enable iterative calculation.

Iteration is a little known feature of Excel that deals with circular cell references. A circular reference occurs when one cell contains a formula that references another cell, which in turn contains a formula or references a cell with a formula that references the first cell. To make this a little more clear, look at the following example.

Microsoft Office Excel 2007 Advanced

10

Imagine A1 has the formula B1 + 1, and cell B1 has the value 0. In this case Excel will have no trouble calculating the results of the formula. However, if cell B1 contains the formula =A1, you will be faced with a circular reference (B1+1 and B1=A1 so we have A1= A1 +1). Now a situation occurs where the value of cell A1 depends (indirectly) on the value of A1. That is, cell A1 is dependent on itself for its formula result. When this occurs in Excel, you will get the following message.

Most often, Excel users enter circular references by mistake, but sometimes, advanced users create circular references on purpose. If a circular reference is intentional, putting a check in the Limit iterations checkbox will permit circular references in your workbooks so you will not see the alert shown above. In regard to circular references, a single iteration refers to one step through the circular formula. In the case of the circular reference described above (A1=A1 +1), after one iteration the value in A1 should be 1. This is because A1 is assigned the value of A1 +1, which is really 0 +1 because the initial value of A1 is 0. In the Excel Options window, you can specify a maximum number of iterations, if you allow circular references by checking the Limit Iterations checkbox. The default maximum is 100, so for the formula described above 100 iterations should result in a value of 100 in cell A1.

Basically, 1 is being added to the value in cell A1 every time the formula is iterated. When the maximum iteration value is reached, the iteration will stop. If the calculation mode is set to Manual, you can force a single iteration by pressing the F9 key. You can keep iterating this way until the maximum number of iterations is reached. If the calculation mode is set to Automatic, the value will be automatically calculated up to the specified maximum number of iterations. You can increase or decrease the number of iterations by using the small arrows at the right of the Iteration value field, or by entering a value directly into the field.

Microsoft Office Excel 2007 Advanced

11

The largest value you can enter in the Maximum Iterations field is 32767. You will also see a Maximum Change field below the iterations field. The value in this field (.001 by default) can be a limit to the amount of iterations that occur. The iterations will stop when the values in any of the cells in the circular reference change less than .001 (the maximum change). You can alter the Maximum Change value by entering a new value directly into the field. Keep in mind that when you allow circular references in a workbook Excel will not detect a circular reference that you may enter by mistake. Unless you understand the concept of circular references completely, it is probably wise to leave the Limit Iterations checkbox clear, so you will be alerted to any circular references you may accidentally create. Further down in the Excel Options window, you will see a Working with Formulas heading.

You can use these check boxes to specify how cells are referenced, if AutoComplete should be turned on for formulas, and if formulas should accept table names. By default, all of these options are active in Excel, except for the R1C1 reference style option. An R1C1 reference style uses numbers to signify both columns and rows. For example, R1C1 means row1 column1 (which corresponds to cell A1).

Microsoft Office Excel 2007 Advanced

12

For most people, the traditional letter/number (A1) references are easier to follow and manipulate than R1C1 references. The final two formula related option groups deal with Error Checking.

Under the Error Checking heading, you can enable or disable background checking and you can change the color of the small triangle that appears in a cell to indicate an error. Under the Error Checking Rules heading, you can configure what rules Excel will follow when determining errors. Unless you have a thorough understanding of Excel errors, it is probably wise to leave the default settings unchanged.

Microsoft Office Excel 2007 Advanced

13

Remember, when you make changes in the Excel Options window, click the OK button in the bottom right of the window to implement them, or click the Cancel button to disregard them.

Changing the Appearance of Your Excel Interface


If you click the Popular option on the left panel of the Excel options window, you will see a section of controls labeled Top options for working with Excel.

The Enable Live Preview checkbox controls the new Live Preview feature in Excel. This refers to the way that a particular theme or pre-set format is applied to your selection or worksheet when you hover over an item in a particular style or theme gallery. For example, putting your mouse pointer over the Moderate Effect theme under the Colors button previews the selected chart in that theme. This way, you can see how it will appear before you implement any changes.

Microsoft Office Excel 2007 Advanced

14

If you clear the Enable Live Preview checkbox, this preview feature will be deactivated. If you put a check mark in the Show Developer Tab in the Ribbon checkbox, you will see the Developer Ribbon, which has options for working with macros and Visual Basic code.

Microsoft Office Excel 2007 Advanced

15

To change the appearance of the Excel interface, you can select one of the color scheme options from the drop list labeled Color Scheme at the bottom of the section. The default color scheme is Blue as shown below.

You can also choose a Black color scheme.

Or, you can choose a Silver color scheme.

Microsoft Office Excel 2007 Advanced

16

Lesson 1.2: Excel and Windows


Any application like Excel requires an operating environment to run in. The operating environment we are currently focused on is Microsoft Windows. This lesson will focus on managing and maintaining Excel in a Windows environment. In this lesson, you will learn how to search for documents, how to use Office Diagnostics, how to check for updates, and how to start Excel automatically when Windows loads.

Searching for Documents


If you are looking for a particular Excel file but you are having trouble locating it, you can always use Windows search features to help you find it. To sea rch for an Excel file, first display the Windows start menu and then select the Search option from the menu items. When you select the search option, you will see a sub menu of search tools that you can choose from.

Click the For Files or Folders option from the sub menu to display the Search Results window.

Microsoft Office Excel 2007 Advanced

17

In the Search Results window, you can choose a search category from the panel on the left. Because we are searching for Excel files, the second option (documents) is the logical choice. When you click this option you will see the items in the panel on the left change.

Microsoft Office Excel 2007 Advanced

18

From this list of items, you can select a radio button specifying the last time the file was modified. If you can remember this information, it will help to narrow down the search. There is also a text field in which you can enter all or part of the document name. If you are unsure of the document name, you can use file extensions to help. For example, if you enter .xlsx as in the file name box, the search will return results for Excel 2007 workbook files. If you enter .xls, the search will return results for Excel 97-2003 workbooks. To initiate the search, click the Search button at the bottom of the panel. There is also a back button allowing you to move back to the previous panel of options. Just above these buttons, you will see a Use Advanced Search options heading.

If you click on this heading a list of advanced search options will populate the panel.

Microsoft Office Excel 2007 Advanced

19

If you can remember a word or phrase in the document, you can enter it into the appropriate search field. The search engine will then scan documents for the particular word or phrase that you entered. In the Look In field, you can specify a particular location to search, by selecting it from a drop list. At the bottom of the Look In drop list, you will find a browse option that will allow you to specify any folder on your on your computer that you are able to navigate to. You can also specify the size of the file, or you can set more advanced options that include searching in hidden files and folders. When the options have been set up for your search, click the Search button to get your results. As Windows searches, results that match your search criteria will be returned in the Search Results window.

Microsoft Office Excel 2007 Advanced

20

If you see the file that you have been looking for among the results, double click on its icon to open it in Excel. If you cannot find the file among the search results, go back to the panel on the left and further refine your search. Instructor Note: The Windows operating environment used here is Windows XP. The Search mechanism shown may vary from one version of Windows to another.

Using Office Diagnostics


If you find that Excel 2007 (or another Office 2007 application for that matter) is not working correctly, you may not necessarily have to reinstall it. You can use the Office Diagnostics feature to automatically examine your Office files, check your computer memory, check to see if your system is up to date with regard to Microsoft service packs, and even check your hard disk as a possible cause for program instability. If Excel 2007 crashes frequently, or otherwise fails to perform adequately, it could be a candidate for Office Diagnostics. Of course, you will need an Internet connection to make full use of Office diagnostics. If no Internet connection is available, you can still run Office diagnostics in an attempt to detect and repair problems without connecting to any external servers.

Microsoft Office Excel 2007 Advanced

21

To use Office Diagnostics from within Excel, display the Excel Options window by clicking the button on the Office menu. When the options window appears, select the Resources option from the panel on the left. Your options window should now look like the following.

The second item from the top in the main window area is called Run Microsoft Office Diagnostics. If you click the Diagnose button, you will see the following dialogue.

Microsoft Office Excel 2007 Advanced

22

If you want to continue to with Office Diagnostics, click the Continue button. You should take note of the message provided in the dialogue: Office Diagnostics may communicate with external servers.

In this dialogue, you can see a list of checks that Office diagnostics will perform. If you click the Run Diagnostics button, each check will be performed in sequence. What follows is a brief description of what each check involves.

Microsoft Office Excel 2007 Advanced

23

Check for Known Solutions

Will check information dealing with recent crashes of Office 2007 programs on your computer. If a known solution exists ( perhaps on a Microsoft server in the form of a software patch or upgrade) you will be given information regarding the solution when Office Diagnostics has finished Will check your computers random access memory for issues that may be causing problems with Office applications Will search for conflicting versions of the specific Office programs that may be causing trouble. Will check your hard drive to see if there are any issues that could be causing problems for Office applications. Will check your Office files and folders for missing or corrupted files. It also checks how Office programs are set up in the Windows registry. This feature was referred to as Detect and repair in earlier versions of Office programs.

Memory Diagnostic Compatibility Diagnostic Disk Diagnostic Setup Diagnostic

When you run Office Diagnostics, it will attempt to find and repair any issues that may be causing problems with Excel 2007 or other Office 2007 applications.

Checking for Updates


If you ever want to check for updates to Excel 2007 or other Office 2007 products, display the Excel Options window by clicking the Excel Options button in the Office menu. When you see the options window, click the Resources option in the panel on the left. You will now see a list of options in the main viewing area of the window. The first item in the list is labeled Get Updates.

Microsoft Office Excel 2007 Advanced

24

If you click the corresponding Check for Updates button, your browser will automatically open with a Web page containing download links from the Microsoft Office Web site. Just click on a link that you think applies to your situation, or use the online search feature to find a particular update that you require.

Microsoft Office Excel 2007 Advanced

25

There are Office updates that you can explore. Simply follow the directions provided to download what you need.

Starting Excel Automatically when Windows Boots


If you wish, you can have Excel start up automatically when you first turn on your computer. To do this, you must first locate your Windows startup folder. The startup folder contains shortcuts to programs that will start up automatically when Windows loads (when you start your computer). Once your Excel 2007 shortcut is in the Startup folder, Excel 2007 will open automatically when you start your computer. Normally this folder has the path C:\Documents and Settings\All Users\Start Menu\Programs\Startup or C:\Windows\Start Menu\Programs\Startup. You can navigate through the file system on your computer to get to these locations or you can enter (copy and paste) the path in the Run dialogue under the Start menu.

Microsoft Office Excel 2007 Advanced

26

When you click the OK button, the folder indicated by the path should open. When you see the startup folder open, hold the Ctrl key and drag and drop the Excel 2007 icon on your desktop into the startup folder.

Holding the Ctrl key will allow you to drag a copy of the Excel icon (shortcut) into the Startup folder. This ensures that an icon for Excel will remain on your desktop. (If there is no Excel icon on your desktop, you can press the Ctrl button and drag the Excel 2007 menu item from the Windows start menu into the Startup folder.) To prevent Excel from opening automatically, just remove or delete the Excel shortcut from the Startup folder.

Microsoft Office Excel 2007 Advanced

27

Lesson 1.3: Using the Excel Viewer


Imagine that you receive an Excel workbook from a colleague as an e-mail attachment, but you do not have Excel installed on your computer. Is there any way to view or print the workbook without obtaining and installing Excel? The answer to this question is yes, and the program that you need is called Excel Viewer. In this lesson, you will learn how to download and install Excel Viewer, and how to use it with Excel workbooks.

What is the Excel Viewer?


Excel Viewer is a program developed by Microsoft that is designed for opening, viewing, and printing Excel workbooks. Excel viewer is a much smaller program than Excel itself, so it will take up less disk space. The Excel viewer does not depend on the Excel spreadsheet application in any way, and can run in its absence. In addition, Excel viewer is easy to install and operate, and is available for free from Microsoft Office Online.

As you can see in this image, the Excel viewer displays the working area of an Excel Spreadsheet, without the ribbons, menus, and buttons of the full Excel interface. The Excel viewer can be used to display Excel charts, and also to display multiple workbooks at the same time.

Microsoft Office Excel 2007 Advanced

28

If you want to use Excel viewer to open an Excel workbooks, the first step is to obtain and install it.

Downloading the Excel Viewer


To download Excel Viewer, start your web browser, and use your favorite search engine to search for Microsoft Office Online. You could also try entering http://www.microsoft.com/downloads in the URL field in your browser. When you see the Microsoft downloads page, look for the search tool.

Microsoft Office Excel 2007 Advanced

29

In the search tool, enter Excel Viewer, and then click the button to initiate the search. When you see a result for Excel Viewer, click on the link to begin the download process.

When you follow the download link, a page will load with information about the software you are downloading.

Microsoft Office Excel 2007 Advanced

30

Here is a sample download page for Excel Viewer. Simply click the Download button to download the software to your computer.

Microsoft Office Excel 2007 Advanced

31

When you initiate the download, you will be asked where you want to save the downloaded files. Choose a location that you will be able to find easily.

Here is the Excel viewer icon after the file has been downloaded. Just double click on the icon to install it on your computer. Instructors Note: You could also find an Excel viewer download by searching for the term Excel viewer with your favorite search engine. When your search returns results, choose one that is an authentic Microsoft Web site. Always be careful when downloading executable files (.exe format). These files may contain malicious program code that can harm your computer. Only download these files from a trusted source. If possible, scan the file with anti-virus software before you execute it.

Using Excel Viewer


To use Excel Viewer, click on the desktop icon, or click the Excel Viewer on the Windows Start menu. When Excel Viewer starts, click the word File in the upper left to display the File menu.

Microsoft Office Excel 2007 Advanced

32

If you click the Open option, you will see an Open dialogue box, which you can use to navigate to and open the Excel workbook that you wish to view.

Microsoft Office Excel 2007 Advanced

33

If you double click on a workbook icon in the list, it will open in the viewer. In the viewer, you will see a File menu, an Edit menu, a View menu, a Window menu, and a Help menu.

Under the Edit menu, you will see options named copy, find, and go to. The Copy option will copy values from a selected cell or selected range of cells. The Find option will display a Find dialogue box that you can use to search the workbook for a particular term or value.

The Go to option will display a Go to box in which you can enter a specific cell reference.

Microsoft Office Excel 2007 Advanced

34

If you click the OK button, the cell you specify will be brought into view in the viewer, and it will also become the active cell.

With the View menu options, you can specify a view type for the preview screen (i.e. page break preview), or you can zoom in on the spreadsheet being viewed. There is also an AutoFilter option that you can use to filter selected cells. To do this, just select a group of cells in the viewer and then click the AutoFilter option. When you do this, you will see AutoFilter arrows appear above the selected columns.

Microsoft Office Excel 2007 Advanced

35

If you have multiple workbooks open in the viewer, you can use the Arrange option under the Window menu to arrange the workbooks in the viewer with the following dialogue.

Using the Window menu, you can also freeze panes in a way that is similar to the full Excel application. If you want to view another sheet in the workbook, just click the worksheet tab at the bottom of the viewer screen.

You will also notice a basic AutoCalculate feature at the right of the status bar. If you select a range of numerical values, the sum of the values will appear in the lower right in the status bar. Finally, if you want to print the workbook, click the File option to display the File menu.

Microsoft Office Excel 2007 Advanced

36

If you click the Page Setup option, a Page Setup dialogue will appear allowing you to prepare the margins, page orientation, or print headings for the document. If you select a range of cells and click the Set Print Area option, only the range of selected cells will be printed. Clicking the Clear Print Area option will clear the selected print range. If you choose the Print Preview option, a print preview window will appear, allowing you to zoom, setup, or print the workbook.

Microsoft Office Excel 2007 Advanced

37

Finally, if you choose the Print option from the File menu, the following Print dialogue will appear.

In this dialogue you can specify the printer that you want to print on, and what part of the workbook (or the entire workbook if you wish) that you want printed. If you click the Preview button in the lower left of the dialogue, you will display the Print Preview window. When you have specified your options and you are ready to print, just click the OK button to proceed. Instructors Note: Remember, the Excel viewer is for printing and viewing Excel workbooks. To edit and format a workbook, build formulas, use functions, and lay out data tables, you will require the full Excel application. You should try to use an Excel viewer that is compatible with the format of the workbooks that you want to view. An Excel 2003 viewer will not be able to open Excel 2007 (.xlsx) workbook files. We have used the Excel 2003 viewer in our examples because at the time of this writing, the Excel 2007 viewer was not yet available.

Microsoft Office Excel 2007 Advanced

38

Section 1: Review Questions


1. A. B. C. D. 2. A. B. C. D. 3. A. B. C. D. 4.

Which of the following is not a valid reason to change your user name in Excel? To identify yourself and your work when using a shared workbook. To identify yourself in the file properties of the workbook. To protect the workbook so only you can open it. To identify yourself in comments. The Excel Options window is available By clicking the Excel Options button on the Office menu. By clicking the Options button on the Review Ribbon. By selecting the Options option when you right click the active cell. None of the above You can change the Excel 2007 color scheme by Choosing the Popular category of options Choosing the Formula category of options Choosing the Proofing category of options Choosing the Resources category

If you are searching for an Excel 2007 workbook, what extension should you use as a part of the filename? A. .xlt B. .doc C. .xlsx D. .htm
5. A. B. C. D. 6. A. B. C. D. 7.

To start Excel automatically when Windows starts, drag an Excel shortcut to the My Documents folder Start menu Desktop Startup folder If Excel seems to be crashing or hanging, you should Reinstall it right away. Try Office Diagnostics first, and then reinstall if problems continue. Do nothing, and eventually Excel may improve on its own. None of the above

The Office Diagnostics option is available . A. In the Options window under the Popular category B. In the Options window under the Proofing Category

Microsoft Office Excel 2007 Advanced

39

C. D. 8. A. B. C. D. 9. A. B. C. D. 10. A. B. C. D.

In the Options window under the Formulas category In the Options window under the Resources category Which of the following statements is not true? You can view a workbook in the Excel Viewer. You can print workbook data using the Excel Viewer. You can filter data in the Excel Viewer. You can modify formulas in the Excel Viewer. Which of the following can be changed using Excel Options? How Excel deals with circular references How Excel deals with error rules How many worksheets will be available by default All of the above In terms of Excel formulas, what is iteration? Stepping through a formula with a circular reference a specified number of times. A way of linking workbooks A way of importing external data None of the above

SECTION 2: Getting the Most from your Data


In this section you will learn how to: Use automatic outlining Display and collapse levels Group data manually Create subtotals Create a PivotTable Specify data in a PivotTable Rearrange PivotTable data Modify PivotTable calculations Format a PivotTable Refresh a PivotTable Chart a PivotTable Create a PivotTable based on external data Create a scenario Create a scenario summary report Save multiple scenarios Use a one and two input data table Use Goal Seek Use the solver

Excel 2007 Advanced

41

Lesson 2.1: Getting the Most From Your Data


Sometimes, a worksheet can become so large and contain so much data that it becomes unwieldy. Totals and subtotals that summarize the data are lost in screen after screen of numbers. Thankfully, Excel 2007 has an excellent feature to help with this kind of problem. Excels grouping and outlining features will allow you to collapse a large worksheet to show or print summary data, and to expand the same worksheet to show or modify the details. You will find these features in the Outline button group on the Data Ribbon.

Using Automatic Outlining


Excels automatic outlining feature makes outlining a worksheet fairly straightforward. Automatic outlining works best with numerical data organized into groups and sub groups by formulas or functions. The following worksheet, for example, contains monthly financial data for a business, organized into quarterly and yearly totals using formulas and the SUM function.

Excel 2007 Advanced

42

It can be difficult to discern quarterly and yearly totals at a glance because these figures are lost in amongst the other data. To automatically outline this worksheet, click the small arrow next to the Group button in the Outline button group on the Data Ribbon.

This action will display a menu with two options: Group and Auto Outline. If you click the Auto Outline button, the spreadsheet will be outlined automatically.

Here you can see the results of Excels automatic outline. All of the original data is shown, as well as outline grouping indicators and collapse buttons marked with a (-). You can see that the quarters (sets of three months) are grouped together to be summarized by Quarterly Totals, and that each year has been grouped to be summarized by Yearly Totals. Notice also that the columns Supplies, Wages, and Rent have been grouped under Total Expenses, and that there is an overarching group of all columns under Profit.

Excel 2007 Advanced

43

Here you can see the summary results of Excels automatic outline. The original information is still available in all of its detail, but it is now presented in a summary view, showing only the yearly profit totals. Of course, automatic outlines will differ from worksheet to worksheet depending on the way the data is organized. To remove the outlining from your worksheet, choose the Clear Outline option from the submenu under the Ungroup button.

Displaying and Collapsing Levels


Notice that in the preceding outline image, there are numbered buttons arranged in a row beside the column letters and in a column above the row numbers. Clicking on one of these numbered buttons arranged in a row will expand the rows in the worksheet to provide a given level of detail. Clicking on one of the numbered buttons arranged in a column will expand the columns in a similar way. The view of the data in the preceding image is provided by the buttons numbered 1. Clicking on the number 2 button will expand the worksheet to the second level of detail for the rows, columns, or both.

Excel 2007 Advanced

44

This is the same worksheet after both number 2 buttons have been clicked. The worksheet rows and column have been expanded to show another level of detail. You can now see rows with quarterly totals as well as yearly totals. You can also see columns with figures for Sales and total Expenses. If you click on an expand button (marked with a + sign), a specific section of the outlined worksheet corresponding to the button will be shown. Clicking the collapse (-) button will collapse the corresponding expanded section. If you click the number 3 button for the rows and columns, all levels of detail will be expanded to expose all of the data, as shown in the original image. Remember that with outlines, only the data that is visible on your screen will be printed. This is a great way to print only the pertinent information from an expansive worksheet. You can expand and collapse the outlined worksheet with the numbered outline buttons or with the expansion (+) and collapse (-) buttons to reveal the level of detail you want in your printed copy.

Excel 2007 Advanced

45

Grouping Data Manually


Automatic outlining may not be adequate for worksheets with non numerical values or with no distinctive totals (from formulas or functions). If automatic outlining does not, or cannot, organize your data in the way you want, you can manually group your data as required. Take the following worksheet as an example.

We would like to group the data according to teams and divisions, but if you use the Auto Outline option under the Group button, Excel displays the following alert.

Because the data contains no formulas or functions providing numeric totals, Excel cannot implement automatic outlining for the worksheet. You can, however, create your own

Excel 2007 Advanced

46

groupings by selecting the rows or columns that you want to group, and then clicking the Group button. For example, if you select the members of Team 1 (cells B4:B6) and click the Group button on the Data Ribbon, Excel will display the following box asking if you want to group by rows or columns.

If you select the Rows radio button and click OK, Excel will provide an outline indicator and a collapse/expand button for the new grouping.

You should also notice numbered buttons in the top left corner. These outline level buttons work the same as before. Clicking on the number 1 button will show the first level of detail, and clicking on the 2 button will show the second, more detailed level. If you follow the same procedure for cells B8:B10, and then select cells B2:B10 and group them, you will end up with a worksheet like this.

Excel 2007 Advanced

47

This image shown above is of the fully detailed view. If you click the 2 button, you will see the following view of the data.

You can see that the individual player information for the first two teams has been collapsed from view. Clicking the number 1 button will display the highest level view (lowest detail) of the manual groupings.

Excel 2007 Advanced

48

In this image you can see that the entire first division grouping has been collapsed from view. You can also select rows or columns for grouping by dragging your mouse over the column letters or row numbers accordingly. If you select the rows or columns this way, you will not be asked whether to group by rows or columns, as the selection you choose will clearly indicate this to Excel. To remove manual groupings, select the rows or columns corresponding to the grouping you wish to remove and click the Ungroup button.

When you see the Ungroup dialogue box, select the appropriate radio button and click OK. The selected rows or columns will be ungrouped.

Excel 2007 Advanced

49

Creating Subtotals
Another kind of outlining or grouping technique available in Excel is the subtotals feature. If you have numeric data organized with clear column and row headings, you can use Excel to create automatic subtotals and grand totals for the data. The following worksheet contains sales information for different products across geographical regions.

To use Excels subtotal feature, select the range of data you want to apply subtotals to and click the Subtotal button on the Data Ribbon. Be sure to include the column labels in your selection so Excel will be able to discern what numbers to total. For this example, you could select A1:E10 and click the Subtotal button on the Data Ribbon to invoke the following Subtotal dialogue.

Excel 2007 Advanced

50

The drop list under the At each change in heading gives you options as to the number of rows that will be totaled. (Totals will be applied every time the values under the chosen column label changes.) The Use function drop list lets you choose from a list of functions including SUM, AVERAGE, COUNT, PRODUCT, and STDEV to apply to your data. The function you choose (normally SUM) will be used to calculate the totals. Under the Add subtotals to option list, you can select which columns to apply the totals to. You can apply totals to a single column or to multiple columns in the selected range. Finally, there are three check boxes at the bottom of the dialogue box that will allow you to:

Replace any pre existing subtotals Put page breaks between totaled groups so they will be printed on separate pages Place the subtotals and grand totals above or below the corresponding data

If you choose to apply totals to each change in the region column while using the Sum function for the profit column, and with no page breaks, the resulting worksheet will look like this.

Notice that there is a subtotal for the profit figures at every change in the region value. There is also a grand total for the Profit column at the end of the data. You can also that Excel has provided outlined levels, collapse/expand buttons, and numbered outline level buttons associated with the totals. These buttons and outlines work exactly as previously explained. The lower the number on the button, the less detailed information will be shown.

Excel 2007 Advanced

51

To remove these subtotals, select the range of data in question (A1:E14) and click the Subtotal button to invoke the subtotal dialogue box. When you see the box, click the Remove All button.

Excel 2007 Advanced

52

Lesson 2.2: PivotTables


A major function of any spreadsheet program is to help you derive meaning from your data. An Excel PivotTable is a great tool for getting perspective on, and analyzing relationships between, the columns and rows of your worksheet. In this lesson you will learn what a PivotTable is and how to create one. You will also learn how to specify and rearrange PivotTable data.

What is a PivotTable?
A PivotTable is a powerful tool for exploring and analyzing information. A PivotTable helps you organize and manipulate the raw data in your spreadsheet, giving you insight into patterns or relationships that might not be obvious at first glance. PivotTables also give you the power to view your data in a different context without changing the original content or structure. You can base a PivotTable on data in your current workbook or even external data from another source if you wish. With a PivotTable, you can conveniently drag and drop columns of your data to different areas of the table to examine relationships or trends that may not be obvious in a traditional Excel table or database. You could build several separate tables to explore how columns from an Excel worksheet relate to each other, or you can use one PivotTable to do the same thing. With a PivotTable, you can alter the table design without cutting, copying, pasting, or adjusting formulas and cell references. (These tasks can be frustrating when dealing with a large volume of data.) In short, PivotTables enable you to

Excel 2007 Advanced

53

organize your data in meaningful ways without doing a lot of tedious work. You could say that a PivotTable is like several data tables rolled into one. Ideally, source data for a PivotTable should be structured like a traditional Excel table or database. The source data should have a row of unique column headings distinguishing the data and there should be no empty columns interspersed within the data. Also, blank rows in a source list or database can limit the usefulness of your PivotTable. The following image shows a block of contiguous data that is well suited for a PivotTable.

Notice that there are no empty rows or columns and that every column of data has a unique label.

Creating a PivotTable
To create an Excel 2007 PivotTable, just select the range of data that you want to base the table on and then click the PivotTable button on the Insert Ribbon to display the PivotTable dialogue.

Excel 2007 Advanced

54

When the Create PivotTable dialogue box appears, you should notice that you are allowed to select data from an Excel table or range or from an external data source. If you choose the table or range option, the PivotTable will be based on the Excel table or range you select. You can select a table or range by dragging with your mouse before clicking the PivotTable button (before you invoke the dialogue), or by specifying a range with the keyboard or mouse after you invoke the dialogue. (When you select your data source, make sure that the column headings are included.) If you choose the External Data Source option, you can base your PivotTable on data outside your current workbook (such as another workbook or perhaps an external database). If you select the Use an External Data Source radio button, you will be able to display a drop list of existing connections in the Connection Name field. A typical existing connection could be a Microsoft Query or a connection you previously made to an Access database for some other purpose. Once you select your data source, you can then choose to locate your PivotTable in an Existing Worksheet or a New Worksheet. If you choose to locate it in an existing worksheet, you can specify the location for the upper left corner of the PivotTable by entering it directly into the Location data field (as a cell reference) or by clicking the target cell with your mouse. If you choose the new worksheet option, your PivotTable will be located in the upper left corner of a new worksheet that will be added to your workbook. In summary, when using the dialogue box, make sure that the range of data that you want to use is visible in the Table/Range field. Use the radio buttons near the bottom of the dialogue to choose where in the workbook you want the PivotTable to be located. Once you are ready, click

Excel 2007 Advanced

55

the OK button to create your PivotTable. When you create your table, a PivotTable field List will be placed in the same worksheet as your PivotTable.

Here you can see a new PivotTable area, and the corresponding PivotTable field List, placed in the existing worksheet with the source data. Once your PivotTable appears, you can add information to it by placing checks in the boxes next to the headings in the PivotTable field list. For this example, checks will be placed next to the Month field heading, the Salesman field heading, the Region field heading, and the Profit field Heading.

Excel 2007 Advanced

56

The PivotTable will now be populated with data.

As you can see in this image, the profit has been organized by Month with a total profit for the month at the top of the Sum of Profit column heading. It has also been organized by Salesman, with a total profit for each Salesman being shown in the Sum of Profit column. Because Region has been checked in the PivotTable field list, you can also see a profit breakdown by region for each salesman.

Excel 2007 Advanced

57

The following close up view of the table tells us that the total profit for Month 1 is 4090. The Salesman A. Smith generated a total of 1020 in profit with 780 from the East region, and 240 from the Northeast region.

The salesman B. Doe generated a total of 600 in profit from the North region. If you click on the minus (-) sign preceding a salesmans name, the data for that specific salesman will be collapsed, and you will only see the total profit for that person as shown in the following example.

If you click on the (+) sign in front of a name, the data will be expanded again. This holds true for the (-) sign in front of the Month headings as well.

Excel 2007 Advanced

58

Instructor Note: If an Access database contains your source data, you can also click the From Access button on the Data Ribbon. This will allow you to select a database and invoke the Import Data panel as discussed in the Intermediate manual (Lesson 5.4).

Creating a PivotTable Frame


You can also create a PivotTable by creating an empty table frame (also known as a classic layout) and adding and arranging data in the table by dropping and dragging column headings onto the frame. To create a PivotTable frame, click the PivotTable button on the Insert Ribbon to display the PivotTable dialogue box. From this point, you essentially follow the same process as described before for creating an Excel 2007 PivotTable. You select a range of data, choose a location for the table, and click the OK button when you are ready.

This time, before adding data to the PivotTable table, right click on it and choose Table Options from the pop up menu.

Excel 2007 Advanced

59

This will display the PivotTable options dialogue box.

Excel 2007 Advanced

60

In the options box, choose the Display tab and then put a checkmark in the Classic PivotTable Layout box. This will change the Excel 2007 PivotTable into a classic PivotTable frame. (If you are already working with a classic PivotTable frame, you can clear this checkbox to convert it to an Excel 2007 style PivotTable.)

Here you can see an empty PivotTable frame enhanced with blue borders. Beside it to the right, you can see the PivotTable Field List. You can easily add any of the data available in the PivotTable Field List to your PivotTable by dragging it to the table with your mouse.

Specifying PivotTable Data


To make the best use of your PivotTable, you should understand what the various areas in a PivotTable are for. You can see by examining an empty PivotTable frame that a PivotTable is broken into four main areas: Page, Data, Row, and Column.

Excel 2007 Advanced

61

The Page area is ideally suited to column headings (fields) that are used to identify periodic or organizational groupings of the data in your other columns. For example, you may have column headings for sales, profit, and expenses, which are grouped according to the specific month or year over which the sales, profits, and expenses have occurred. In this case, the month or the year column heading would be placed in the page area of the PivotTable. This would allow you to populate the table with the data corresponding to whatever page field (year or month) you select. You can select a given page (year or month) and the table will display the data for that year or month. The Data area provides the underlying context for the rest of the PivotTable. The column heading you choose for the data area of the table normally has numeric values associated with it (like units sold, profit, or expenses). This is the kind of data that can be measured and totaled to reveal trends or indicate relationships between non numeric data. The Row and Column fields are used to categorize the data you want to examine. When you choose column headings to be placed in the row and column fields, you can see how your choices relate to each other in the context of the Data being examined. As an example, suppose you select a heading like Product Type for the row area, Salesman for the column area, and Profit for the data area. The resulting PivotTable will show the profit for different product types across sales people.

Excel 2007 Advanced

62

Now that you have an idea of how the parts of a PivotTable relate, it is easy to specify data for the table. You just use your mouse to drag and drop items from the PivotTable field list to the appropriate areas of the table. Once again, you should specify a column heading (field) that represents numeric values for the data area. For the row and column areas of the table, drag and drop items that you want to analyze with respect to the chosen item for the data area. You can drag and drop more than one column heading to a table area. The resulting table will display the combined data from all of the headings you place in a single table area, as shown below.

Excel 2007 Advanced

63

Here, both the product type heading and the salesman heading have been dragged to the row area of the table. You can now see the sales by salesman and product type displayed across regions. You will notice that the PivotTable field list at the right of your PivotTable will have checkmarks corresponding to the column headings used in the table itself.

If you clear a checkbox, the associated data will be removed from the PivotTable. If you put a check in a checkbox that was cleared, the data will return to its place in the table.

Rearranging PivotTable Data


Once a PivotTable has been created, it is easy to rearrange the data if necessary. Note that you must be using the Classic Layout (as described in the last lesson) to rearrange data.

Here we have a table showing profit by product type across regions.

Excel 2007 Advanced

64

If we wanted to show sales figures instead of profit figures, you can remove the profit information from the data area by dragging the Sum of Profit heading in the upper left corner of the table out of the table area to drop it anywhere outside the blue table borders.

This will empty the data area.

Once the data area has been cleared, it is just a matter of dragging and dropping the Sales field from the PivotTable Field List to the Drop Data Items Here area of the table.

Excel 2007 Advanced

65

In this image, the Sales heading is being dragged from the field list to the Data area of the table. Once the move is complete, this is what the table will look like:

Notice that Sum of Sales is in the upper left corner and the Sales heading has a check next to it in the PivotTable field list. You can rearrange any of the categories of data in your table by following this process of dragging headings out of the table and then replacing them with headings from the PivotTable field list. You will also notice that the row, column, and page areas of the PivotTable field list have drop lists associated with them, indicated by small downward pointing triangles.

You can use these drop lists to rearrange your data according to specific elements in a given category. The product drop list, for example, will let you see data for only Type 1, or Type 2, or for a specific combination of types, depending on how you configure the check boxes.

Excel 2007 Advanced

66

This is the drop list for the Product heading. (Any of the headings in the PivotTable that have drop lists can be configured in the same way.)

This table only shows data for the products of Type 1 and Type 2, as specified by in the Product drop list. (By default, the drop lists are configured to show all.) In the following image, the Month field has been dragged to the Page area of the table. The drop list for the Month field can be used to show the data for a specific month, or all of the months.

As you now know, you can specify and rearrange data by dragging headings from the PivotTable Field List to the PivotTable itself. If you close the PivotTable Field List, you can always get it back by clicking the Field List button on the Options Ribbon.

Excel 2007 Advanced

67

The Options Ribbon and the Design Ribbon will become available whenever you click inside the borders of your PivotTable. The previous discussion has dealt primarily with PivotTable frames, also known as classic PivotTable layouts. Now you will learn how to arrange data in the default Excel 2007 PivotTable layout. You will remember from the earlier discussion that when you create a standard PivotTable in Excel 2007, it looks like this:

Here you can see the empty PivotTable on the left and the PivotTable field List on the right. At the bottom of the PivotTable field list, you will notice a panel of four data boxes.

Excel 2007 Advanced

68

These boxes are named Report Filter, Column Labels, Row Labels, and Values. They correspond to the Page fields, the Column fields, the Row fields, and the Data Item areas of a classic PivotTable frame. Dragging an item from the PivotTable field list to the Values data box produces similar results as dragging the item to the Data items area of a classic PivotTable frame. This holds true for the other data boxes as well. As an example, if we drag Month from the field list to the Report filter box, Region from the field list to the Column Labels box, Product from the field list to the Row Labels box, and Sales from the field list to the Values box, our resulting PivotTable will look like the following.

Excel 2007 Advanced

69

The corresponding panel of data boxes will look like this.

You can easily drag field headings to and from the data boxes in the panel to rearrange the layout of the PivotTable.

Here is a classic PivotTable showing profit per product, across regions. Notice that the classic table has thick blue borders.

Excel 2007 Advanced

70

Lesson 2.3: More About PivotTables


The previous lesson described how to create a PivotTable and arrange the data in it. This lesson will carry on from Lesson 2.2 and explore other ways to manipulate and present PivotTables and their data.

In this lesson we will discuss how to modify PivotTable calculations, how to format a PivotTable, and how to refresh PivotTable data. You will also learn how to create a chart from a PivotTable and how to create a PivotTable using external data.

Modifying PivotTable Calculations


The default setting for PivotTable calculations is SUM. This means that the totals shown in the Grand Total areas of the PivotTable will be derived from summing the values in the rows and columns.

Excel 2007 Advanced

71

To modify the way these totals are calculated, right click on the Sum of Profit field in the upper left corner of the PivotTable. This field represents the data area of the PivotTable (you could also right click on any cell in the data area of the PivotTable). When you right click on a cell in the data area or on the cell in the upper left (Sum of Profit), you will see a pop up menu with several options.

Near the bottom of the menu (third from the bottom in this image), you will see an option called Value Field Settings. If you click on this option, you will display the PivotTable Data Field Settings dialogue box.

Excel 2007 Advanced

72

In this dialogue box, you can switch the type of calculation to Count, Average, Max or Min, Product, Standard deviation, or Variance. For this example, Average has been selected. If you click the Number button, you can choose a format like currency, accounting, or text for the values in the data area of the table. Under the Show Values As button, you can modify the data area values further by expressing them as percentages or differences. Clicking OK will incorporate the changes into the PivotTable.

Here you can see that the data field label in the upper left of the PivotTable now says Average of Profit, and the values in the grand total row and column are averages rather than sums. You can modify any field that you place in the data area of the table in this same way.

Excel 2007 Advanced

73

Instructor Note: Non numeric values that you place in the data area of a PivotTable will be expressed as Counts by default rather than Sums. It is also probably best to avoid putting numeric data in the row or column area of a PivotTable as this may lead to exceptionally large tables that are difficult to interpret.

Formatting a PivotTable
To format a PivotTable, first click on any cell in the table to display the Options tab near the top of your Excel screen. When you click the Options tab, the Options Ribbon will appear.

At the left of the Options Ribbon, in the PivotTable button group, you will find an Options button. Clicking this button will display the PivotTable Options dialogue box.

Excel 2007 Advanced

74

Under the Layout and Format tab, make sure the Preserve cell formatting on update box is checked (it should be by default). This will ensure that any formatting you apply will be retained if the table is modified or refreshed. Under the Totals and Filters tab, you can specify if grand totals for rows or columns will be shown. Under the Display tab, you can configure how filter drop downs, field captions, expand/collapse buttons, and contextual tool tips are shown. Under the Printing tab you can alter the layout of a PivotTable printout. Finally, under the Data tab you can specify PivotTable data options, like having the table refreshed when the workbook opens. Click OK when you are finished with the PivotTable options dialogue. In Excel 2007, the easiest way to format your PivotTable is to use the new PivotTable Styles that are provided on the Design Ribbon. When you click on a cell in your PivotTable, an Options tab and a Design tab will appear near the top of the Excel screen. Clicking on the Design tab will reveal the Design Ribbon.

On the Design Ribbon, you can click on one of the preset styles in the PivotTable Styles group to quickly apply preset formatting to the table. There are also checkboxes in the PivotTable Style Options section of the ribbon that will let you specify banded columns or rows, row headers, or column headers. At the left of the ribbon are controls that you can use to view or hide subtotals and grand totals and to specify a PivotTable report layout type.

Excel 2007 Advanced

75

Here is a style with banded rows applied to an existing PivotTable.

If you would like to apply specific formatting to a table that is not available as a style, you can always select a range of cells from the table and use the buttons on the Home Ribbon to format the selected range. Another method is to select a range of cells from the table, right click in the selected range, and choose Format Cells from the drop down menu. You can then choose from a series of tabs in the format cells dialogue box that will let you select number formats, font styles, borders, and protection options. You can also right click a cell in the data area of the table and select the Value Field Settings option from the pop up menu.

When you see the Data Field Settings dialogue box, click the Number Format button to view the number formatting options.

Excel 2007 Advanced

76

Here, you can select a number format from the list and click OK to return to the Data field settings dialogue box. Click OK again to format the entire data area of the PivotTable with the chosen number format.

The previous image shows a PivotTable with the Accounting number format applied to the data area. Notice also that the words North and Northeast in the column area of the table have been formatted in bold by using the Home Ribbon buttons.

Excel 2007 Advanced

77

Refreshing a PivotTable
The data in a PivotTable is not linked directly to the source table or range. Instead, the PivotTable is based on a hidden copy of the source data that is kept in memory by Excel. This means that changes to the original source list or database will not be automatically updated in the PivotTable. If you make changes in the source data, you must refresh the PivotTable to update it. You can refresh a PivotTable by clicking the Refresh button on the Data Ribbon or on the Options Ribbon. You could also right click on a cell in the data area of the table and then click the Refresh Data option from the pop up menu. Here is a range of data and a PivotTable that uses the data range as its source.

If we change the sales for A Smith in the East, (in the source data range), there will be no change in the PivotTable. (The data in cell E8 has been changed to 20000 and the corresponding profit in cell F8 is now 40000.)

Here is the same data and PivotTable after the PivotTable has been refreshed. Notice that cell I4 now has a value of 40500.

Excel 2007 Advanced

78

Charting a PivotTable
In Excel 2007, you can create a PivotChart from scratch, or you can create a PivotChart based on an existing PivotTable. To create a chart based on an existing PivotTable, simply click a cell in the table and then click on a chart type from the Charts area on the Insert Ribbon.

In the image above, a basic column chart has been selected and created from an existing PivotTable. This particular chart shows profits generated by each salesman broken down over regions. Any changes or rearranging of field values in the PivotTable will be automatically reflected in the PivotChart. If there are changes made to the source data for the PivotTable, any of the refresh options previously mentioned will update both the PivotTable and the PivotChart. This makes the PivotChart every bit as malleable as the PivotTable upon which it is based. If a basic column chart is not what you are after, you can select any other chart type from the Insert Ribbon except XY Scatter, Bubble, or Stock charts. Once you create your chart, you can click on your chart area and then display the Design Ribbon which will allow you to apply a preset format to your chart via the chart styles buttons.

Excel 2007 Advanced

79

Keep in mind that all chart types may not be equally suited for displaying your PivotTable data. Pick the chart type that most clearly illustrates the point you want to put forward.

Here is the same PivotTable data as before, but now it is displayed as a three dimensional bar chart. Again, changes to the source data will be reflected in the PivotTable/Chart after it has been refreshed. You can also create a PivotTable/PivotChart combination from scratch by choosing the PivotChart option from the PivotTable buttons pop up menu. Remember, the PivotTable button is located on the Insert Ribbon.

When you click the PivotChart option in the PivotTable button menu, you will see the following PivotTable with PivotChart dialogue box.

Excel 2007 Advanced

80

In this dialogue, click in the Table/Range field to place a cursor inside and then select the range of cells that you want to use from the spreadsheet. You can also select the range before invoking the dialogue if you wish. Once the range or table has been selected, you can choose to place the new table/chart on a new worksheet, or on the existing worksheet, by selecting the appropriate radio button. In the image above, the New Worksheet option has been selected. As soon as you are ready, click the OK button to create the new PivotTable/PivotChart combination.

Excel 2007 Advanced

81

If you wish, you can right click on the PivotTable area, select the PivotTable Options item from the Pop up menu, and then choose the Display tab and check the Classic PivotTable Layout option to create a classic frame.

Here you can see a classic PivotTable frame, empty PivotChart, and PivotTable field list. Your PivotChart will first appear empty, very much like your basic empty PivotTable. When you drag field headings from the PivotTable field list over to your Table frame, the data from the fields will also begin to populate the chart. In a sense, the layout that you create for the actual PivotTable will be mirrored automatically in the PivotChart. If you prefer to build your PivotTable without switching to the classic layout, the chart will be created automatically as you drag your field headings to the panel of data boxes at the bottom of the PivotTable field list.

Excel 2007 Advanced

82

Here is the chart and PivotTable after dragging field headings from the PivotTable field list to the appropriate table locations. You can easily format the PivotChart by clicking on the chart area, and then using the Styles on the Design Ribbon to choose a preset design.

Excel 2007 Advanced

83

(Note the new ribbons available for formatting and editing PivotCharts.)

Creating a PivotTable Based on External Data


When you first invoke the Create PivotTable dialogue box, you can select the Use an External Data Source radio button.

Excel 2007 Advanced

84

When you do this, you will be able to select from a list of existing connections (if there are any) to use as a data source. (If there are no existing connections, you will see the Choose Connection button as shown in the figure above.)

When you select an item from the list and click OK, you will see the PivotTable area and PivotTable field list arrangement as before, the difference being that now the field headings in the PivotTable field list will be from the external data source that you selected.

Excel 2007 Advanced

85

You can now drag and drop the field headings into the panel of data boxes to build your table. Depending on the external data source you choose, it is possible that you may have to enter a user name/password combination to get access to the data (as shown below).

Excel 2007 Advanced

86

Once you have entered the appropriate information in the fields provided, click the OK button to begin creating your PivotTable. You can also click on the Existing Connections button in the Data Ribbon and then select a data source from the dialogue box that appears.

Once you select one of the data source connections, click the Open button in the lower right to reveal the Import Data panel.

Once you see this panel of controls, you can specify a Table, a PivotTable Report, or a PivotChart and PivotTable report, for your imported data. You can also specify a new or existing

Excel 2007 Advanced

87

worksheet for your PivotTable location. Once you are finished making your selections, click the OK button to create your PivotTable frame and PivotTable field list. If you do not have any existing connections, you can create a new one as long as you have access to an external data source. To create a new connection, use the From Other Sources button on the Data Ribbon.

You can create a connection to an SQL server, an Analysis Services cube, or with Microsoft Query if you wish. (See Excel Intermediate manual, lesson 5.5). Once you have created a connection to an external data source, you can proceed to create your PivotTable by following the same procedure used for an existing connection. You may also remember (from Excel Intermediate lesson 5.4), that you can import data directly from an Access database by using the From Access button on the Data Ribbon.

When you click this button, a Select Data Source dialogue box will appear, allowing you to navigate to a given Access database.

Excel 2007 Advanced

88

When you select a database and click the open button in the lower right of the dialogue, you will be presented with the familiar Import Data panel.

Once again, you can use the options in the import data panel to specify the type and location of the table you want to build from the imported data.

Excel 2007 Advanced

89

Here is an Access database table containing the source data.

Here is a classic PivotTable frame and field list created by importing the data from Access.

Once you build a PivotTable using external data, you can refresh the table by clicking the Refresh button on the Data Ribbon. This will update the PivotTable with any changes made to pertinent data in the source database.

You can also refresh the PivotTable by right clicking a cell in the table and selecting the Refresh option from the pop up menu.

Excel 2007 Advanced

90

Lesson 2.4: Exploring Scenarios


In business, it is often beneficial to explore multiple scenarios for a given situation to see what combination of factors gives the best results. With Excel 2007 you can easily explore multiple scenarios based on the same worksheet layout. In this lesson you will learn what a scenario is and how to create one. You will learn about scenario summary reports and you will learn how to save multiple scenarios for a given situation.

What is a Scenario?
In Excel, a scenario can be described as a set of cell values that is saved and substituted into your worksheet as required. If you have multiple scenarios saved, you can load different scenarios into your worksheet and compare and contrast them to see which one gives the best results. Since the worksheet will be fully calculated according to the given set of scenario data being used, you can compare and contrast the results of one set of data (scenario) with another by simply switching between different scenarios. The end result is that scenarios provide a great way of performing What if? analysis. You might use scenarios to represent different budget options, evaluate different financial forecasts, or to compare different data projections based on a number of factors. The data that makes up your scenario is saved with your workbook, but remains hidden until you use the Scenario Manager to load the scenario data. All of the scenarios you create are just versions of the same worksheet layout, with each different scenario having different values for certain cells.

Excel 2007 Advanced

91

Creating a Scenario
To create a scenario in Excel, begin with the worksheet that you want to add scenarios to and click the Scenario Manager option from the WhatIf-Analysis menu on the Data Ribbon.

When you click on this option, the Scenario Manager dialogue will appear.

To create a scenario, click the Add button to display the Add Scenario dialogue box.

Excel 2007 Advanced

92

The Add Scenario dialogue is used to specify a name for the given scenario and to enter the cells that will have value changes according to this scenario. To enter a name, make sure that your cursor is in the Scenario Name text box and type a name that describes the scenario you are creating. Next, decide which cells you want to change with this scenario, and then put your cursor in the Changing Cells text box. Select the cells that will be changing with your mouse, and remember to use the Ctrl button for non adjacent selections. If the Add Scenario dialogue box gets in the way when you are selecting cells, you can drag it to one side with your mouse, or collapse it by clicking the Collapse Dialogue button.

You can also add some remarks describing the scenario in the Comment area of the dialogue box if you wish. You will see two check boxes at the bottom of the add scenario dialogue that are labeled Prevent Changes and Hide. If you check the Prevent Changes box, changes to this scenario will not be permitted if the corresponding worksheet is protected. If you check the Hide box, the scenario will be hidden if the corresponding worksheet is protected. Once you enter a name, select the cells to be changed, and add some comments; click the OK button to show the Scenario Values box.

Excel 2007 Advanced

93

Here you will see a series of text fields labeled with the cell references for the corresponding changing cells. In each text field, you should enter the appropriate value for this scenario. When you use this scenario, the values you enter here will be loaded into the corresponding worksheet. Remember, you can move between text boxes by pressing the Tab key. Click the OK button to create the scenario, and you will then see the Scenario Manager box with your newly created scenario available in the Scenarios area.

In this dialogue box, you can see the changing cells in the Changing Cells area and any comments you entered for this scenario are visible in the Comment area. If there is an assortment of scenarios in the Scenario Manager, just select one and then click the Show button to see the results of the given scenario in the spreadsheet.

Excel 2007 Advanced

94

Instructor Note: When you are creating scenarios for a worksheet, it is a good idea to create a base scenario with the actual or current data for the worksheet and name it appropriately. This way, when you are exploring the scenarios you have created, you will always be able to return to the original (or actual) data.

Creating a Scenario Summary Report


To create a summary report for a given Scenario, click the Scenario Manager option under the WhatIf Analysis button on the data menu.

When the Scenario Manager dialogue appears, click the Summary button.

Excel 2007 Advanced

95

This will display the Scenario Summary box. Here you can choose to create a PivotTable (based on the scenario data) or a scenario summary by selecting the appropriate radio button.

In this example, the Scenario Summary button is selected. The next step is to select the result cells that you want to be shown in the summary report. Finally, click OK to create the summary.

The summary report will be created and inserted into a new worksheet. The report contains a list of cell references corresponding to the changing cells in your various scenarios. It also contains a column of current values for the changing cells, as well as columns of changed values corresponding to each of the available scenarios (Current values, Projection1, Projection2).

Excel 2007 Advanced

96

There is also a row of scenario names across the top of the columns to identify which scenario a given column of values belongs to. (The scenarios in the report shown above are: Current values, Projection1, and Projection2.) At the bottom of the report, you can see the values for the results cells that correspond to each scenario. Instructor Note: Each scenario that you create can have different changing cells. The summary report will contain all of the changing cells from all of the scenarios you create.

Saving Multiple Scenarios


To save multiple scenarios for a worksheet, choose the Scenario Manager option from the What If Analysis menu to display the Scenario Manager dialogue. Use the Add button in the Scenario Manager to create as many scenarios as you require. All of the scenarios you create for a given worksheet will be available in the scenarios list in the Scenario Manager dialogue.

In this example, you can see four scenarios in the scenario list. These scenarios will be saved with this workbook when the workbook itself is saved. When you open the workbook, you can see the available scenarios by displaying the Scenario Manager. To load a scenario into the worksheet, select it from the Scenarios list and click the Show button. To remove a scenario, select it and click Delete. To make changes to a scenario, select it and click the Edit button.

Excel 2007 Advanced

97

You can have a different set of scenarios for each worksheet in your workbook. When you display the Scenario Manager, only scenarios for the currently active worksheet will be shown in the Scenarios list.

Excel 2007 Advanced

98

Lesson 2.5: What If Analysis


One of the advantages of a spreadsheet program like Excel 2007 is its ability to explore what-if situations. Scenarios (discussed in Lesson 2.4) provide one way to explore the potential outcomes from different sets of possible data, but that is not all that Excel has to offer in this regard. Excel also provides a few other options for experimenting with your worksheet data under different conditions or constraints. Excels one and two input data table features can show you the results of worksheet formulas based on different ranges of hypothetical values. Excels Goal Seek and Solver features can take what-if analysis one step further by letting you find optimal values based on constraints or conditions you impose. In this lesson you will learn about one input and two input data tables, Excels Goal Seek feature, and Excels solver.

Using a One and Two Input Data Table


You can use Excel data tables to see how your formula results change when the data that the formula is based on changes. You do this by specifying a series of hypothetical values for Excel to evaluate the formulas with and then view the results of the evaluations. For example, you could examine how changes in the number of clients for a business will affect the income or profit. Data tables save you the trouble of entering several values into the worksheet and recording each recalculation of the worksheet results for later comparison. When you use a data table,

Excel 2007 Advanced

99

Excel will substitute a range of values into the worksheet formulas for you and tabulate the results so they can be viewed easily. In Excel, you can create a single input data table or a two input data table. A single input table will substitute a range of values as a single variable in as many formulas as you like. With a two input data table, you can specify ranges for two input variables, but these input variables can only be applied to one formula. The following example involves a hypothetical consulting firm. Our first goal is to examine the effect of the number of clients for the firm, on the total profit, total expenses, and total income.

Currently, the firm has 10 clients. The values for wages, total client costs, total expenses, and profit are all calculated by formulas dependent on the number of clients the firm can retain. To see what results the profit formula and other formulas would produce for a range of hypothetical client numbers, we can use a single input data table. There are some rules you should follow when building your data table to help ensure that it works correctly. First, list the values that you want to input into the formulas in a row or column of adjacent cells. For this example, a column of input values is used. In the row just above your input column, enter cell references to the formulas that you want to evaluate. Make sure you enter the references starting one cell to the right of the column of input values. In the example spreadsheet that follows, the input variables are in the cell range E5:E30. Cell F4 contains the reference =C5, cell G4 contains the reference =C13, and cell H4 contains the reference =C15, for the total income, total expenses, and total profit formulas respectively.

Excel 2007 Advanced

100

It is a good idea to label your columns appropriately, so you can clearly understand the data table results. In this example, the same labels that appear in the source data are used for the single input data table.

Notice that the formula references (F4:H4) are in a row just above and one cell to the right of the first input variable (E5). The data table is now ready. The input variables are listed in the Clients column and the formula references are one row above and one cell to the right. All of the elements in the data table are clearly identified. The next step is to select the range of cells from the data table containing the input variables and the formula references. In this example, the range is E4:H30.

Excel 2007 Advanced

101

Next, choose the Data Table option from the What-If Analysis menu to display the Data Table dialogue box.

The range of input variables and formula references has been selected, and the Data Table dialogue box is ready for input.

Excel 2007 Advanced

102

Because the input variables are arranged in a column, we will use the Column input cell text field in the table dialogue box rather than the Row input cell field. In the Column input cell text field, enter C3, which is the cell from original data area that contains the number of clients. (Remember that the number of clients is also our chosen input variable.) Clicking the OK button in the Table dialogue box will complete the data table.

Excel 2007 Advanced

103

You can now see at a glance how the 26 different values in the Clients column influence the income, total expenses, and total profit results. If you change the values in the Client column, the data table will recalculate in accordance with the new values automatically. You can apply formatting styles, borders, shading, and other enhancements to the data table in the same way as you would any other area of your worksheet.

If you want to examine the effects of two input variables on a single formula, you can use a two input data table.

Excel 2007 Advanced

104

To build a two input data table, first choose an empty cell and enter a reference to the formula you want to examine. Using the same consulting firm example as before, we will choose cell E2 and enter the reference =C15 for the Profit formula.

The next step is to create two variable ranges. One range will be a column starting in the cell immediately beneath the formula cell and the other range will be a row starting on the immediate right of the formula cell. This means that the formula cell (E2) will be at the upper left corner of the two input data table. For the column of input variables, we will again use the number of clients. For the row of input variables, we will use the Fee Per Client. (The formula for the Profit values is indirectly dependant on both of these variables.) After entering some hypothetical values for the number of clients in cells E3:E15 and some different client fee values in cells F2:J2, we will end up with a worksheet something like this:

Excel 2007 Advanced

105

(Shading, labels, and currency formatting have been added to the data table for clarity.) The next step is to invoke the Data Table dialogue. This time, the formula referenced in E2 will be evaluated once for every combination of Clients and Client fees, that exists in the table. First we will select the range of data cells E2:J14 and then we will choose the Data Table option from the What If Analysis menu.

This time, we have two input variables: one corresponding to the row of Client fees and one corresponding to the column containing the Clients data. In the Row Input Cell text area type C4, because the row of client fees corresponds to cell C4 in the original data. Similarly, in the Column Input Cell, type C3. The Data table dialogue box should look like this.

It is now just a matter of clicking the OK button to complete the table.

Excel 2007 Advanced

106

Now the data table contains speculative profit values based on the number of clients and the fee per client.

Using Goal Seek


Goal Seek is another useful what-if analysis tool provided by Excel. With Goal Seek, Excel will find a value for a specified cell that makes a given worksheet formula equal to a value that you define. In other words, you can set a formula to a value (goal) that you would like to attain, and then specify one of the cells that the formula references as a cell that Excel can adjust in order to reach the goal. Take the following worksheet as an example.

The worksheet clearly shows a negative profit (loss) for the current worksheet values. We can use Goal Seek to find a break even point based on changes to a cell that is referenced (directly or indirectly) by the profit formula in cell B8. The profit formula is Total Income - Total Expenses, or B4 - B7. Cell B2 contains the number of units sold. This will be the cell that we will adjust to break even.

Excel 2007 Advanced

107

First, select cell B8 (the cell with the profit formula), and then invoke Goal Seek by choosing the Goal Seek option from the What-If Analysis menu on the Data Ribbon.

Cell B8 is entered into the Set Cell text field, because that is the cell that you selected just before invoking Goal Seek. In the To Value text field type 0 and in the By Changing Cell field enter B2 (by typing it in directly or by clicking with your mouse). The resulting Goal Seek box should look like the following.

If you click the OK button, Goal Seek will find a value for Cell B2 (Units sold) that will make the profit equal to 0 (break even).

Excel 2007 Advanced

108

The Goal Seek Status box reports that a solution has been found. You can see the value 300 in cell B2. This means that if all other variables remain unchanged, you must sell 300 units to break even. Clicking the Cancel button will restore the original worksheet values, and clicking OK will enter the Goal Seek solution values into the worksheet. You can just as easily use Goal Seek to find the price per unit or the cost per unit that would make the worksheet break even.

Using Solver
Sometimes, when dealing with more complex problems, Excel data tables or the Goal Seek feature cannot provide the kind of forecast or analysis you are looking for. In this type of situation, Excel 2007s Solver feature might be able to help. The solver is an Excel feature that is designed for optimizing systems of equations subject to specific constraints. The solver can be used to find optimal solutions for linear programming problems involving multiple equations and multiple unknowns. An optimal solution might be one that maximizes profit, or it could be one that minimizes costs. Basically, the optimal solution will depend on the context of the situation and what you are looking for. If you are trying to solve a complex problem, the solver will require certain information for it to work correctly. You will have to designate a formula that references the unknowns you want to solve for, and you will have to define constraints that model the given situation. The best way to get an idea of how solver works is to see it used in an example. First, since solver is an Excel add-in, it may not yet be installed. You can check this by clicking the Data tab to display the Data Ribbon. You may see the Solver button to the far right of the ribbon.

Excel 2007 Advanced

109

If there is no solver option, the Solver has not yet been installed. To install the solver, display the Office menu and click the Excel Options button at the bottom. When you see the Excel Options window, choose Add-Ins from the panel on the left, and then use the drop list at the bottom to specify Excel Add-ins.

When you are ready, click Go to display the Excel Add-ins.

When you see the Excel Add-Ins box, put a check next to the Solver Add-in option in the available add-ins list and click OK. When Excel finishes installing the Solver, you should be able to access the Solver option on the Data Ribbon. In order to use the Excel solver, you must set up the worksheet correctly. This requires a solid understanding of the problem you are trying to solve.

Excel 2007 Advanced

110

The following example involves a business that assembles and sells computers. The business sells two desktop models: the Budget PC and the Power PC. The Budget model is less powerful than the other model, but the price is very reasonable. The Power PC has more computing power and storage than the budget model, but it is also more expensive.

From the worksheet, you can see that it takes 3 hours of hardware labor to assemble the Budget PC and 4 hours of hardware labor to assemble the Power PC. Once the hardware is assembled, it takes 1 hour of software labor to install and configure the operating system and other programs on the Budget PC, and 2 hours of software labor to install all the necessary programs on the Power PC. Our goal is to find out how many of each type of computer we should make to maximize our weekly total revenue, and what the maximum total revenue would be. To complicate matters, the business employs one part time software installer available for 30 hours of software labor per week, and two full time hardware technicians that provide 80 hours of hardware labor a week. Also, the company that supplies the business with processors can supply only 10 Power PC processors a week. This means that the total software labor used must be less than or equal to 30 hours for the week and the total hardware labor must be less than or equal to 80 hours. Furthermore, the number of Power PC models we can make in a week must be less than or equal to 10. The following worksheet is the same as the previous one, except that the cell formulas are now visible. Take your time and examine the cell references in the formulas carefully.

Excel 2007 Advanced

111

Cells B4 and C4 hold the number of hardware and software labor hours required to build a Budget PC. Similarly, cells B5 and C5 contain the number of hardware and software hours required to assemble a Power PC. The revenues from the Budget computers can be calculated by multiplying the number assembled by the sale price. (This is what the formula in F4 does.) The revenues from the power computers are calculated by a similar formula in cell F5. Notice that in both cases, the revenue formulas depend on the number of computers assembled (cells D4 and D5). Because of this, the total revenue formula (F6) is indirectly dependent on D4 and D5. The formula we want to optimize (also known as the objective formula) represents the total revenue (F6). The cells we will change to maximize the total revenue formula represent the quantities of each type of computer assembled (D4 for Budget PC, and D5 for Power PC). The constraints for this problem are shown in the green highlighted area. It is not absolutely necessary to label the constraints as they are shown here, but clearly identifying them on the worksheet helps when entering the constraints in the solver. Basically the constraints specify that the hardware hours are to be less than or equal to 80, the software hours are to be less than or equal to 30, the number of Power PCs that can be assembled is less than or equal to 10, and the number of each type of computer assembled has to be greater than or equal to 0. This last constraint may seem obvious and silly, but it is important to include it so the solver knows that using negative values in the changing cells is not an option when optimizing the objective formula. The formulas that calculate the total software hours and hardware hours used are in cells G4 and H4 respectively. You should notice that these formulas are also dependent on the number of each computer type assembled. To summarize, in order to use Excels solver you must have a formula to optimize (called the objective formula) and you must have cells that can be changed to optimize the objective. The cells to be changed should be precedents to the objective formula; that is, the calculation of the objective formula should depend on results in the precedent cells. If constraints are involved, the formulas to be subjected to the constraints should also be dependent on the changing cells.

Excel 2007 Advanced

112

In the preceding worksheet, Cells G4 and H4 contain formulas that are subject to the constraints. Cell F6 contains the objective formula, and cells D4 and D5 are the changing cells. You should notice that the formulas in cells G4, H4, and F6, are all dependent on the changing cells (either directly or indirectly). Note: It is assumed throughout that there is enough demand to ensure that every computer made will be sold. To use the solver, click the Solver button on the Data Ribbon to display the Solver Parameters dialogue box.

Place your cursor in the Set Target Cell text box and click on the worksheet cell that contains your objective formula (cell F6 from the preceding worksheet). Since we want to find the maximum total revenue, select the Max radio button next to the Equal to label. To enter the changing cells, place your cursor in the text area under the By Changing cells heading, and select the appropriate cells from the worksheet with your mouse. If they are non adjacent cells, press the Ctrl button when selecting them. For the problem shown here, the changing cells are D4 and D5. The next step is to add the constraints by clicking the Add button to the right of the large white constraints area. This will display the Add Constraint box.

Excel 2007 Advanced

113

Place the cursor in the Cell Reference text field, and then select a cell with a formula you want to constrain. In this particular example, cell G4 is selected, which contains the formula for calculating the total software hours used. Follow the same process for the Constraint text field. In this example, cell H11; containing the value 80 is entered. Next, use the drop down list in the center to specify the type of relationship required between the two cells. In this case, the constraint reads G4 <= H11 (that is, total software hours <= 80). Click OK to enter the constraint into the Solver Parameters dialogue box, which now looks like this.

Click the Add button again and follow the same process to enter the cell references for the rest of the constraints:

Total hardware hours <= 30 (H4 <= H10) Number of Power PCs <= 10 (D5 <= H12) Number of Power PCs >= 0 (D5 >= H13) Number of Budget PCs >= 0 (D4 >= H13)

Excel 2007 Advanced

114

Here is the resulting Solver Parameters dialogue.

Here is the corresponding worksheet with formulas shown.

Examine the worksheet so that you understand the relationships between the target cell, the changing cells, and the constraints specified in the Solver Parameters box. To implement the solver, click the Solve button in the Solver Parameters dialog. If you designed the worksheet correctly, and entered the correct cell references and constraints, you should see the following Solver Results box.

Excel 2007 Advanced

115

The values that maximize the total profit will now be visible in the changing cells (D4 and D5). The value of the maximum profit will be visible in the target cell (F6). The keep solver solution radio button will be selected by default. If you click OK the new values will remain in the worksheet. If you select Restore original values, the solutions that the solver found will not be entered into the worksheet and the original values will be retained. You have the option to save the solver results as a scenario that you can name and reload into the worksheet at a later date (refer to lesson 1.4). You can also select one or more report types from the list at the right of the Solver Results box. These formatted reports will be generated on separate worksheets. This following image shows an answer report based on the solver solution. It is generated on a separate worksheet if you select Answer from the report list in the solver results box.

Excel 2007 Advanced

116

This is the same worksheet after the price of the Budget PC has been changed to 750; and the solver has been applied with the same target, changing cells, and constraints as before. Notice that because the price has been changed, the solution is now 20 Budget PCs and 5 Power PCs for a total revenue of 21000.

Instructor Note: The solver can also be used as an advanced Goal Seek tool. You can specify a goal value for the formula in the target cell, and then select multiple changing cells that the formula is directly or indirectly dependent on. The Solver will find a solution for the values in the changing cells that satisfies the goal value of the target formula. No constraints are required.

Here, the target cell F6 contains a formula that has been set to equal the value 50000. The solver will find values for the precedent cells D4, D5, E4, and E5, that will satisfy this goal. (Notice that the Value Of radio button has been selected.)

Excel 2007 Advanced

117

Section 2: Review Questions


1. A. B. C. D. 2. A. B. C. D. 3. A. B. C. D. 4. A. B. C. D. 5. A. B. C. D. 6. A. B. C. D.

You can use the Excel outlining feature to Help organize your data Condense data into a suitable view for printing Group data according to subtotals All of the above The outline (grouping) buttons are found on which ribbon? View Insert Data Formula When using a PivotTable, you can Build the table and then reorganize the data in the table as you require Build the table according to a planned layout Build the table based on external data All of the above When you create a PivotTable, you should also see A regular data table A PivotTable dialogue box A PivotTable field list A PivotTable query In Excel 2007 the scenario feature can be found on the Data Validation button group Consolidate menu What-If Analysis group Outlining buttons Which of the following is not a what-if-analysis tool? Goal seek Data validation Solver Single input data table

Excel 2007 Advanced

118

7. A. B. C. D. 8. A. B. C. D. 9. A. B. C. D. 10. A. B. C. D.

To optimize a system of equations with solver, you need to specify Constraints Solutions Problems Data tables Which of the following is true? You should use Goal Seek to optimize systems of equations. You should use scenarios to optimize systems of equations. You should use Scenarios to compare the results of different sets of values in a spreadsheet. A single input data table is the same as a Scenario. Which of the following is true? You cannot base a chart on a PivotTable You can base a chart on a PivotTable You can solve a system of equations with a PivotTable All of the above To refresh a PivotTable you can Right click on a cell in the table and choose Refresh Data Click the Refresh Data option on the Review Ribbon You cannot refresh a PivotTable All of the above

Excel 2007 Advanced

119

SECTION 3: Excel and the Internet


In this section you will learn how to: Insert a hyperlink Modify a hyperlink Use a hyperlink in Excel Save a workbook as a Web page Save a worksheet as a Web page Save a chart as a Web page Save a range as a Web page Create a Web query Save a Web query Refresh a Web query Prepare a workbook for Excel services Publish to a document server Save to a document management server

Excel 2007 Advanced

120

Lesson 3.1: Excel and Hyperlinks


This is an Excel worksheet that contains three hyperlinks.

In this lesson, you will learn about hyperlinks and the Internet. You will learn how to insert hyperlinks into a worksheet, how to modify hyperlinks in a worksheet, and how to browse hyperlinks in Excel.

What is a Hyperlink?
A hyperlink is an item in a file that links to another location in the same file, or to another file altogether. Word processing documents, workbooks, and Web pages are all types of files that can contain hyperlinks. When you click on a hyperlink, the file or location that is associated with the link will appear on your screen. The files connected by hyperlinks do not have to be in the same directory, or even on the same computer. In fact, you can have a hyperlink in one file that links to a file thousands of miles away. The World Wide Web makes extensive use of hyperlinks to link Web pages. The web is the place where most computer users become familiar with hyperlinks. Quite often, hyperlinks come in the form of an underlined word or phrase in a bright blue font (Like This). This does not always have to be the case as hyperlinks can be a word, a phrase, a symbol, or a picture. Each hyperlink has a statement called a URL (uniform resource locator) associated with it. The URL tells where the file or object that the hyperlink points to is located and what protocol should be used to retrieve it. A typical URL that you might see in the address bar of your web browser could look something like: http://www.something.org. When you click

Excel 2007 Advanced

121

on a hyperlink, the information in the URL associated with it is used to locate and retrieve the linked file or object. As stated previously, hyperlinks are items in a document, worksheet, or Web page that link to another location or file. When you click on a hyperlink, an associated URL is used to locate and retrieve the object or file that the hyperlink points to. In the case of the World Wide Web, hyperlinks are used to link and unify Web pages that are located all over the world. You can create a hyperlink in an Excel workbook that links to an object located in the same directory or on the same computer as the workbook. You can also create a hyperlink that points to a Web page or a file on a remote server. Furthermore, you can create a hyperlink that points to a location in the same workbook or to a specific e-mail recipient. When you are clicking hyperlinks, you may be requesting files or objects located on remote servers. The World Wide Web is a vast collection of Web pages and other objects that are connected via hyperlinks. When you click a link to a Web page or file on the web, the information is transported to your computer over the underlying infrastructure of the Internet. A computer network can be described as two or more computers connected in such a way that they can exchange information. Computer networks can range in size from small networks with only a few computers to very large networks with many interconnected machines. Essentially, the Internet is a network of networks. That is to say, the Internet is a huge network that is comprised of many smaller interconnected networks spanning the globe. Computers connected to the Internet can use hyperlinks to retrieve objects from other locations. These objects are transported from computer to computer, over the giant inter-network commonly known as the Internet. Some important points to remember: A hyperlink is used as a clickable link to another object. A URL is associated with a hyperlink to provide information on how to retrieve the linked object. You can create hyperlinks to locations within the same file, to local or remote files, to Web pages, to media objects, and to e-mail recipients. Hyperlinks can be created in the form of a word, phrase, symbol, picture, or graphic. Web pages in the World Wide Web are often linked together with hyperlinks. When you retrieve a remote file or object (like a Web page) by clicking a hyperlink, the information is transported to your computer via the hardware infrastructure of the Internet. Hyperlinks should link to publicly available files or Web pages. If Sue sends me a workbook with a hyperlink to a file on her computer, I am probably not going to be able to access that file (unless we are on the same network and that file or folder is shared).

Excel 2007 Advanced

122

Inserting Hyperlinks
In Excel 2007, you can insert hyperlinks directly into your worksheets. You might want to insert a link to another location in the same workbook or to another Excel workbook located on the same computer. You might also want to insert a link to a Word document or to a Web page. No matter what type of hyperlink you want to create, the first step is to invoke the Insert Hyperlink dialogue box. To display the dialogue, select the cell that will contain your hyperlink, and then click the Hyperlink button on the Insert Ribbon.

This will open the Insert Hyperlink dialog.

You can see four buttons running down the left side of the dialogue box under the Link to: heading. You can use these buttons to create a link to an Existing File or Web Page, a Place in This Document, Create New Document, or to an E-mail Address. You can enter the text for your Hyperlink in the Text to display field at the top of the dialogue box. This text will appear as a blue underlined hyperlink in the cell that you have selected.

Excel 2007 Advanced

123

If you choose the Existing File or Web Page button, you will see a drop list labeled Look in just below the Text to display field. You can use this list to browse through the various folders on your computer to find the file that you want to create a link to. When you select a folder or drive from the drop list, a list of available files or folders corresponding to the selection will appear in the large center area of the dialogue box. You will also notice three buttons just to the left of the large center area labeled Current Folder, Browsed Pages, and Recent Files. If you click Current Folder, the files and subfolders of the current folder in the drop list will be displayed. If you click the Browsed Pages button, a list of the URLs for Web pages you recently visited will be displayed. If you click on the Recent Files button, you will see a list of recently accessed files. If you make a selection from any of these lists the URL (or address) of the file will be entered into the Address field at the bottom of the dialogue box. You can also type a URL for a Web page or remote file, or the path to a local file directly into the Address field. In any case, the file or object referred to in the Address field will be the target of the hyperlink. You can click the screen tip button in the upper right of the dialogue box to add a brief comment that will appear when the mouse pointer hovers over the hyperlink.

You can use the Bookmark button to link to a specific location (like a cell range) in another Excel workbook. First, select the Excel file from the list, and then click the Bookmark button to specify the exact location within the selected workbook. When you have finished making the necessary entries in the Insert Hyperlink dialogue box, you can click OK to create the hyperlink Instructor Tip: Another way to create a hyperlink in a worksheet is to select a cell, right click on it, and choose the Hyperlink option from the drop down menu. Clicking a cell and pressing the Ctrl + K keys will also work.

Modifying Hyperlinks
To change the text of an existing hyperlink, you can right click on it and edit the text in the formula bar. You can also right click the hyperlink and select Edit Hyperlink from the drop down menu. This will display the Edit Hyperlink dialogue which is similar to the Insert Hyperlink dialogue.

Excel 2007 Advanced

124

You can now change the target for the hyperlink, the ScreenTip, or the text to display. You can also remove the hyperlink from the worksheet by clicking the Remove Link button. When you are finished with your modifications, click OK to implement them. Note: Remove Hyperlink and Open Hyperlink are also options on the drop down menu, available when you right click on a hyperlink. Hyperlinks will generally appear in one color (bright blue by default) before they have been clicked, and in another color (purple by default), after they have been clicked. You can change the font color and size for an individual hyperlink by right clicking on it, and choosing Format Cells from the drop down menu. This will display the Format Cells dialogue box, which you can use to modify the font color, size, border, shading, and alignment of the link.

Excel 2007 Advanced

125

The method just described will allow you to modify individual hyperlinks, but what about modifying the default color and font size for all hyperlinks? To change the default style for all hyperlinks, click the Cell Styles button in the Style group on the Home Ribbon to display the pre-set cell styles. Find the Hyperlink style, right click on it, and choose Modify from the menu that appears.

Excel 2007 Advanced

126

This will display the Style dialogue.

Make sure that the word Hyperlink is selected at the top of the Style box. You should be able to see a checkmark next to the word Font in the column of check boxes on the left. This means that the style for hyperlinks currently includes only font settings. Click the Format button to display the Format Cells dialogue box where you can make changes to the borders, shading, font size, font color, and alignment for all hyperlinks. When you are finished modifying the hyperlink style, click the OK button in the format cells dialogue. You will now see the Style

Excel 2007 Advanced

127

dialogue, with checkmarks corresponding to the style changes you have made. Click the OK button in the style box to implement the style changes. Now every new hyperlink you create will have this new style by default.

Instructor Note: You can change any of the preset cell styles available under the Cell Styles button by following the procedure described above.

Using Hyperlinks in Excel


To follow a hyperlink in Excel 2007, click on it and hold it until the mouse pointer turns into a pointing hand. When you see the hand, release the mouse button and the target for the link will be opened with the most appropriate program for it. For example, if you click, hold, and release a link to a Word document, the document will open in Microsoft Word. If you click, hold, and release a link to an Access database, the database will open with Microsoft Access. If you click, hold, and release a link to a Web page, the page will open with your default Internet browser.

Excel 2007 Advanced

128

The following worksheet contains two hyperlinks.

The first link is to a Word document and the second is to another Excel spread sheet. The two linked documents as well as the current workbook are all in the same file folder, though this does not have to be the case. If you click, hold, and release the first link (Test.doc), the target document will open in Microsoft Word. If we click, hold, and release the second link (in cell B11) another worksheet (the link target) will open in Excel.

You can see that the followed hyperlinks are now purple, the default color.

Excel 2007 Advanced

129

To remove a hyperlink from your spreadsheet, right click on the cell containing it and select Delete from the pop up menu. This will remove the target information from the hyperlink, as well as the hyperlink text itself. The cell in question will be left empty. You can also right click on a cell with a hyperlink, and select Remove Hyperlink from the pop up menu. This will remove the target information from the link (the link will not function), but the text of the link will remain in the cell. You can also insert a hyperlink function by clicking the fx button by the formula bar. This will display the Insert Function dialogue, from which you can select the Hyperlink function.

Excel 2007 Advanced

130

If you click the OK button in the dialogue, the Function Arguments box will appear.

In the Link Location field, you can specify the target of the link. This can be a Web page URL, a local file, or a file on a network server. In the Friendly Name field, you can specify the particular text or number that will appear as a link in the spreadsheet. When you click OK, the link will be inserted into the spreadsheet. You can also specify an image or other graphic as a hyperlink in your spreadsheet. To do this, select the image or graphic by clicking on it. When the graphic is selected (has a perimeter border around it) click the Hyperlink button on the Insert Ribbon.

When you see the Insert Hyperlink dialogue, specify a URL or file location as the target of the hyperlink, and then click the OK button to associate the linked location to the image or graphic. When you click, hold, and release the image, the link will be followed to its target just like a regular hyperlink.

Excel 2007 Advanced

131

Lesson 3.2: Saving Workbooks as Web Pages


There may be occasions where you want to make your Excel data available on the Web. For instance, you may want to allow fellow employees to view your Excel workbook or worksheet from their homes or when they are away travelling. You may even want to make your Excel data part of a larger online presentation. This lesson will deal with creating Web pages from Excel 2007 spreadsheets.

The image shown above is an example of an Excel 2007 worksheet saved as a Web page. The worksheet is being viewed with an Internet Explorer browser. In this lesson you will learn about MHTML and HTM files. You will learn how to save a workbook as a Web page, how to save a worksheet as a Web page, how to save a chart as a Web page, and how to save a data range as a Web page.

Excel 2007 Advanced

132

HTM and MHTML Files


When you create a Web page based on an Excel workbook, you can create the Web page as either an HTM file or an MHTML file. An Excel workbook that has been saved as a Web page can be published to a web server to be viewed with a web browser. You can then access the data on the Web page from practically any location with an Internet connection. When you view Excel data as a simple Web page in your browser, it is a read only situation. That is to say, you cannot modify, edit, or save changes to the data on the Web page. To distribute an Excel workbook in such a way as to modify, edit, or save changes, you should use a shared workbook on a SharePoint Server (see Lesson 3.4). When you save a workbook or worksheet as a Web page, you can save it as an HTM or an MHTML file. An HTM file is essentially the same as a traditional HTML file, except that the last letter has been dropped from the extension for compatibility with systems that cannot handle four letter extensions. When you save an Excel workbook as an HTM file, Excel will automatically add HTML tags as necessary to create a file that can be retrieved and viewed by practically all web browsers. Here is some of the HTM source code for a worksheet saved as an HTM Web page.

When you save a workbook as an HTM Web page, pictures, graphics, or data on multiple worksheets will not be saved as one file. Instead, a file folder will be created containing the separate file components needed to reproduce the worksheet as a Web page.

Excel 2007 Advanced

133

Here are the contents of a folder created by Excel 2007 for a simple HTM Web page.

Also, when you save a workbook that contains images as an HTM format Web page, some image quality may be lost. The advantages of this format are that virtually all browsers support the widely used HTM and HTML formats and they are relatively safe with respect to carrying malicious programs/viruses. To save your workbook as an HTM format Web page, invoke the Save As dialogue under the Office menu, and choose Web Page from the Save As type list.

When you are ready, click the Save button to create the Web page. If you place the newly created HTM page and associated file folder on a web server, the workbook data will be accessible to anyone with a web browser and an Internet connection. MHTML file format is short for Multipurpose Internet Mail Extension HTML (or MIME HTML). This format allows a number of different workbook objects to be saved in a single file. If you save your workbook as an MHTML (or MHT) Web page, your images and objects will all be saved in one file. A separate folder to contain the Web page components will not be required. Also, images and other graphical elements contained in the Web page may display better in your browser than the same images contained in an HTM Web page. In addition, if you create an MHTML Web page, you only have to deal with a single file when you are publishing it on a web server. On the downside, some browsers may not open MHTML files easily (al though Internet Explorer should have no problems opening this file type). Also, it is possible for an MHTML file to carry a virus or malicious code.

Excel 2007 Advanced

134

To save your Excel data as an MHTML file, select the Single File Web Page option from the Save As Type drop list in the Save as dialogue.

Saving a Workbook as a Web Page


To save an Excel workbook as a Web page, open the workbook that you want to create a Web page from and choose Save As from the Office menu. In the Save In text field, specify a location to save your file, and then select Web Page or Single File Web Page from the Save as type drop list at the bottom. Next, make sure the Entire Workbook radio button is selected, and then click the Save button to save the workbook as a Web page.

Alternatively, select the location you want to save to, and specify Web Page or Single File Web Page as the file type. Then click the Publish button to display the Publish as Web Page dialogue box.

Excel 2007 Advanced

135

In the Publish as Web Page dialogue, select Entire Workbook from the Choose drop list, and click Publish to save the file as an HTM or MHTML Web page. If you wish, you can use the check boxes at the bottom of the page to specify that the file is to be automatically republished every time the workbook is saved, and that the file open in a web browser once it is published. When you save a workbook as a Web page, you may see the following alert.

This is just telling you that some features of the workbook may not be preserved in a Web page format. If you are sure you want to create a Web page from the workbook click Yes to continue. Otherwise, click No. It is always a good idea to save your workbook as a normal Excel workbook file for back up, before you save it as a Web page.

Excel 2007 Advanced

136

Here you can see the three worksheet tabs included at the bottom of the Web page. Clicking on a particular sheet tab in the Web page will open up the data for the given sheet in your browser. These tabs are available because the entire workbook was saved as a Web page.

Saving a Worksheet as a Web Page


To create a Web page from a single worksheet, open the Excel workbook that contains the sheet you want to use and invoke the Save As dialogue from the Office menu. In the Save As dialogue box, specify Web Page or Single File Web Page in the Save As Type drop list. Make sure that you specify a save to location in the Save In drop list at the top of the dialogue box, and be sure to select the Selection: Sheet radio button. When you are ready, click the Save button to create the HTM or MHTML file.

Alternatively, you can specify Web Page or Single File Web Page as the file type, choose a location to save to, select the Selection: Sheet radio button, and click the Publish button.

Excel 2007 Advanced

137

In the Publish as Web Page box, you can specify the particular sheet that you want to publish as a Web page by selecting from the Choose drop list. When you have specified the settings that you prefer, click the Publish button to create the Web page.

Saving a Chart as a Web Page


First, open the Excel workbook that contains the chart that you want to save as a Web page.

Excel 2007 Advanced

138

The next step is to choose Save As from the Office menu to display the Save As dialogue box. In the Save As box select Web Page or Single File Web Page as the file type and specify a name and a location for the Web page files. When you have done this, click the Publish button.

In the Publish as Web Page box, select the appropriate items from the Choose drop list. Configure any other settings that you want to apply and then click the Publish button to create the Web page.

Excel 2007 Advanced

139

Saving a Range as a Web Page


To save a range from a workbook as a Web page, open the appropriate workbook and select the range of data that you want to use.

The next step is to use the Office menu to display the Save As dialogue box. In the Save As box, select Web Page or Single file Web Page as the file type, choose a name for the file, and select a location to save the file in. Next, click the Selection: radio button, and when you are ready, click Save to create the Web page.

Excel 2007 Advanced

140

Alternatively, you could click the Publish button and use the Publish as Web Page box to specify the range and create your Web page.

Excel 2007 Advanced

141

This is an image of a Web page created from an Excel workbook range.

Instructor Note: For the purposes of this lesson, the Web pages were saved to an ordinary folder on the local machine. Normally, when you create Web pages that are to be accessed over the internet, they are placed in an HTML directory on a Web server. Also, when you save a workbook as an HTM Web page, there can be multiple files created besides the standard HTML file. These files can include HTML files for the individual worksheets, an XML file and a cascading style sheet to uniformly format the worksheets. The files are created and placed in a folder that should be located in the same directory as the main HTML file.

Excel 2007 Advanced

142

Lesson 3.3: Getting Data from the Internet


In Lesson 3.2, you learned how to prepare your data as a Web page in order to share information over the Internet. In this lesson, the emphasis is on retrieving data from the Internet by designing queries that extract information from Web pages.

In this lesson you will learn how to import data from a Web page over the Internet. You will learn what a Web query is, how to create a Web query, and how to save and refresh a Web query.

Importing from an External Data Source


As an introduction to importing data from the Internet, we will take advantage of an existing web connection that comes with Excel 2007. First, open an empty Excel workbook, and click the Existing Connections button on the Data Ribbon.

Excel 2007 Advanced

143

When you do this, an Existing Connections dialogue box like the following will appear.

The Existing Connections dialogue provides a list of connections that you have made to databases, SharePoint files, or files on your local computer. In addition to any connections you have made in the past, you should notice three MSN MoneyCentral queries. These MSN connections should be available automatically when Excel 2007 is installed. As an example, if you select MSN MoneyCentral Investor Currency Rates from the list of connections and click the Open button in the lower right, an Import Data dialogue box will appear. With this box, you can specify where you want the imported data to be located. Choose a location in the current worksheet or in a new worksheet and click the OK button to continue. (In this example, the imported data will be placed in a block of cells starting at Cell A1.)

Excel 2007 Advanced

144

The results of the Web query will be entered into the worksheet starting at the specified cell location.

Clearly, this is a direct and simple way to include data from the web in your workbooks. Of course, you are not limited to the pre-packaged existing connections. Excel 2007 enables you to create your own web queries to extract information from the Web page of your choice.

Excel 2007 Advanced

145

Instructor Note: To import data from external sources with web queries, you will need access to an Internet connection. If you are behind a firewall, you may have to configure the firewall to give Excel access to the Internet.

Creating a Web Query


To create a Web query from scratch, first click the Data tab to display the Data Ribbon, and then click the From Web button.

This will display the New Web Query dialogue.

At the top of this window, you will see an address bar, back and forward buttons, stop and refresh buttons, and a save button. The New Web Query window is very much like a web browser. If you type a URL (Web page address) in the Address field, the Web page will be loaded into the Web query window so you can view it. If you click on a hyperlink, the target of the link will be loaded in the window just like a web browser. You can navigate through visited pages by using the backward and forward buttons. You can even load your favorite search engine and perform web searches from within the New Web Query window.

Excel 2007 Advanced

146

After you load a Web page, you will notice yellow highlighted arrows pointing to different areas of the page. These arrows indicate the data that Excel can import. You can click these yellow highlighted arrows to select the given data for inclusion in your Web query. Excel is quite good at importing tables of data, and normally there will be an arrow pointing to every table on the Web page that can be imported. You can import a single table, multiple tables, or plain text with a Web query. When you click an arrow, it will turn into a green highlighted checkmark. Only the data indicated by checkmarks will be imported to your Excel worksheet.

When the data you need has been selected with checkmarks, click the Import button to enter the data into your Excel worksheet. You will be then be asked to specify a location in the worksheet for the imported data.

Excel 2007 Advanced

147

When you have chosen a place for the imported data, click the OK button on the Import Data dialogue.

This image above shows the results of the Web query. Only the data selected with a checkmark has been imported into the Excel worksheet.

Excel 2007 Advanced

148

Saving a Web Query


If you want to save a Web query for future use in other worksheets and workbooks, right click on the imported data range and select Edit Query from the menu that appears.

This will cause the Edit Web Query window to appear.

Excel 2007 Advanced

149

In this window you can click the Save button to show the Save Query dialog.

You can use the Save Query dialogue box to specify a name for your Web query and a location to save it in. For consistency, you should save all your queries in the default Queries folder.

You can also save your query when you create it by clicking the Save button in the New Web Query window before you click the Import button. After you have saved your query, you can easily access it from any Excel workbook by clicking the Existing Connections button on the Data Ribbon. When you click this button, you will see an Existing Connections dialogue with a list of connections including any web queries you have saved.

Excel 2007 Advanced

150

In the Existing Connections box, just select the name of your query and click the Open button to import the data. You can also click the Browse for More button if you have a query that is not saved in the default Queries folder.

Refreshing a Web Query


After you create a Web query for a particular Web page, it is quite possible that the data on the Web page will change over time. Stock quote information can change frequently, as can other types of financial data available on the web. To update your worksheet with the latest data, you will have to refresh the Web query. To do this, right click on the data range imported by the query and click Refresh from the menu that appears.

Excel 2007 Advanced

151

This action will refresh the data if the source information has changed since the last time your imported data was refreshed. If you right click on the imported data range and select Data Range Properties from the menu that appears, you will be presented with options for refreshing the imported data and for modifying the data range.

Excel 2007 Advanced

152

You can see the name of the data range in the Name field. You can edit this name as you wish, and use it as a defined name for the range in place of standard cell references. Under the Refresh Control heading, you can place a checkmark in the box labeled Refresh Every and select the time duration of your choice. For instance, if you select 10, the data range will be refreshed every 10 minutes. (You can also choose to have the data refreshed every time the file is opened.) You can also adjust the formatting and layout options of the data range, and specify what should happen if the range changes (gets larger or smaller) when it is refreshed. Finally, you can click the Refresh All button on the Data Ribbon to refresh any external data connections that you have in your workbook.

Instructor Note: To refresh a Web query that imports data from an external Web page, you must be connected to the Internet.

Excel 2007 Advanced

153

Lesson 3.4: Excel and Office Servers


A document server, in a basic sense, is a storage area or repository where authorized users can save or access documents. The document server is normally accessible via a local network (or through the Internet) and is generally protected by a server password/username combination. Some Microsoft document servers offer version control features (to help manage shared documents), search features, and separate sub-sites to help organize documents on a team by team, or project basis. These SharePoint servers are often used as an office or company portal, allowing coworkers to share and collaborate on a number of different document types. In this lesson, you will learn how to publish a document to a document server and how to save a document to a documents server. You will also learn about using Excel with Excel Services, a special feature of Microsoft SharePoint server 2007 that is specifically designed for Excel documents.

Publishing to a Document Server


To publish a document to a document server (as a PDF or XPS file), you must first have the PDF/XPS add-in installed. (This add-in can be obtained from http://office.microsoft.com; for more information, see the Excel Intermediate manual.) Once the add-in is installed, let your mouse pointer hover over the small arrow next to the Save as option on the Office menu.

Excel 2007 Advanced

154

This will display a list of save options.

If you click the PDF or XPS option you will see a Save As dialogue box like the following.

Excel 2007 Advanced

155

PDF stands for Portable File Document, which is a widely used document standard. PDF files maintain good visual quality in a small document size and can be viewed with software like Adobe Acrobat. XPS stands for XML Paper Specification, which is an XML based electronic document format. This format is intended to allow users to easily create, print, share, and store documents in a way that can be conveniently managed along with other Office 2007 files. Once you choose a format to publish your document in (for this example it will be PDF), you can use the Optimize For controls at the bottom of the dialogue to specify a Standard or Minimum optimization setting. For the Standard setting, document quality is emphasized for better print results, whereas for the Minimum setting, document size is optimized. (A smaller file size means faster downloads and uploads for online documents.)

When you finish specifying the format for your published document, you can then specify at what location the document will be published. Because you want to publish to a document server, you should click the My Network Places button on the left side of the dialogue.

Excel 2007 Advanced

156

When you see the list of network locations, click and highlight the location that corresponds to your document server. In this example, the document server is the last entry in the list, sps.velsoft.com. The sps part of the server name provides a clue, because SPS stands for SharePoint Portal Services. (SharePoint servers are a type of Microsoft Document server). If you cannot see an appropriate document server in the list, enter the URL for the document server in the File Name field. The URL for the document server in this example is http://sps.velsoft.com/default.aspx, but your own document server will of course have a different URL. (Please see your instructor or your IT personnel for more information on this.) If you specify a URL in the File Name field, the document will be given a default name when it is uploaded to the server. After you specify the document server by highlighting it in the main viewing area, or by specifying the URL in the File name field, click the button in the lower right of the dialogue. If you select the document server from a list in the dialogue box, the button in the lower right will say Open. If you click the button, typically you will be presented with a username and password dialogue for access to the server. When you correctly enter your username and password, you will have access to the server so you can upload your document. If you enter the path to the server in the File Name field, the button will say Publish. If you click the button, you will see the password/username dialogue for the server. If you enter the correct username and password, you will be able to publish your document.

Saving to a Document Management Server


To save an Excel workbook to a Document Management Server, first display the Office menu, and then select the Publish option from the list of menu items.

Excel 2007 Advanced

157

From the Publish sub menu, click on the Document Management Server option to display a Save As dialogue like the following.

Excel 2007 Advanced

158

This dialogue will only show you locations that are available on your network. The next step is to click on the location in the main viewing area that corresponds to your document management server. In this example, sps.velsoft.com is the document management server, but your document server will have a different name. (If you do not see your document server in the list, obtain the document server URL from your instructor or IT personnel and enter it into the File name field.) Once you are ready, click the button in the lower right to save the workbook on the document server. If you select the server name from a list in the dialogue box, the button in the lower right will say Open. Clicking on the button will display a password/username request dialogue. If you enter the password and username correctly, you will be able to browse to a location on the document server where you can save the file. If you enter the server URL into the File Name field, the button in the lower right will say Save. Once again, if you click the Save button, you will have to enter a username and password to gain access to the server.

If you enter the username and password information correctly, you will be able to browse the directories on the document server to find an appropriate location in which to save your work.

Using Excel with Excel Services


Excel Services is a new technology designed by Microsoft to provide server side Excel functionality to users. When you connect to a document server (a SharePoint server for example), your computer (or an application on your computer) becomes a client communicating with the server. If you download a spreadsheet from a server, open it in Excel, and modify or reformat it, you are performing client side work. This is because most or all of the work is being done in Excel on the client computer. With Excel Services, a degree of server side work will be possible; that is, users will be able to interact with, perform calculations on, filter, sort, and edit, specified cells in a workbook. The

Excel 2007 Advanced

159

important thing is, the Excel work (such as calculations, cell changes, and other interactions) will be handled server-side. This allows multiple users to work on a single spreadsheet from the server without each user having to download and open their own copy of the workbook in Excel. This will prevent multiple unsynchronized copies of the same workbook from being circulated through an organization. In a situation where a single spreadsheet must be viewed and modified by multiple users, only a single copy of the spreadsheet will exist on the server, and all users will interact with this one spreadsheet. In addition, Excel Services will allow users to view and interact with the serverside spreadsheet in a web browser. However, the initial spreadsheet that will be used on the Excel Services server must be created in Excel 2007. Also, users will not be able to edit Excel formulas when they view the spreadsheet in their browser. They will, however, be able to change the data in specified cells that are referenced in a formula and see the results when the spreadsheet is recalculated. The plus side of this (in terms of security) is that important (sensitive) spreadsheet formulas will not be visible or editable, which means that users can change data and see the results of a given formula without seeing or modifying the details of the formula itself.

Instructor Note: Excel Services is packaged with Microsoft SharePoint Server 2007. You must use SharePoint 2007 as your document server to take advantage of Excel Services.

To use Excel Services, first layout and build the spreadsheet that you want to make available. If there are specific cells that you want to make editable in a users web browser, name the cel ls by selecting them (individually) and typing a name in the cell name field by the formula bar.

When you have named each individual cell that you want to be editable, display the Office menu and then display Publish sub menu. From the Publish sub menu, click Excel Services.

Excel 2007 Advanced

160

This action will display a Save As dialogue box. In the box, click the Network Places button and highlight the Excel Services server from the list of network locations by clicking on it.

In the bottom right of the dialogue, you will see an Excel Services Options button. If you click this button, you will be able to set parameters and specify what elements of the workbook will be viewable in a web browser.

Excel 2007 Advanced

161

When you click the Excel Services Options button, the entire workbook will be shown by default. (Please notice the checkmarks next to the sheet names under the Entire Workbook.) You can specify which worksheets will be shown be Excel Services by choosing the Sheets option from the drop list.

Only items with checkmarks will be shown by Excel Services.

Excel 2007 Advanced

162

You can also specify particular (named) items in a workbook or worksheet. These items will be shown by Excel Services only if they are checked.

Remember that part of the process of creating a worksheet for Excel Services is naming specific cells so users will be able to edit them. If you click the Parameters tab in the Excel Services Options dialogue, you will be able to add the named cells to a list of cells that Excel Services will allow users to edit.

Excel 2007 Advanced

163

By clicking the Add button, you will see the following dialogue box.

This box contains a list of the named cells in your workbook. If you place a check mark next to the named cell and then click the OK button, the named cell will be added to the list of parameters. When the spreadsheet is saved to Excel Services, the named cells in the parameter list will be editable in a web browser by anyone that can access the server.

Excel 2007 Advanced

164

Click OK on the Excel Services Options dialogue to return to the Save As dialogue. When you are ready, click the Save button at the bottom right of the Save as dialogue to save your workbook in Excel Services. If you put a checkmark in the checkbox labeled Open this workbook in my browser after I save, the workbook will open in your browser so you can see if Excel Services is displaying the workbook as you intended. (Note: The Save button in the bottom right of the dialogue may say Open if you specify that the workbook will open in a browser after it is saved.)

Excel 2007 Advanced

165

Section 3: Review Questions


1. A. B. C. D. 2. A. B. C. D. 3. A. B. C. D. 4. A. B. C. D. 5. A. B. C. D. 6. A. B. C. D. 7.

URL stands for Uniform Resource Locator Universal Read Locator Uniform Random Locator Universal Resource Loading A hyperlink can be used to link. To a Web page To another location in the same document To a file All of the above To follow a hyperlink in Excel 2007 you should Click, hold and release Click and hold Right click All of the above The MHTML format allows you to create An Excel Services Web page A shared workbook A single file Web page None of the above With Excel 2007 you can convert . A range to a Web page A worksheet to a Web page A workbook to a Web page All of the above Which of the following statements is true? A Web query is the same as a Web page A Web query is the same as a hyperlink You cannot refresh a Web query A Web query retrieves data from a Web page

To refresh a Web query you should A. Reload the Web page B. Create the Web query over again C. Click the Web query hyperlink

Excel 2007 Advanced

166

D. 8. A. B. C. D. 9. A. B. C. D. 10. A. B. C. D.

Right click on the data from the query and choose the Refresh option You can use a document server to Share documents with other users Access documents created by other users Organize shared documents All of the above Excel Services provides Server side Excel functionality Automated workbook design A connection oriented workbook client None of the above To create and share documents with Excel Services you need. Excel 2007 and access to SharePoint Server 2007 Excel 2007 and access to any document server Any version of Excel and access to any document server None of the above.

Excel 2007 Advanced

167

SECTION 4: Advanced Excel Tasks


In this section you will learn how to: Create a shared workbook Open and edit a shared workbook Track changes in a shared workbook Resolve conflicts in a shared workbook Create a custom AutoFiIl list Use a custom AutoFill list Modify a custom AutoFill list Use the VLOOKUP function Use VLOOKUP for an exact match Use VLOOKUP for a closest match Consolidate workbooks Link workbooks Combine worksheets

Excel 2007 Advanced

168

Lesson 4.1: Creating and Using Shared Workbooks


Excels shared workbook feature allows multiple users to edit a single workbook at the same time. Moreover, the users that are modifying the shared workbook can be at separate remote locations. This is a great way to for coworkers to overcome location or scheduling barriers that prevent them from meeting. All of the users can collaborate on the worksheet from their own desks, at the same time or at different times, and the changes made can be reviewed and merged when required.

In this lesson, you will learn how to share an Excel workbook, how to track changes to the workbook, how to resolve conflicts in a shared workbook, and how to revise a shared workbook.

Excel 2007 Advanced

169

Sharing a Workbook
Once you have created your workbook, the best way to share it is to save the workbook to a shared network folder. To do this, use the Save As dialogue to browse to the shared folder for your network and click the Save button in the dialogue to save the workbook.

For this example, the workbook will be saved as SharedWorkbook2. After you save the workbook to your network folder, click the Share Workbook button on the Review Ribbon.

Excel 2007 Advanced

170

This will display the following Share Workbook dialogue.

Putting a checkmark in the checkbox on the Editing tab (as we have done in the sample above) will allow more than one user to make changes to the workbook simultaneously. Clicking the Advanced tab in the Share Workbook dialogue box will show you more options for configuring your shared workbook. Under this tab, you can specify how many days to keep track of changes to the workbook, when to update changes, and how to resolve conflicts.

Excel 2007 Advanced

171

Under the Track Changes heading, you will see a radio button labeled Keep change history for. Selecting this button will allow you to review the changes made to the shared workbook by the users involved. You should keep in mind that if you specify a long period of time to keep the change history, the file size can grow quite large if there are frequent changes. Under the Update Changes heading you can choose to have changes to the file updated when the file is saved, or automatically, based on a time period that you specify. If changes are updated automatically, your shared workbook will be updated for you even while you have it open. If you select the When file is saved option, saving the shared workbook will update all of the changes made since the last time you saved it. When a workbook is shared, it is possible for more than one user to modify the workbook at the same time. If two people try to save a shared workbook after making changes to the same cells, a conflict can occur. You can use the Conflicting changes between users radio buttons to specify how such conflicts will be resolved. There are some Excel features and objects that cannot be modified once a workbook is shared. It is usually a good idea to set up these features as needed before you share the workbook.

Excel 2007 Advanced

172

The following features and objects can be viewed but not modified in a shared workbook. Drawing objects Data tables Cell Validation Charts Conditional formatting PivotTable reports Protection Macros Hyperlinks Merged cells Groupings and outlines Array formulas Pictures As well, you cannot view or create scenarios, create lists, work with XML data, or delete worksheets in a shared workbook. After you have set up your worksheet for sharing and you click the OK button in the Share Workbook dialogue box, you can save the shared workbook to a shared network folder if you have not already done so. If you have saved the workbook to a shared network folder before making it a shared workbook (as is the case in this example), you will see the following alert when you click OK in the Share Workbook dialogue.

If you click OK, the workbook will be saved as a shared workbook.

Opening and Editing a Shared Workbook


To edit a shared workbook, users should navigate to the network folder where the shared workbook is stored and open it just as you would a regular Excel workbook. Once the workbook opens, users should click the Excel Options button under the Office menu to display the Excel Options window.

Excel 2007 Advanced

173

In the Excel Options window, choose the Popular heading from the panel on the left, and then enter your user name in the User name box near the bottom of the window. (See Lesson 1.1 for more information.)

Once you are ready, you can click the OK button to close the Excel Options window. Users should enter a user name when they open a shared workbook, so the changes they make will be identified and associated with a particular user. The shared workbook can now be edited by users just like a standard workbook (keeping in mind the exceptions listed previously). When you are finished with the workbook, the work you did can be saved by clicking the Save button on the Quick Access toolbar.

Tracking Changes
Tracked changes will allow you to see any changes that have been made to the shared workbook by the users you are sharing it with. Even more importantly, tracking changes will allow you to accept or reject any of the changes that have been made to the workbook over a period that you can specify. When you first set up a workbook for sharing, you will see an option for keeping the change history for the workbook under the Advanced tab in the Share Workbook dialogue box.

This option is selected by default. If you select Dont keep changes, you will not be able to track the changes to the shared workbook. To see the history of changes that have been made to the workbook, click the Track Changes button on the Review Ribbon, followed by the Highlight Changes option from the resulting menu.

Excel 2007 Advanced

174

This will display the Highlight Changes dialogue box.

In this box you can choose:


When, referring to what date you want as the reference point for tracking the changes. Who, referring to the user or users whose changes you want to track. Where, referring to the specific cell or range that you want to track changes in.

At the bottom of the box, you can choose to highlight changes on screen or list changes on a new sheet, or both. Checking the Highlight Changes on Screen option will enhance any cells that have been changed with a grey border and a grey triangle in the upper left.

Excel 2007 Advanced

175

In addition, comments are available for the enhanced cells detailing the person who modified the cell, when it was modified, and the previous and current values. To see a comment, just let your mouse pointer hover over an enhanced cell. The List Changes on a New Sheet option will generate a new worksheet labeled History detailing the changes that have been made to the document.

In the History worksheet, you can sort the changes or apply filters to them by selecting options from the AutoFilter drop lists associated with each column heading. The last two columns, Action Type and Losing Action, apply to resolved conflicts for workbooks that are shared from a shared network folder. (We will discuss conflicts in a moment.) You can always use the history worksheet or the highlighted changes on screen as a reference if you want to re-enter some of the older values and undo changes. If you click the Accept/Reject Changes option from the Track Changes button menu, you will see the following dialogue box.

Once again you can specify one or more of three checkboxes as the basis for your change tracking. In this example, the Not Yet Reviewed option has been selected. This means that all changes that have not yet been accepted or rejected will be subject for review.

Excel 2007 Advanced

176

This image shows the Accept or Reject Changes box. You can see the highlighted cell where the change has been made, and you can see the details of the change in the box. Now you can step through each change to the workbook and choose to accept or reject it. If you choose to accept a change, you can specify what value to accept by selecting it from the list provided. Clicking the Accept or the Reject button will implement your choice and load the information detailing the next change into view.

Excel 2007 Advanced

177

Instructor Note: If you click the Protect Shared Workbook button on the Review Ribbon, you can ensure that the change history is protected (will not be removed).

Clicking this button will display the following dialogue.

Putting a checkmark in the Sharing with track changes box will protect the change history.

Resolving Conflicts in a Shared Workbook


As mentioned previously, it is possible for two or more users to save a shared workbook after making changes to the same cells. The problem with this is that Excel can only keep one set of values in the cells of a given worksheet at a given time. On the Advanced tab of the Shared Workbook dialogue, you can specify a method of conflict resolution for situations like the one just described. Under the Conflicting changes between users heading, Excel provides two options for resolving a cell value conflict.

Excel 2007 Advanced

178

If you select the Ask me which changes win option, you will see a Resolve Conflicts dialogue box when you try to save a shared file that has a conflict. In the Resolve Conflicts dialogue box, you can choose what version of the conflicting cells to keep. When a conflict of this kind occurs, the last user to save the shared workbook will see the Resolve Conflicts dialogue box and have the choice of what to keep. If you select the Changes being saved win radio button, the changes made by the user that saves last will be implemented. In the following example, the Ask me which changes win option is used for the shared workbook. Imagine first that a user named Lisa makes changes to a particular cell in the shared workbook. She then clicks the Save button to save her version of the shared workbook. Next, without knowledge of Lisas actions, you make changes to the same cell or cells in the shared workbook, and then try to save your version. When you try to save the changes you made, the following dialogue will appear.

Here you can see the conflict in terms of the change that you made and the change that Lisa made. You can click the Accept Mine button, to implement the change that you made, or you can click the Accept Other button, to implement the change made by the other user. If you wish, you can resolve all conflicting changes by clicking the Accept All Mine or the Accept all Others button. Accept All Mine will resolve the conflicts by implementing your cell values. Accept All Others will resolve the conflicts by implementing the data entries made by other users. Remember, the last person to save the shared workbook gets to resolve any conflicts that occur with regard to the changes that they have made. If you click the Share Workbook button on the Review Ribbon when you are editing a shared workbook, you will see all of the other users that are currently working on the same shared workbook.

Excel 2007 Advanced

179

Here you can see that a user named Lisa and a user named Mark (one of the usernames in the list will be yours) are currently working on the shared workbook. If you click the Remove User button, you will see the following alert.

When you click OK, the user that you selected will removed (disconnected) from the shared workbook. Any unsaved work that they have done will be lost.

Excel 2007 Advanced

180

Lesson 4.2: Using Custom AutoFill Lists


As you probably already know, Excels AutoFill feature can come in handy when you need to fill rows or columns of cells with incrementally changing values. All that you have to do is enter a value in one cell, and then enter another value in an adjacent cell that is greater or smaller than the first value by some increment. Once you do this, you can fill the rest of the row or column by selecting the two starting cells and dragging your mouse pointer. Excel 2007 lets you go one step further than this by allowing you to create your own custom AutoFill lists. In this lesson you will learn what a custom AutoFill list is and how to create and modify one. You will also learn how to use a custom AutoFill list.

What is an AutoFill List?


An AutoFill list is a series or sequence of numbers or text strings that can be filled into cells automatically when you drag your mouse pointer down a column or across a row. By default, Excel has the capacity to AutoFill numbers and dates that increase or decrease by a fixed increment. Excels default AutoFill feature can also handle text/number combinations that change by a fixed amount (like Region1, Region2, Region3, and so on).

Clearly Excels AutoFill feature is convenient for many situations, but what if you want to have cells automatically filled with specific values that do not change by a fixed increment? What if,

Excel 2007 Advanced

181

for example, you want to have a series of different product names, or a sequence of addresses or alphanumeric ID numbers entered into your cells with AutoFiIl? For these types of situations, Excel 2007 provides a mechanism that allows you to create a custom AutoFill list. This list does not need to increase or decrease by a fixed increment for AutoFill to work. With a custom AutoFill list, Excel will automatically fill in the particular data items that you specify in your list, which can contain words, text strings, or word/number combinations. A custom AutoFill list will work very much like Excels default AutoFill function. You can automatically fill your specific (custom) data down a column of cells or across a row, by simply dragging with your mouse.

Creating a Custom AutoFill List


To create a custom AutoFill list, you must first display the Excel Options window by clicking the Excel Options button at the bottom of the Office menu. After the Options window opens, select Popular from the panel on the left. You will see an Edit Custom Lists button under the Top Options for Working with Excel heading.

Excel 2007 Advanced

182

If you click the Edit Custom Lists button, the following dialogue box will appear.

In the Custom Lists dialogue, you will see a large Custom Lists field on the left and a List entries field on the right. In the List Entries field, you can enter a series of words, abbreviations, or text strings, separated by commas. If you prefer, you can also press the Enter key after each word you type in the list entries field so that each word is on its own line. When you click the Add button, the custom list will be added to the Custom lists box on the left. There, you will see the text or numbers that you typed, shown in a comma separated list.

You can also select a range of cells from your spreadsheet and import them into a custom list. When you do this, your custom list will be made up of the data items that were contained in the selected cells. This is a great way to create a custom AutoFill list from existing headings or

Excel 2007 Advanced

183

labels in your worksheet. You must remember though, that the selected cells must contain text (not numbers), or the data will not be imported to your custom list. To create a list using this method, just select the list items that you want from your worksheet, invoke the Custom Lists box, and click the Import button. The selected data will be imported into the Custom Lists field on the left of the dialogue. You can also invoke the dialogue first, place your cursor in the Import field, and then select a range of data from the worksheet with your mouse. When the correct cell range is entered into the Import field, click the Import button to create a list.

Once you have finished creating your custom lists, click the OK button at the bottom to close the dialogue box.

Modifying a Custom AutoFill List


You can make changes to a custom AutoFill list by invoking the Custom Lists dialogue as before.

Excel 2007 Advanced

184

If you select a list from the Custom Lists field on the left, you will see the individual list entries in the List Entries field on the right. In the List Entries field, you can add new entries, remove individual items with the backspace key, or change existing entries. When you are finished modifying your custom list, click the Add button to implement the changes you made. You should see the new, modified list replace the original one in the Custom Lists field on the left. If you select a custom list from the field on the left (so that the list is highlighted in blue), you can click the Delete button to remove the selected list. Once a list is removed in this way, you cannot use it to AutoFill cells any more. If you want to use an AutoFill list that was deleted, you must first recreate it.

Using a Custom AutoFill List


You use a custom AutoFill list in the same way that you would use the default AutoFill feature. First, select a cell and enter the first term in you custom list. Next, select an adjacent cell immediately below (or to the right if you want to AutoFill across a row) and type the second item in your list. If the item that you enter in the first cell is unique (meaning no other AutoFill lists start with that particular item), you do not have to enter a second item from the list in an adjacent cell. When you have entered enough data to allow Excel to identify your list, select the cells containing the entries you have made and then place your mouse pointer on the small square in the bottom right of the selection.

When you place the pointer on the small square, your pointer should turn into a cross (+). At this point, if you hold you mouse button down and drag, the cells that you drag over will be filled with your consecutive list items. When you reach the end of your list entries, the list will be repeated from the beginning until you stop dragging.

Excel 2007 Advanced

185

Here is the custom list used in this example, as shown in the Custom Lists dialogue.

Remember, you can AutoFill across rows as well as down columns.

Excel 2007 Advanced

186

Lesson 4.3: Using the VLOOKUP Function


Excel 2003 provides two lookup functions that you can use to quickly retrieve information from a table. The functions are called HLOOKUP (horizontal lookup) and VLOOKUP (vertical lookup). They are similar to database functions in the sense that they retrieve values based on reference data. They are, however, different from database functions in the way they operate. The VLOOKUP function will look in the leftmost column of a table for a value you specify. When it finds the value you specified, it will return a value that is located in the same row, a specified number of columns into the table. It is called VLOOKUP because it looks vertically down a column for a match, and then retrieves data from across the row. HLOOKUP is similar, but it will look horizontally across the upper row of your table, and then retrieve data from down a column. In this lesson, you will learn how to use the VLOOKUP function to find data, how to limit the VLOOKUP value to an exact match, and how to use the VLOOKUP function to find the closest match.

Using VLOOKUP to Find Data


The best way to learn how lookup functions work is to look at an example. Here we have a table of ticket prices for flights to different countries. To simplify matters, the data range for the table has been given a defined name (Price) that can be used in functions and formulas. If we activate a cell F1 and enter =VLOOKUP("England",Price,2) into the formula bar, cell F1 will show the value 550.

The lookup function looked vertically down the leftmost column of the lookup table (Price) until it found a match for the text string England. The function then returned the value that is in

Excel 2007 Advanced

187

the second (2) column of the table, from the row where the match was found. You should notice that England, Price, and 2 are the exact arguments used in the function. The arguments for the lookup function are: VLOOKUP(value to match, lookup table name or range, number of the column in the table containing the relevant data, true or false). For the example shown above, the true or false argument was left out. The relevance of the true or false argument in the VLOOKUP function will be discussed shortly. HLOOKUP is the same as VLOOKUP, except that it looks across rows for a match rather than down columns. To use HLOOKUP, the lookup table would be arranged in this way.

Since Excel is designed with more cells in the vertical direction than in the horizontal direction, and because vertical table design is more intuitive for most people, VLOOKUP is generally used more often than HLOOKUP. To use the VLOOKUP function correctly, you need to have your spreadsheet data laid out properly in a table with at least two columns. The first column in the table will contain the keys (identifiers that the VLOOKUP function will look through for a match). In the example just shown, the keys (or identifiers) are the names of the countries. This first column can be referred to as the look up column. The other columns in your table will contain data that is associated with the column of identifiers. Your table can be several columns wide, and you can specify which column VLOOKUP will return data from by putting a number corresponding to the given column in the function. In the previous example, we wanted VLOOKUP to return the ticket price, so we used the number 2 (for the second column) as an argument in the function. If your table has 10 columns and you want to return data from the ninth column, you would use 9 as an argument. You do not have to use text values (like the country names used here) in your lookup column. If it is more appropriate, you can use numbers or dates. If you want some help when you are using VLOOKUP, use the Insert Function dialogue by clicking the fx button next to the formula bar.

Excel 2007 Advanced

188

You will find the VLOOKUP function in the Lookup & Reference category. If you click the OK button in the Insert Function dialogue, you will see the helpful Function Arguments box.

Here, you can enter the function arguments in the fields provided by following the instructions and descriptions that correspond to the given fields.

Excel 2007 Advanced

189

How to Find an Exact Match with VLOOKUP


As mentioned briefly before, the VLOOKUP function can take a final argument of either true or false. If you specify this final argument as false, VLOOKUP will search for an exact match in the lookup column (column of identifiers). If it cannot find an exact match, no data will be returned. In the following example, the function =VLOOKUP("jpn",Price,2,FALSE) has been entered in cell D1. This means that VLOOKUP will search the first column of the table for an exact match of jpn, and if it is found, it will return the corresponding value in column 2.

Because there is no country that exactly matches jpn no value will be returned to cell D1. If you change the function so that the first argument is Japan, an exact match will be found and the value 925 will be returned to cell D1. If there are two or more exact matches, the first matching value found in the column of identifiers will be returned.

Instructor Note: The VLOOKUP functions exact match is not exact. It is not case sensitive, so jaPan is considered an exact match of Japan. You can also use wild card characters so that Ja?an and J* will match Japan as well.

Excel 2007 Advanced

190

Finding the Closest Match with VLOOKUP


If the final argument in your VLOOKUP function is true, VLOOKUP will search the column of identifiers for the closest match to the search value you enter as the first function argument. For example, in you enter a search value, and you enter true as your final argument, a value associated with the first exact match of your search value will be returned (f one is found). However, if no exact match is found, a value corresponding to what Excel deems is the closest match will be returned. Following our example, if you enter jpn as the search value for the table of ticket prices, the value associated with the country Japan (925) will be returned, as Japan is the closest match to jpn that is found in the look up column.

If you omit the final argument in your VLOOKUP function, it will default to true, and search for a closest value if it cannot find an exact match. If you are using the True argument, the values in the look up column should be sorted in ascending order. Otherwise, you may get unexpected results. If you are using text values in your lookup column, avoid using leading or trailing spaces, as this also may produce unexpected results. However, if you use False as the final argument to your function (for an exact match), the lookup column does not have to be sorted.

Excel 2007 Advanced

191

Lesson 4.4: Linking, Consolidating, and Combining Workbooks


To properly manage your workbooks, you should be able to combine or consolidate data from more than one workbook or worksheet. By doing this, you can provide a clear and unified picture of data that may be spread over multiple sources. In this lesson, you will learn about linking and consolidating workbooks and worksheets.

Linking Workbooks
As you know, a cell reference like K7 simply refers to the cell at the intersection of column K and row 7. A cell reference like Store!K7 refers to the cell at column K and row 7 in the worksheet named Store. Taking this one step further, the reference [Sales.xlsx]Store!K7 refers to cell K7 in worksheet Store in the workbook Sales. In Excel, a cell in one worksheet can contain a reference to a cell in another worksheet or in another workbook. This kind of linking can be useful if you have several sheets that have to reference the same pool of data. If you create links, the linked cells in the other worksheets or workbooks will be updated automatically when you update the source data.

Excel 2007 Advanced

192

In this example, the linked cells (indicated by arrows) are in two different workbooks. To link two workbooks, open both of them and select the cell or range of source data that you want to use from one workbook.

Right click on the cell or range and select Copy from the menu. The copied range will be enhanced with a flashing black and white border. Once you have done this, right click on the cell in the destination workbook that will contain the linked data. (If you are linking a range of data, right click on the top left cell of the destination range.) Select Paste Special from the pop up menu and click on the Paste Link button in the lower left.

Excel 2007 Advanced

193

The linked data will now appear in the destination workbook. If you update the source data, the linked data will be updated as well.

Excel 2007 Advanced

194

In this image, the cells highlighted in pink have been linked. Cell E14 in the lower workbook has been linked to cell B5 in the upper workbook, and the range B2:D6 in the lower workbook has been linked to the range D1:F5 in the upper workbook. There is also another way to create links between workbooks. First, click on the destination cell and type =. Next, click the source data cell in another workbook and press the Enter key. The two workbooks should now be linked, and any data or changes that appear in the source cell will be seen in the linked cell as well.

Consolidating Workbooks
When you consolidate workbooks, you are combining, condensing, and summarizing data from multiple sources into one destination. For example, a large company may have sales or profit data broken down into several different geographical locations. Each workbook would have the same layout and structure (template) but contain different data. With Excel, you can consolidate the different workbooks, summarizing and totaling the data into one place to get a unified view of your information. To consolidate workbooks in Excel, open the relevant workbooks and choose a destination workbook where the data will be consolidated. It is a good idea to set up the destination worksheet to be just like the worksheets that will supply the data. This means having the same labels and using the same layout and cell locations for the same types of data. This is not mandatory, but it can make the consolidation process a lot easier. If you do not have a problem with adding labels later, you can select a blank worksheet for your consolidation area.

Excel 2007 Advanced

195

This Excel screen shows three open workbooks, Book1, Book2, and Book3. To consolidate Book1 and Book2 into Book3, you must select the cell at the upper left of the range that will contain the consolidated data. (Notice that all three workbooks have a parallel structure in terms of columns, rows, and labels. This will make the consolidation process more straightforward.) To consolidate the workbooks, you would select cell B2 in Book3 (the book with the empty cells) and click the Consolidate button on the Data Ribbon.

This will display the following Consolidate Dialogue box.

Under the word Function, there is a drop list containing many functions you can use to combine the data. In this example the default Sum is used. The text field under the word Reference is where you enter the ranges of data to be consolidated. You can enter the ranges manually (only recommended if you have a thorough understanding of cell references) or by selecting them from the different workbooks with your mouse or keyboard. (You must click in the Reference text field before selecting or entering ranges.) When a range is entered, click the Add button to add it to the All References field. This field will contain all the workbook cell references that are to be consolidated. For this example, you could click the reference field and select B2:E13 (B2 through to E13) from Book1. This range will be displayed in the Reference field in the Consolidate box. Clicking Add will add it to the All References field.

Excel 2007 Advanced

196

If you select the same range from Book2 and click Add, the Consolidate box should look like this.

You will notice the phrase Use labels in with two check boxes below it. You can check these boxes to consolidate sheets based on row labels or column labels. That is, the data in columns or rows that have the same labels will be consolidated even if the labels are under different column letters or row numbers in the source workbooks. For this example, the boxes are cleared and the consolidation will be based on the actual cell locations. This is why consolidation is easier when all the worksheets involved have the same labels and layout. If you fill in the Create links to source data check box, the information in the destination work book will be updated if the cell content in the contributing workbooks is changed. Once all options are set, make sure the workbooks and cell ranges to be consolidated are correct, and click OK.

Excel 2007 Advanced

197

The workbooks will be consolidated and combined into the destination workbook (Book3 in this example).

Combining Worksheets
The methods for combining worksheets belonging to the same workbook are very similar to the methods for combining different workbooks. You can link data between worksheets or you can consolidate worksheets. To link cells in worksheets belonging to the same workbook, select the source cells, then right click and choose Copy from the menu that appears. The selected cells will be enhanced with a flashing dark and light border. Next, right click on a cell in the destination sheet (preferably at the upper left of the destination range) and select Paste Special from the menu that appears. When you see the Paste Special dialogue box, click the Paste Link button.

Excel 2007 Advanced

198

The Paste Link button can link a selected source range of cells with a destination range of cells in another worksheet. You can even repeat this process to link several worksheets to one destination worksheet. This is one way of combining worksheet data. You can also consolidate worksheets in a workbook as well. Consolidating worksheets in the same workbook is a lot like consolidating different workbooks. First, set up your worksheets with a similar layout, select a cell at the upper left of the destination range, and click the Consolidate button on the Data Ribbon.

In the Consolidate dialogue, click in the Reference text field, and then select a range of cells to consolidate from another worksheet in the workbook. The range will be entered into the Reference field when you make your selection. Click Add to add it to the All References field.

Excel 2007 Advanced

199

Next, select the same ranges (same cell references) from other worksheets in the workbook as you require, adding them to the All References field as you go. Then, fill in the Create links to source data check box and click the OK button. Your worksheets should now be consolidated.

Excel 2007 Advanced

200

Section 4: Review Questions


1. A. B. C. D. 2. A. B. C. D. 3. A. B. C. D. 4. A. B. C. D. 5. A. B. C. D. 6. A. B. C. D.

The best place to save a shared workbook is In a shared network folder In a personal folder on your local computer On a floppy disk All of the above When you open a shared workbook to work on it, you should Make sure your user name is entered in Excel options so your work can be identified Clear your username for anonymity Remove all other users that are currently sharing the workbook Any of the above You should use a custom AutoFiIl list to Automatically fill cells with the same value Automatically fill cells with a list of values Automatically fill cells with values that change by fixed increments None of the above You can create a custom AutoFill list by using The Data Ribbon The Insert Ribbon Excel Options None of the above The VLOOKUP function is found in what function category? Mathematical Statistical Logical Lookup and Reference To use the VLOOKUP function, you need a Properly arranged table of data Hyperlink Web query Any of the above

Excel 2007 Advanced

201

7. A. B. C. D. 8. A. B. C. D. 9. A. B. C. D. 10. A. B. C. D.

The V in VLOOKUP stands for Verifiable Volume Vertical Value You can link Workbooks and Worksheets using Paste Link in the Paste special dialogue The Link Workbooks and Worksheets button You cannot link workbooks or worksheets B or C You can consolidate Workbooks and Worksheets by Sum Average Count Any of the above The Consolidate button is found on the . Data Ribbon Home Ribbon Review Ribbon Formulas Ribbon

Excel 2007 Advanced

202

Index
AutoFill ................................................................................................ 167, 180, 181, 184, 185, 200 Creating custom from existing data........................................................................................ 182 Using custom........................................................................................................................... 184 AutoFill List About custom.......................................................................................................................... 181 Creating custom .............................................................................................................. 181, 182 Custom Lists dialogue ............................................................................................................. 182 Deleting custom ...................................................................................................................... 184 List Entries field ....................................................................................................................... 184 Modifying custom ................................................................................................................... 183 What is? .................................................................................................................................. 180 Automatic Start ............................................................................................................................. 25 Data Ribbon .. 41, 42, 46, 49, 77, 86, 87, 89, 91, 107, 108, 109, 112, 142, 145, 149, 152, 195, 198, 200, 201 Developer Ribbon ......................................................................................................................... 14 Excel Options Calculation .................................................................................................................................. 8 Changing your user name ................................................................................................... 3, 173 Color Scheme ............................................................................................................................ 15 Custom lists ............................................................................................................................. 181 Enable Live Preview .................................................................................................................. 13 Error checking ........................................................................................................................... 12 Formulas ..................................................................................................................................... 8 Installing add-ins ..................................................................................................................... 109 Iteration ...................................................................................................................................... 9 Opening the dialog ...................................................................................................................... 3 Resources panel ............................................................... See Office Diagnostics; Updating Excel Setting default file format........................................................................................................... 6 Setting default font ..................................................................................................................... 5 Setting default save location ...................................................................................................... 7 Show Developer Ribbon............................................................................................................ 14 Excel Viewer AutoCalculate in ........................................................................................................................ 35 Downloading and installing....................................................................................................... 28 Editing ....................................................................................................................................... 33 Launching .................................................................................................................................. 31 Opening files with ..................................................................................................................... 32 Printing from ............................................................................................................................. 36 Viewing...................................................................................................................................... 34 What is? .................................................................................................................................... 27

Excel 2007 Advanced

203

Formulas Ribbon ..................................................................................................................... 9, 201 Goal Seek......................................................................................... 40, 98, 106, 107, 108, 116, 118 Home Ribbon .......................................................................................................... 75, 76, 125, 201 Hyperlink ............................................................. 119, 120, 121, 122, 124, 127, 129, 130, 145, 165 Anatomy .................................................................................................................................. 120 Bookmarks and ....................................................................................................................... 123 Context menu ......................................................................................................................... 123 Creating ................................................................................................................................... 123 Editing ............................................................................................................................. 123, 124 Following ......................................................................................................................... 127, 130 Formatting .............................................................................................................. 124, 125, 126 Function .................................................................................................................................. 129 Inserting .......................................................................................................................... 122, 129 Removing ........................................................................................................................ 124, 129 ScreenTips ............................................................................................................................... 123 Using image for ....................................................................................................................... 130 What is? .................................................................................................................................. 120 Input Tables Creating single......................................................................................................................... 100 Creating two input .................................................................................................................. 103 Data Table dialogue ........................................................................................................ 101, 105 Formatting .............................................................................................................................. 103 Rules .......................................................................................................................................... 99 Single ......................................................................................................................................... 99 Two Input .................................................................................................................................. 99 Insert Ribbon ....................................................................................... 53, 58, 78, 79, 122, 130, 200 Iterative Calculation ........................................................................................................................ 9 Lookup Functions Closest match .......................................................................................................................... 190 Exact match ............................................................................................................................. 189 HLOOKUP ........................................................................................................................ 186, 187 Inserting .................................................................................................................................. 188 True/False arguments ............................................................................................................. 190 VLOOKUP......................................................................... 167, 186, 187, 188, 189, 190, 200, 201 Office Diagnostics ............................................................................................16, 20, 21, 22, 23, 38 Outlining Automatic.................................................................................................................................. 41 Collapsing levels ........................................................................................................................ 44 Expanding levels........................................................................................................................ 43 Grouping data manually ........................................................................................................... 45 Removing subtotals .................................................................................................................. 51 Ungrouping data ....................................................................................................................... 48 Using subtotals.......................................................................................................................... 49 Paste Special ....................................................................................................................... 192, 197

Excel 2007 Advanced

204

PDF .............................................................................................................................................. 153 PivotChart ..................................................................................................................................... 82 Creating ......................................................................................................................... 79, 80, 86 Design Ribbon ........................................................................................................................... 78 Frames....................................................................................................................................... 81 Inserting .................................................................................................................................... 78 Populating with data ................................................................................................................. 81 Refreshing data ......................................................................................................................... 78 Styles ......................................................................................................................................... 78 PivotTable .............. 40, 52, 53, 61, 67, 68, 69, 70, 72, 75, 76, 78, 79, 81, 82, 83, 95, 117, 118, 172 And the Import Data panel ....................................................................................................... 86 Basics of .................................................................................................................................... 52 Calculations ................................................................................................................... 70, 71, 72 Classic Layout ........................................................................................... See PivotTable, Frames Creating ........................................................................................................53, 67, 79, 80, 86, 89 Data area ....................................................................................................................... 61, 64, 65 Data boxes ................................................................................................................................ 69 Data boxes vs. data areas ......................................................................................................... 68 Data Field Settings .................................................................................................................... 71 Design Ribbon ..................................................................................................................... 67, 74 Expanding and collapsing data ................................................................................................. 57 Field list ..................................................................................................55, 56, 63, 65, 66, 68, 81 Frames............................................................................................................... 58, 60, 67, 81, 89 Manually formatting ................................................................................................................. 75 Number formats.................................................................................................................. 72, 76 Options Ribbon ............................................................................................................. 67, 73, 77 Page area................................................................................................................................... 66 Placing ....................................................................................................................................... 54 Populating data ......................................................................................................................... 62 Rearranging data ..................................................................................................... 63, 64, 65, 69 Refreshing data ................................................................................................................... 77, 89 Removing data .......................................................................................................................... 63 Row and column areas........................................................................................................ 61, 65 Source data ............................................................................................................. 53, 54, 60, 77 Styles ......................................................................................................................................... 74 Table Options .................................................................................................... 58, 59, 66, 73, 74 Using external data sources .......................................................................................... 54, 83, 87 What is? .................................................................................................................................... 52 Publishing to a Document Server As Excel Workbook.................................................................................................................. 156 As PDF or XPS .......................................................................................................................... 155 Excel Services .................................................. 153, 158, 159, 160, 161, 162, 163, 164, 165, 166 Review Ribbon ...................................................................................... 38, 118, 169, 173, 178, 201 Saving Chart as Web Page........................................................................................................... 137

Excel 2007 Advanced

205

Saving Range as Web Page ......................................................................................................... 139 Saving Workbook as Web Page .......................................................................................... 132, 134 HTM vs. HTML ......................................................................................................................... 132 MHTML.................................................................................................................................... 133 Saving Worksheet as Web Page.................................................................................................. 136 Scenarios Adding ....................................................................................................................................... 92 Creating ..................................................................................................................................... 91 Deleting ..................................................................................................................................... 96 Editing ....................................................................................................................................... 96 Saving multiple .......................................................................................................................... 96 Scenario Manager ........................................................................................90, 91, 93, 94, 96, 97 Showing ..................................................................................................................................... 93 Solver results and .................................................................................................................... 115 Summary reports ...................................................................................................................... 94 What are?.................................................................................................................................. 90 Searching for Documents.............................................................................................................. 16 Solver Adding constraints .................................................................................................................. 112 As Goal Seek ............................................................................................................................ 116 Examples ................................................................................................................................. 114 Implementing solution ............................................................................................................ 114 Installing .................................................................................................................................. 108 Launching ........................................................................................................................ 108, 112 Reports .................................................................................................................................... 115 Results ..................................................................................................................................... 114 Setting up worksheet to use ........................................................................................... 109, 111 Solver Parameters dialogue .................................................................................................... 112 What is? .................................................................................................................................. 108 Updating Excel .............................................................................................................................. 23 Web Queries ....................................................................................... 119, 142, 145, 150, 165, 200 Creating from preset list ......................................................................................................... 143 Creating from scratch ............................................................................................................. 145 Data Range Properties dialogue ............................................................................................. 151 Default folder .......................................................................................................................... 149 Editing ..................................................................................................................................... 148 Import choices ........................................................................................................................ 146 Import Data dialogue .............................................................................................................. 144 New Web Query dialogue ....................................................................................................... 145 Opening saved ................................................................................................................ 149, 150 Refreshing ............................................................................................................................... 150 Sample............................................................................................................................. 144, 147 Saving ...................................................................................................................................... 148 Selecting data to import ......................................................................................................... 146

Excel 2007 Advanced

206

Workbooks Combining ............................................................................................................................... 197 Conflict resolution options ..................................................................................................... 177 Consolidating .......................................................................................................................... 194 Editing shared ......................................................................................................................... 172 Highlight Changes ................................................................................................................... 174 Linking ..................................................................................................................................... 191 Opening shared ....................................................................................................................... 172 Resolving conflicts with shared ...................................................................................... 177, 178 Saving to network folder......................................................................................................... 169 Share Workbook dialogue....................................................................................................... 170 Sharing limits........................................................................................................................... 172 Sharing options ....................................................................................................................... 170 Track Changes ......................................................................................................... 171, 173, 175 Users sharing........................................................................................................................... 178 XPS............................................................................................................................................... 153

You might also like