You are on page 1of 422

Office 2010 Training

Excel 2010 Courseware


Student Manual Advanced

Microsoft Office Excel 2010 Advanced Courseware


Written by Kelvin MacDonald Published by Velsoft Training Materials Inc. Courseware Release Version 3.0

2011 by Velsoft Training Materials, Inc. Notice of Rights


No part of this publication may be reproduced, transmitted, transcribed, stored in a retrieval system, or translated into any language or computer language, in any form or by any means, electronic, mechanical, magnetic, optical, chemical, manual, or otherwise, without the prior written permission of Velsoft Training Materials, Inc. except under the terms of a courseware site license agreement.

Trademark Notice
PowerPoint, Windows, Word, Microsoft are trademarks of Microsoft, Inc. Throughout this courseware title, trademark names are used. Rather than just put a trademark symbol in each occurrence of a trademarked name, we state we are using the names only in an editorial fashion and to the benefit of the trademark owner with no intention of infringement of the trademark.

Notice of Liability
The information in this courseware title is distributed on an as is basis, without warranty. While every precaution has been taken in the preparation of this course, neither the authors nor Velsoft Training Materials, Inc. shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the instructions contained in this book or by the computer software and hardware products described in it.

Disclaimer
We make a sincere effort to ensure the accuracy of the material described herein; however, Velsoft Training Materials makes no warranty, expressed or implied, with respect to the quality, correctness, reliability, accuracy, or freedom from error of this document or the products it describes. Data used in examples and sample data files are intended to be fictional. Any resemblance to real persons or companies is entirely coincidental. All information in this manual was correct at the time of writing. Velsoft is not affiliated with nor has any control over changes made to the product described in this manual. These include, but are not limited to, changes in the applications color scheme, icon appearance and locations, addition or removal of program features, online templates, and help content. Velsoft reserves the right to make corrections to the courseware at any time and without notification.

Terms and conditions


Sample versions: If the version of courseware that you are viewing is marked as NOT FOR TRAINING, SAMPLE, or similar, then it is made available for content and style review only and cannot be used in any part of a training course. Sample versions may be shared but cannot be re-sold to a third party. For licensed users: This document may only be used under the terms of the license agreement from Velsoft Training Materials, Inc. Velsoft reserves the right to alter the licensing conditions at any time, without prior notice.

Velsoft Training Materials, Inc.


185 Provost Street New Glasgow, Nova Scotia B2H 2P8 Canada

2005-2011 Velsoft Training Materials, Inc.

Table of Contents
Introduction.................................................................................................................................... 1 Prerequisites ................................................................................................................................... 2 Section 1: Getting the Most from Your Data ................................................................................ 3
Lesson 1.1: Outlining and Grouping Data ........................................................................................... 4
Using Automatic Outlining ..................................................................................................................................5 Displaying and Collapsing Levels........................................................................................................................7 Grouping Data Manually .....................................................................................................................................9 Creating Subtotals.............................................................................................................................................. 13

Lesson 1.2: Exploring Scenarios.......................................................................................................... 17


What is a Scenario? ........................................................................................................................................... 17 Creating a Scenario ........................................................................................................................................... 18 Saving Multiple Scenarios.................................................................................................................................. 22 Merging Scenarios ............................................................................................................................................. 24 Creating a Scenario Summary Report ............................................................................................................... 28

Lesson 1.3: Using Data Analysis Tools ............................................................................................... 30


Enabling Data Analysis Tools ............................................................................................................................ 30 An Overview of Excels Analysis Tools .............................................................................................................. 35 An Overview of the Available Add-In Tools ....................................................................................................... 45 Using a One or Two Input Data Table ............................................................................................................... 50 Using Goal Seek ................................................................................................................................................. 61

Lesson 1.4: Using Solver ...................................................................................................................... 65


Understanding Solver ........................................................................................................................................ 65 Generating Reports and Scenarios with Solver ................................................................................................. 74 Changing Solver Values ..................................................................................................................................... 74 Managing Solver Constraints ............................................................................................................................ 76 Choosing a Solving Method ............................................................................................................................... 76 Using Solver as a Goal Seek Tool ...................................................................................................................... 77

Lesson 1.5: Excel and Hyperlinks ....................................................................................................... 79


What is a Hyperlink? .......................................................................................................................................... 79 Inserting Hyperlinks ........................................................................................................................................... 80 Editing Hyperlinks ............................................................................................................................................. 87 Formatting Hyperlinks ....................................................................................................................................... 88 Using Hyperlinks in Excel .................................................................................................................................. 94

Section 1: Review Questions .............................................................................................................. 100

Section 2: Pivoting Data ............................................................................................................ 102


Lesson 2.1: Getting Started with PivotTables .................................................................................. 103
What is a PivotTable? ...................................................................................................................................... 103 Creating a PivotTable ...................................................................................................................................... 104 Using the PivotTable Tools Tabs ..................................................................................................................... 108 Adding and Removing Data with the Field List ............................................................................................... 117 Changing the Field List Layout ........................................................................................................................ 121 Pivoting Data ................................................................................................................................................... 123

Lesson 2.2: Working with PivotTable Data ..................................................................................... 134


Expanding and Collapsing Data ...................................................................................................................... 134 Filtering Data .................................................................................................................................................. 136

2005-2011 Velsoft Training Materials, Inc.

Sorting Data ..................................................................................................................................................... 143 Grouping Data ................................................................................................................................................. 148 Refreshing Data ............................................................................................................................................... 150 Editing the Data Source ................................................................................................................................... 154

Lesson 2.3: Formatting a PivotTable ................................................................................................ 157


Modifying Fields and Labels ............................................................................................................................ 158 Modifying Values ............................................................................................................................................. 166 Using the Layout Group on the Design Tab..................................................................................................... 171 Applying a Style to a PivotTable ...................................................................................................................... 176 Changing PivotTable Style Options ................................................................................................................. 179 Manually Formatting a PivotTable .................................................................................................................. 180 Using the PivotTable Options Dialog .............................................................................................................. 182

Lesson 2.4: Using the Classic PivotTable Layout ............................................................................ 185


Creating an Empty (Classic) PivotTable Frame .............................................................................................. 185 Switching an Existing PivotTable to a Classic Layout ..................................................................................... 188 Adding Data ..................................................................................................................................................... 190 Pivoting Data ................................................................................................................................................... 192

Lesson 2.5: Advanced PivotTable Tasks .......................................................................................... 196


Creating a PivotTable Based on External Data ............................................................................................... 196 Refreshing External Data ................................................................................................................................. 205 Creating a Slicer .............................................................................................................................................. 206 Using the Slicer Tools Tab ............................................................................................................................... 213

Lesson 2.6: Using PowerPivot............................................................................................................ 218


System Requirements........................................................................................................................................ 218 Downloading and Installing PowerPivot ......................................................................................................... 218 Importing Access Data ..................................................................................................................................... 221 Importing Excel Data ....................................................................................................................................... 226 Integrating Data with Relationships ................................................................................................................ 230 Creating a PivotTable with PowerPivot Data ................................................................................................. 231

Section 2: Review Questions .............................................................................................................. 236

Section 3: Charting Pivoted Data .............................................................................................. 238


Lesson 3.1: Getting Started with PivotCharts ................................................................................. 239
Creating a PivotChart from Scratch ................................................................................................................ 240 Creating a PivotChart from Existing Data ...................................................................................................... 241 Adding Data to your Chart .............................................................................................................................. 243 Pivoting Data ................................................................................................................................................... 245

Lesson 3.2: Using the PivotChart Tools Tabs .................................................................................. 253


Using the Design Tab ....................................................................................................................................... 253 Using the Layout Tab ....................................................................................................................................... 258 Using the Format Tab ...................................................................................................................................... 263 Using the Analyze Tab ..................................................................................................................................... 268

Lesson 3.3: Formatting a PivotChart................................................................................................ 272


Renaming Fields .............................................................................................................................................. 272 Changing the Chart Type ................................................................................................................................. 275 Applying a Chart Style ..................................................................................................................................... 281 Manually Formatting Chart Elements ............................................................................................................. 283 Changing the Layout of Chart Elements .......................................................................................................... 295

Lesson 3.4: Advanced PivotChart Tasks .......................................................................................... 302


Creating a PivotChart Based on External Data .............................................................................................. 302 Creating a Slicer .............................................................................................................................................. 309 Creating a PivotTable and PivotChart from a Scenario .................................................................................. 312 Creating PivotCharts with PowerPivot Data ................................................................................................... 319

Section 3: Review Questions .............................................................................................................. 327

2005-2011 Velsoft Training Materials, Inc.

Section 4: Advanced Excel Tasks .............................................................................................. 329


Lesson 4.1: Using Advanced Functions ............................................................................................ 330
Using the PMT Function .................................................................................................................................. 330 Using the FV Function ..................................................................................................................................... 333 Understanding Logical Functions .................................................................................................................... 334 Using Logical Functions .................................................................................................................................. 339 Using IFERROR with Array Formulas ............................................................................................................ 341

Lesson 4.2: Using the VLOOKUP Function..................................................................................... 346


Understanding VLOOKUP and HLOOKUP .................................................................................................... 346 Using VLOOKUP to Find Data ....................................................................................................................... 346 How to Find an Exact Match with VLOOKUP ................................................................................................ 349 Finding an Approximate Match with VLOOKUP ............................................................................................ 350 Using VLOOKUP as an Array Formula .......................................................................................................... 352

Lesson 4.3: Using Custom AutoFill Lists .......................................................................................... 355


What is an AutoFill List? ................................................................................................................................. 355 Creating a Custom AutoFill List ...................................................................................................................... 356 Using a Custom AutoFill List ........................................................................................................................... 360 Modifying a Custom AutoFill List .................................................................................................................... 361 Deleting a Custom AutoFill List ...................................................................................................................... 362

Lesson 4.4: Linking, Consolidating, and Combining Data ............................................................ 363


Linking Workbooks .......................................................................................................................................... 363 Consolidating Workbooks ................................................................................................................................ 365 Combining Worksheets..................................................................................................................................... 369 Pivoting Consolidated Data ............................................................................................................................. 372

Section 4: Review Questions .............................................................................................................. 379

Section 5: Macros, Visual Basic, and Excel Programming ..................................................... 381


Lesson 5.1: Creating a Basic Macro .................................................................................................. 382
Recording a Macro .......................................................................................................................................... 382 Editing a Macro ............................................................................................................................................... 383 Running a Macro ............................................................................................................................................. 385 Understanding Macro Security ........................................................................................................................ 386

Lesson 5.2: Visual Basic and Macros ................................................................................................ 390


Opening the Visual Basic Editor ...................................................................................................................... 390 Understanding the Visual Basic Editor ............................................................................................................ 391 Adding Code to your Macro ............................................................................................................................. 393 Adding Comments to Visual Basic Code .......................................................................................................... 393

Lesson 5.3: More Macro Tasks.......................................................................................................... 395


What are Relative References? ........................................................................................................................ 395 Recording a Relative Reference Macro............................................................................................................ 395 Running a Relative Reference Macro ............................................................................................................... 396 Assigning a Keyboard Shortcut to a Macro ..................................................................................................... 397 Copying a Macro from a Workbook or Template ............................................................................................ 399

Lesson 5.4: Advanced Visual Basic Tasks ........................................................................................ 404


Declaring Variables ......................................................................................................................................... 404 Iteration over a Range ..................................................................................................................................... 404 Prompting for User Input ................................................................................................................................. 405 Using If, Then, and Else Statements ................................................................................................................. 407

Section 5: Review Questions .............................................................................................................. 409

Index ........................................................................................................................................... 411

2005-2011 Velsoft Training Materials, Inc.

Introduction
Welcome to Velsofts courseware for Microsoft Office Excel 2010, a popular spreadsheet application designed for organizing and analyzing data, performing calculations, and charting information. This new version of Excel incorporates powerful Slicer filtering tools for PivotTables and PivotCharts, and works seamlessly with the new PowerPivot add-on. This advanced level is intended to help regular users of Excel become even more proficient by expanding their knowledge of Excels data analysis tools, consolidation tools, advanced functions, and PivotTables. This manual will also help experienced users who may be unfamiliar with the ribbon interface introduced in Excel 2007. This manual will cover a variety of organizing tools and What-If analysis tools that will help Excel users get the most out of their data. In addition, two key advanced spreadsheet tools (PivotTables and PivotCharts) will be discussed at length. Following that, advanced concepts dealing with Excel functions, AutoFill lists, and consolidating and combining data will also be covered. The new Slicer features and PowerPivot add-on, two important tools for working with PivotTables and PivotCharts, are covered as well. This manual was created using Microsoft Office 2010 Professional Plus. Our test machine was a 32-bit computer using Windows 7 Ultimate. If you are an instructor, you can use any version of Windows that is accessible to your students. Any feature specific to Windows 7 in this manual will be marked as such. Occasionally, this manual may reference where certain keys are on the keyboard (such as Insert, Home, or Page Up). The directions are given based on a standard desktop keyboard that contains a separate number pad. Laptop keyboards may be different or have combined keys.

Microsoft Office Excel 2010 Advanced

Prerequisites
This manual presumes that the user has a basic knowledge of Windows, including concepts such as using the mouse and keyboard. With respect to Excel, we also presume that the user has completed the Intermediate level of this course (or has equivalent knowledge) and is familiar with concepts such as: Using right-click menus Working with dialog boxes Worksheet organization (rows, columns, labels) Cutting, copying, pasting, selecting, and moving Excel data Basic cell data formatting tasks Working with cell references and cell ranges (named ranges) Manipulating multiple open worksheets and/or workbooks Creating and manipulating standard Excel data tables Using Excel functions Building formulas in Excel Working with external data sources Creating and manipulating standard Excel charts

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

Section 1: Getting the Most from Your Data


In this section you will learn how to: Use automatic outlining Display and collapse levels Manually group data Create subtotals Describe scenarios Create a scenario Save multiple scenarios Merge scenarios together Create a scenario summary report Enable data analysis tools Identify available analysis and add-in tools Use a one or two input data table Use Goal Seek Generate reports and scenarios with Solver Change Solver values and manage constraints Choose a solving method Use Solver as a goal seek tool Insert, edit, format, and use hyperlinks

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

Lesson 1.1: Outlining and Grouping Data


Sometimes, a worksheet can become very large and contain so much data that it becomes difficult to understand. Totals and subtotals that summarize the data can be lost in screen after screen of numbers. Thankfully, Excel 2010 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. The grouping and outlining features can also expand the same worksheet to show data, or allow modification of the details. Outlining lets you manage the level of detail at which your worksheet will be presented.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

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:

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

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

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 are the results of Excels automatic outline:

All of the original data is shown, as well as outline group indicators (the thick black lines that look like large brackets) and collapse buttons (marked with a minus sign). You can see that the quarters (sets of three months) are grouped together and 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 Utilities have been grouped under Total Expenses, and that there is an overarching group of all columns under Profit.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

In the image that follows, 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 your headings and data and the way they are organized.

Well look at how to expand and collapse levels in the next lesson. To remove the outlining from your worksheet, click Data Ungroup Clear Outline:

Displaying and Collapsing Levels


Here is an outlined spreadsheet:

Notice that there are numbered buttons arranged in a row beside the column letters and also in a column above the row numbers. Clicking on one of the 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.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

The view of the data in the preceding image is provided by the buttons numbered 1. Clicking on the number 2 buttons will expand the worksheet to the second level of detail for the rows, columns, or both as required:

This is the same worksheet after both number 2 buttons have been clicked. You can see that the worksheet rows and columns have been expanded to show another, secondary level of detail. You can now see rows with quarterly totals as well as yearly totals. You can also see columns with figures for Income and Total Expenses. If you click on an expand button, marked with a plus 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 picture at the beginning of this lesson.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

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 a large or complicated 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 that you want in your printed copy.

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. Take the following worksheet as an example:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

10

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 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, the Sharks (cells B4:B6), and click Data Group, Excel 2010 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.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

11

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 (increased) level of detail. If you follow the same procedure for cells B8:B10 (select the cells and then click the Group button on the Data tab) and then for cells B2:B10, you will end up with a worksheet like this:

This image shows 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.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

12

Clicking the number 1 button will display the highest level view (lowest detail) of the manual groupings:

In the preceding image you can see that the entire first division grouping has been collapsed from view. To remove manual groupings, select the rows or columns corresponding to the grouping you wish to remove and click the Ungroup button.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

13

When you see the Ungroup dialog box, select the appropriate radio button (rows or columns) for what you are ungrouping, and click OK.

. The selected rows or columns will be ungrouped.

Creating Subtotals
Another kind of outlining technique in Excel 2010 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, use your mouse to select the range of data you want to apply subtotals to, and click Data Subtotal:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

14

Before you click Subtotal, be sure to include the column labels when you make your selection, so Excel will be able to discern what numbers to total. For this example you could select cells A1:E10 and click the Subtotal button:

After clicking the Subtotal button, the Subtotals dialog box will appear:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

15

The drop list under the At each change in: heading gives you options as to the number of rows that will be totaled. (For columns, totals will be applied every time the labels change.)

In this example, the region column is selected, so with every change in the Region labels (from East to West, West to South, and so on) a subtotal will be applied. 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 subtotals:

In the Add subtotal to section, you can select check boxes for the columns you want totals for. You can apply totals to a single column or to multiple columns as long as they are covered by your selected range.

Finally, there are three check boxes at the bottom of the Subtotal dialog box that will allow you to: Replace any pre-existing subtotals Put page breaks between totaled groups so they can be printed on separate pages Place the subtotals and grand totals above or below the corresponding data

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

16

If you choose to apply totals to each change in the Region column while applying the Sum function to the Total Sales column, and choose no page breaks, the resulting worksheet will look like this:

Notice that there is a subtotal for the Total Sales figures at every change in the Region value. There is also a grand total for the Total Sales column at the bottom of the data. You can also see that Excel has provided outlined levels, collapse/expand buttons, and numbered outline level buttons associated with the subtotals. These buttons and outlines work exactly as previously explained: the lower the number on the button you choose, the less detail will be shown. If you want to remove these subtotals, you can select the range of data in question (A1:E14) and click Data Subtotal to invoke the Subtotal dialog box. When you see the box, click the Remove All button:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

17

Lesson 1.2: Exploring Scenarios


In business it can often be beneficial to explore multiple scenarios for a given situation. This allows you to see what combination of factors gives the best results; in other words, test various scenarios. With Excel 2010, you can easily explore multiple scenarios based on the same data. In this lesson you will learn what a scenario is and how to create one. You will also learn about scenario summary reports and how to save multiple scenarios based on 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 at your convenience. If you have multiple scenarios saved, you can load different scenarios into your worksheet and compare and contrast them to see which particular set of values 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. Used in this way, Excel scenarios provide a powerful tool for performing what-if analysis. You might use scenarios to represent different budget options, or perhaps evaluate different financial forecasts. You can use Scenarios to compare different data projections based on any number of factors.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

18

This is how it works. The data that makes up your scenario is saved with your workbook, but it 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 key cells.

Creating a Scenario
To create a scenario in Excel, begin with the worksheet that you want to add scenarios to. Then, click Data What-If Analysis Scenario Manager:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

19

When you click on this option, the Scenario Manager dialog will appear:

To create a scenario, click the Add button in the upper right. This will display the Add Scenario dialog box:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

20

To enter a scenario 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 textbox. Select the cells that will be changing with your mouse. (Remember that you can use the Ctrl key for selecting non adjacent cells.) If the Add Scenario dialog box gets in the way when you are selecting cells, you can drag it to one side, or collapse it by clicking the small Collapse Dialog button:

In the following image, you can see the name for the scenario is Change Wages, and the Changing Cells are G2 to G9 (the Wages column in the worksheet):

You can also describe the scenario in the Comment area of the dialog box if you wish. You will also see two check boxes at the bottom of the dialog box: 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.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

21

Once you click OK, you will see the Scenario Values box.

Here you will see the references for the cells that you selected for your scenario. When you use this scenario in the future, the values you enter here will be loaded into the corresponding worksheet. (Remember, you can move between textboxes in a dialog box by pressing the Tab key.) Notice that they are populated with the current worksheet data by default. If you want to save the current (actual) data as a scenario, you could just click OK at this point. Otherwise, you should enter the appropriate new value that you want for this scenario in each box.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

22

Click OK to create the scenario. You will then see the Scenario Manager Box with your newly created scenario available in the Scenarios area.

In this dialog box, you can see the changing cells in the Changing cells area, and any comments in the Comment area. If there is an assortment of scenarios in the scenario manager, just click the one that you want and click Show to see the results of the given scenario in the worksheet.

Saving Multiple Scenarios


To save multiple scenarios for a worksheet, click Data tab Whatif Analysis Scenario Manager to display the Scenario Manager dialog. Then, use the Add button in the Scenario Manager to create as many scenarios as you require (following the process as described previously). All of the scenarios you create for a given worksheet will be available in the scenarios list in the Scenario Manager dialog.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

23

In the following image, 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, click to select it from the Scenarios list and click the Show button at the bottom of the dialog. To remove a scenario, click to select it in the list and then click Delete. Finally, to make changes to a scenario, select it, and then click Edit.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

24

The Edit command will invoke the Edit Scenario dialog:

This dialog allows you to change the name, changing cells, cell values, and comments associated with the selected scenario. (This is essentially that same dialog that is used in the process of creating a scenario.) If you wish, you can have a different set of scenarios for each worksheet in your workbook. It is important to note that when you display the Scenario Manager, only scenarios for the currently active worksheet will be shown in the Scenarios list.

Merging Scenarios
There are times when it could be useful to bring together scenarios from different worksheets. For example, you could create a worksheet and then distribute copies to several co-workers. Each person could create their own scenario (their own opinion of how the values will change) and then send the worksheets back to you. If you merged all of the scenarios from the different worksheets into one worksheet, you could compare all of the scenarios with a simple click of your mouse. To merge scenarios from different worksheets, first open up each Excel workbook that contains a different scenario. It is important to note that merging scenarios works best if each worksheet has the same design and data layout, and if the changing cells in each scenario are in the same range.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

25

Here is an example.

The preceding worksheet contains two scenarios: Lower Wages and Actual Values. For both of these scenarios, the changing cells are the cells with data in the Wages column. The following image shows a similar worksheet from a different workbook. This worksheet has only one scenario, called Increase wages. The important thing to note is that the changing cells for the Increase wages scenario are the same as the changing cells for the two scenarios in the first worksheet.

To merge the scenarios from the two different worksheets, you should first open both of the respective workbooks at the same time. Next, you should decide which worksheet will be the destination for the merged scenarios and which worksheet will be the source. For this example, we will use the worksheet with the Increase wages scenario (preceding image) as the destination for the merge.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

26

Now, make the destination worksheet the active worksheet and then display the Scenario Manager dialog by clicking Data What-If Analysis Scenario Manager. When the dialog appears, click the Merge button:

A Merge Scenarios dialog will appear:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

27

If you expand the drop list in the Merge Scenarios dialog you will see a list of the currently open workbooks. Select the workbook that contains the other scenarios and then select the worksheet in that workbook that contains the specific scenario that you want to merge:

Once you choose the appropriate worksheet, click OK. At this point, the Scenario Manager dialog for the active worksheet will appear. It will now contain the scenario(s) from the source worksheet that you chose in the Merge Scenarios dialog.

Now that the scenarios are merged into one worksheet, you can compare them easily. (You can repeat this process to merge additional scenarios from other open workbooks if you wish.)

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

28

Creating a Scenario Summary Report


A Scenario Summary report can be used to display and compare the scenarios stored with your worksheet. To create a summary report, open the worksheet containing the scenarios and click the Data tab. Next, click WhatIf Analysis Scenario Manager:

When the Scenario Manager dialog appears, click the Summary button:

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. (You will learn more about PivotTables later in this manual.)

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

29

In this example, the Scenario Summary radio button is selected. The next step is to select the result cells that you want to be shown in the summary report. You can do this by selecting cells with your mouse on the worksheet, just as before. Finally, click OK to create the summary:

The scenario summary will appear on its own sheet. As you can see, it shows the changing cells and the results cells for the scenarios that are stored with your worksheet. The changing cells that have values different from the current values will be highlighted in grey. Notice the 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, Lower Wages, and Actual Values.)

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

30

Lesson 1.3: Using Data Analysis Tools


Excel 2010 provides a rich assortment of analysis tools that you can use to explore and interpret your data. While there are plenty of built-in tools in Excel, there are also additional software files than can be added to Excel to extend its functionality even more. These additional software tools are known as add-ins. Add-ins can come in the form of a single task-oriented tool like Solver (which we will look at later in this lesson), or they can consist of several tools combined in a pack, like Excels Analysis ToolPak, which provides an assortment of tools for analyzing scientific, statistical, or engineering related data. Some add-ins come packaged with the Microsoft Office system, while others may be provided by third party vendors. In this lesson, well have a look at a few of the what-if analysis tools that are built into Excel 2010, like goal seek and one and two input data tables. Well also look at add-ins and how to enable them. Well also take a close look at the Solver data analysis add-in.

Enabling Data Analysis Tools


As mentioned above, there are some interesting data analysis tools provided as add-ins for Excel, such as the Analysis ToolPak and the Solver. In a general sense, add-ins can be described as small software modules or files that extend the functionality of the larger Office applications. The important thing to know is that these are not enabled in the Excel program when it is installed, as they often provide more obscure or mathematically advanced functionality than is required in a typical business environment. You must enable them manually from within Excel.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

31

The first step in enabling add-Ins is to navigate to the add-in management section of the Excel Options window. To start, click File Options:

When the Excel Options window opens, you will see a panel on the left side with a series of categories. Click Add-Ins:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

32

When you choose this option, the Excel Options window should look something like this:

In the main viewing area, you will see a large scrollable list called Add-ins. This list is broken down into the following sections: Active Application Add-ins, Inactive Application Add-ins, Document Related Add-ins, and Disabled Application Add-ins. At the top of this list are the headings Name, Location, and Type. The corresponding name, location path, and add-in type, for each add-in are grouped in the list according to these headings.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

33

If you click on any add-in in this list you will see the name of the add-in, the publisher, the location (file directory), and a brief description of the add-in in the area beneath the list. Heres an example:

If you click the Manage menu near the bottom of the window, you will see the following options:

Here you can see two types of add-ins at the top of the list: COM Add-ins and Excel Add-ins. COM stands for component object model, a Microsoft technology that helps software components (like Microsoft Office programs) to communicate. For example, a form of COM technology is used to allow Word documents to link to data in Excel spreadsheets. Often a single COM add-in will be available for a number of Office applications. For the purposes of this lesson, we are interested in the add-ins specifically for Excel. To manage the Excel add-ins, select it in the list, and click Go.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

34

When you click Go, an Add-Ins dialog will appear and show a list of the available Excel add-ins:

If an add-in is enabled, it will have a checkmark next to its name in the list. In the image above, no Excel add-ins are enabled yet. If you want to see a brief description of an add-in, click it in the list. In the example above, the Solver add-in is selected and a description of the Solver appears near the bottom of the dialog. To enable a particular add-in, click to place a checkmark in the appropriate checkbox and click OK. To enable the Solver add-in, for example, simply place a checkmark next to it the Add-Ins dialog and then click OK.

If you see a dialog stating that the add-in you are enabling is not currently installed on your computer, simply click the Yes button in the dialog to install it.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

35

To make sure the Solver add-in is enabled, click the Data tab, and then look for Solver.

Similarly, if you check the box corresponding to the Analysis ToolPak, and then click OK, it will be enabled in Excel as well.

In the following image, you can see that the Analysis option is now available on the Data tab.

An Overview of Excels Analysis Tools


As mentioned near the beginning of this lesson, the Analysis ToolPak add-in provides an assortment of tools for analyzing scientific, statistical, or engineering related data. Many of these features are for scientific or statistical data analysis, so a comprehensive exploration of the use of these tools is beyond the scope of this manual. That being said, here is a quick and gentle overview of some of the Analysis ToolPak features.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

36

To enable the Analysis ToolPak, make sure there is a check mark in the appropriate checkbox in the Add-Ins dialog:

If the Analysis ToolPak is enabled, there will now be a corresponding option (Data Analysis button) for it on the Data tab:

If you click the Data Analysis button on the Data tab, a dialog with a scrollable list of tools will appear.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

37

The tools available in the list are intended for quite specific and advanced data analysis techniques. To start one of the tools, simply click it in the list to select it and then click OK.

The first tool listed is called Anova: Single factor. (Anova is short for analysis of variance.) This tool can be used to examine if the means (averages) of samples (groups of experimental data from a population) are different in a significant way. Tests like these are often used to examine the significance of the results in scientific studies. Generally in a study, an independent variable will be changed by the experimenters to see if it has a result on the dependent variable. This is often done by comparing the results for different groups of data (samples), resulting from tests at different levels of the independent variable. For basic experiments with only two samples, you could use a basic test like a T test (also included in the Analysis ToolPak) to compare the averages of the samples. For more complex experiment (with more than two samples), an Anova test could be used. A single factor Anova can be used to compare multiple samples, based on a single independent variable. A two factor Anova test can be used to compare multiple samples, based on two independent variables The next item in the list of analysis tools is a Correlation test.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

38

It is often useful to know if two variables are related in some way, and a correlation test can help to determine this. Think of the word correlation as co-relation. If there is a strong correlation between two sets of data, it generally means that they trend or change in concert with each other. If there is a significant correlation in your data, you may be able to make predictions based on this relationship. For example, if you sell sunglasses, you may be curious as to the relationship between the weather (amount of sun or temperature) and the sales of your product. Here is an example worksheet.

To invoke the Data Analysis dialog, click Data Data Analysis. When the dialog appears, select the Correlation option and click OK.

When you click OK, a Correlation dialog will appear on your Excel screen. In this dialog, you can select the range of data to be analyzed, whether it is grouped in rows or columns, whether to include the first row as labels, and where to place the results (in a range or in a new worksheet).

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

39

In the following example, the range of data to be analyzed is B1 to C14, with the data grouped in columns and column labels included. Furthermore, the results will be displayed on a new worksheet.

Once you are ready, just click OK to generate the analysis results. The following image shows the results as displayed in a new worksheet.

The important value to take note of is in cell B3. This is the correlation value. This value will be between -1 and +1. If the value is +1 it means that there is a perfect correlation. In other words, the two sets of data rise in perfect concert. If the correlation value is a -1, it means that just as one set of data rises, the other set of data shrinks. A value of 0 would indicate no relationship whatsoever. As you can see in this example, a value of .915834314 (almost 1) indicates a very strong positive relationship between the hours of sunlight per day and the sales of pairs of sunglasses per day.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

40

Another interesting tool in the Analysis ToolPak is the Random Number Generator.

You can use random number generation to simulate data or random behavior. For example, if you wanted to simulate a series of coin tosses for a statistical experiment, you would select Random Number Generation from the list in the Analysis Tools dialog and click OK. This will display the Random Number Generation dialog.

To simulate a coin toss, enter the number of variables (1 for one coin) and then enter the number of random numbers (the amount of flips of the coin) in the appropriate fields. You must also choose the correct distribution (which is the Bernoulli distribution for the case of flipping a coin) from the drop list provided. You must also enter a p value (a value between 0 and 1), which represents the probability of getting a heads or a tails. Since we want to simulate a fair coin we will choose .5 (50/50 chance) for the p value. For the purposes of this example, it is not necessary to enter anything in the Random Seed box. Finally, you can choose to put the results in an output range, a new worksheet in the current workbook, or in a new workbook. For this example, the range of A1 to A10 is specified as the cells to contain the results. When everything is ready, click OK in the top right to generate the coin tosses.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

41

The following image shows the results of the coin toss in cells A1 through to A10. Think of a 1 as a head and a 0 as a tail:

Probably the most basic tool in the Analysis ToolPak is the Rank and Percentile feature.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

42

You can use this feature to create a percentile rank of your chosen data values. For example, here is a batch of random data that could represent scores on a hypothetical test.

To rank these scores we would select Rank and Percentile from the list in the Data Analys is dialog and click OK. This action will display the Rank and Percentile dialog:

In the dialog, simply specify the input range of the data and then specify if it is organized in groups or columns. As before, you can also specify the destination for the results. In this
2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

43

example, the New Worksheet radio button is selected for the destination. When you are ready, just click OK to proceed.

In the results, you can see separate columns labeled Point, Column1, Rank, and Percent. The Point column provides values for the position of the given test score in the original data column. Column1 lists the ranked test scores, the Rank column shows the rank of the corresponding test score, and Percent column shows the percentage of scores that are below that score. As a final note on the tools in the Analysis ToolPak, lets discuss how to get a bit of help with a given tool if you need it.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

44

If you see a tool in the Data Analysis dialog that you would like to know more about, click the Help button on the right side of the dialog:

Then an Excel help window will open with a list of items corresponding to the tools in the Data Analysis dialog. To get help or information on an item in this list, click on the name of the item and it will expand to show a brief description of the given item and what it is used for:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

45

By default, Excel will try to connect to the Internet to gather available information from Office.com. If you do not have an Internet connection, help will retrieve information that is stored locally on your computer.

An Overview of the Available Add-In Tools


As mentioned earlier, the available Excel 2010 add-ins are: Analysis ToolPak Analysis ToolPak VBA Euro Currency Solver Add-in Now that we have looked at some of the tools in the Analysis ToolPak, it is time to turn our attention to the remaining Excel add-ins. The Analysis ToolPak VBA add-in can be enabled just like any other Excel add-in, but you will not see an option for it in any of the tabs. The Analysis ToolPak-VBA add-in should not be confused with the Analysis ToolPak that we just looked at. VBA stands for Visual Basic for Applications. It is a programming tool for building functions and automating tasks in Microsoft Office applications. The ToolPak-VBA add-in provides the user with the ability to call (use) the functions in the Analysis ToolPak from within VBA programs (like macros). This is not the same as using the ToolPak functions manually from within your worksheet, which is why the ToolPak-VBA add-in doesnt appear as on the Data tab. It is primarily for behind-the-scenes work by providing VBA programmers with more functionality. If you only intend on using the ToolPak features manually as shown in the previous pages, there is no need to install the ToolPak VBA add-in. Next is the Euro Currency Tools add-in.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

46

When this add-in is enabled, currency commands will appear on the Formulas tab:

These tools can be used to convert various European currencies to Euros or other European currencies. Take the following worksheet as an example.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

47

Here we have a column of values that represent Austrian Schillings. To convert this column of Schillings to Euros, simply select the range of values, and then choose Formulas Euro Conversion:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

48

At this point, a Euro Conversion dialog box will appear. In the dialog, you must specify the range of source data (A2:A13 in this case) and the destination range for the conversion (B2:B13). Next, you can use the drop lists provided to specify the source currency (Schillings) and the destination currency (Euros).

Once everything is ready, click OK in the dialog to convert the currency. Here is the result:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

49

You can also format cells so that Excel recognizes the cell values as Euro currency, much the same as if you formatted the cells as standard ($) currency. To do this, start by selecting a range of cell values.

Next, choose Formulas Euro Formatting.

Here is the result:

Just as with standard currency formatting, if you change the value in the cell, the Euro currency formatting still remains with the cell.

As you can see, this add-in isnt really for data analysis, but it is worth mentioning these tools in this overview as they can be useful if you work with European currencies.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

50

The final Excel add-in is Solver:

When the Solver is enabled, it can be accessed by a button on the Data tab:

Solver is a fairly advanced tool for examining complicated what-if scenarios. Essentially, it is used to minimize or maximize systems of equations based on a set of constraints. We wont get into too much detail about it here because we will explore it in depth at the end of this lesson.

Using a One or Two Input Data Table


You can use Excel data tables to test how your formula results will vary when the data that the formula operates on changes. You do this by specifying a series of hypothetical values that Excel will use to evaluate the formulas with. This allows you to then view the results of the evaluations and compare the results for the different data inputs. Data tables save you the trouble of entering a series of input values into a worksheet and recording each recalculation of the worksheet for each new input that you enter. When you use a data table, 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.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

51

The following example involves a hypothetical consulting firm. Our first goal is to examine the effect of the number of clients on the total profit, expenses, and income.

Currently, the firm has 10 clients. The values for Wages, Total Costs, Total Expenses, and Profit are all calculated by formulas dependent on the number of clients the firm can retain. For example, you might like to see what the profit formula and other formulas in the worksheet would produce for a varying number of clients. To manage this, we can use a single input data table.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

52

Keep in mind that there are some strict rules you should follow when building your data table to help ensure that it works correctly. First, list the input values that you want to try in a row or column of adjacent cells. For this example, well use a column of input values. The column will be named Hypothetical Clients and will hold different values for our variable (the number of clients).

In the row just above your input data (row 4 in this example), enter the 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 this case, we want references to cells C5, C13, and C15 placed in the row just above our input values (row 4), and starting one cell over to the right from the input column (in column F). The resulting worksheet looks like the following:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

53

The input variables are in the cell range E5:E19. Cell F4 contains the reference =C5, cell G4 contains the reference =C13, and cell H4 contains the reference =C15. These references point to the Total Income, Total Expenses, and Profit formulas respectively. It is a good idea to label your new columns appropriately, so you can clearly understand the data table results. In the preceding example, the new columns are labeled Total Income, Total Expenses, and Total Profit. Now, lets have a closer look at the structure.

Notice that the formula references (in cells F4:H4) are in a row just above, and one cell to the right of the first input variable (in E5). The data table is now ready. The input variables are listed in the Hypothetical Clients column and the formula references are one row above and one cell to the right with respect to the first input value. Also, all of the elements in the data table are clearly identified. The next step is to select the full range of cells from the data table formed by the input variables and the formula references. In this example, the range is E4:H19:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

54

After you have the correct cells selected, choose Data What-If Analysis Data Table:

This action will display the Data Table dialog box:

At this point in the process, it is important to remember the reasoning behind our choice of input variables: we want to see our formula results over a range of different values for the number of clients. It is now time to tell Excel that we will be using the number of clients as the variable for the data table. Looking back to the section of the worksheet that contains the formulas and original data, we see that the number of clients is stored in cell C3.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

55

The next step is to enter this cell reference into the Data Table dialog. Because the values that we are substituting for the number of clients are arranged in a column, the cell reference C3 (the original location of the number of clients) should be entered into the Column input cell box in the dialog.

Then, click OK in the dialog to see your values:

You can now see at a glance how the 15 different values in the Hypothetical Clients column influence the results for total income, total expenses, and total profit.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

56

If you change the values in the Hypothetical Clients column, the data table will automatically recalculate in accordance with the new values. You can also apply formatting styles, borders, shading, and other enhancements to the data table in the same way that you could any other area of your worksheet:

Now, what if you want to consider the effects of two input variables on a single formula? For example, what would be the effect of both the number of clients and the fee per client on profit? To find out, you can use a two input data table.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

57

To start, choose an empty cell, and then 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 to refer to the cell containing 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 cell that contains the formula reference. The other range will be a row starting on the immediate right of the cell that contains the formula reference. This means that the formula reference 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 dependent on both of these variables.)

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

58

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 that looks something like the following:

(In the preceding picture, shading and labels have been added to the data table for organization and clarity.)

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

59

Once the table is set up, the next step is to select the range of cells covered by the new data table and invoke the Data Table dialog (Data What-If Analysis Data Table):

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

60

This time, we have two input variables into the Data Table dialog; one corresponding to the row of client fees, and one corresponding to the Number of Clients column:

After the correct cell references are entered, it is simply a matter of clicking OK in the dialog box to complete the table. This time, the formula referenced in E2 will be evaluated once for every combination of Clients and Client Fees that exists in the table:

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

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

61

Using Goal Seek


Goal Seek is another useful what-if analysis tool built into Excel. With Goal Seek, Excel can help you 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 should adjust in order to reach the goal. Take the following small worksheet as an example.

In the formula bar, you can see that the formula for total profit is the Total Income (B4) minus the total cost (B7). It should be noted that cells B4 and B7 themselves contain formulas. The formula in cell B4 is =B2*B3 (units sold multiplied by price per unit). The formula in cell B7 is =(B5*B2)+B6 (materials per unit multiplied by units sold) plus the labor to make the units. The following image shows the worksheet with some sample data.

Clearly, at current production levels the company is losing money. How would you figure out how many units to manufacture to break even or make a profit? One solution is to use goal seek to find a breakeven point based on changes to a cell that is referenced (directly or indirectly) by the profit formula (in cell B8).

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

62

To begin, select cell B8 (the cell with the profit formula) and then invoke the Goal Seek dialog by choosing Data What-If Analysis Goal Seek:

When the dialog box appears, B8 is already entered in the Set cell box because that is the cell that you selected just prior to invoking Goal Seek:

In the To value box enter 0, since a profit of 0 is the breakeven point). In the By changing cell field enter B2 (the number of units required).

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

63

When everything is set up, the Goal Seek dialog looks like the following:

When you click OK, Goal Seek will find a value for cell B2 (units sold) that will make the profit formula (B8) equal to 0 (breakeven).

The Goal Seek Status dialog reports that a solution has been found, and 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. At this point, you can click Cancel to restore the original worksheet values, or click OK to enter the goal seek solution values into the worksheet. You can just as easily use goal seek to find the price per unit, materials per unit, or labor that would make the worksheet break even. You could also set a specific level of profit for your goal by entering a value of your choice in the To value field of the Goal Seek dialog.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

64

The following example image shows how goal seek evaluates the price per unit required to make 1000 dollars in profit with 150 units sold.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

65

Lesson 1.4: Using Solver


Sometimes, when dealing with more complex problems, tools like data tables or Goal Seek cannot provide the kind of forecast or data analysis you are looking for. In this type of situation, Solver might be able to help. Solver is a data analysis tool that is designed to optimize systems of equations (formulas) that are subject to specific constraints. Solver can be used to find optimal solutions for linear programming problems involving multiple equations and multiple unknowns. For example, 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 (the constraints and formulas) and what you are looking for (the objective). If you are trying to solve a complex problem, Solver will require certain information to work correctly. You will have to designate one or more formulas that reference the unknowns you want to solve for, and you will have to define constraints that model the given situation. Really, the best way to get an idea of how Solver works is to see it used in an example. Lets get started!

Understanding Solver
First, since Solver is an Excel add-in, you should make sure that it is enabled. To do this click the Data tab. If Solver is enabled, you will see it on the Data tab:

(If you need more information on how to enable Solver, refer to the Enabling Data Analysis Tools concept at the beginning of this lesson.)

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

66

In order to use Solver, you must set up the worksheet correctly. This requires a solid understanding of the problem you are trying to solve. The following example involves a business that assembles and sells furniture. The business sells two types of tables: one made from maple and another made from mahogany. The maple table is of lower quality than the other table, but the price is reasonable. The mahogany table is of higher quality and is made from more expensive wood, and so it has a higher price.

From the worksheet, you can see that it takes three hours of rough carpentry to assemble the maple table and four hours of rough carpentry to assemble the mahogany table. Once the table is assembled, it takes one hour of finish work for the maple table and two hours of finish work for the mahogany table. The goal is to find out how many of each type of table 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 finish carpenter who is only available for 30 hours of finish work per week, and two rough carpenters that are available for a combined 80 hours of rough carpentry a week. Also, the lumber yard that supplies the business with mahogany can only supply enough for 10 tables a week. This means that the total finish work hours used must be less than or equal to 30 hours for the week, and the total rough work must be less than or equal to 80 hours. Furthermore, the number of mahogany tables we can make in a week must be less than or equal to 10. These constitute the constraints of the problem.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

67

The following worksheet is the same as the previous one, except that the cell formulas are now visible. Examine the cell references in the formulas carefully.

Cells B4 and C4 hold the number of rough carpentry and finish work hours required to build a maple (less expensive) table. Similarly, cells B5 and C5 contain the number of rough work and finish work hours required to assemble a mahogany table. The revenues from the maple tables can be calculated by multiplying the number of tables assembled by the sale price. This is what the formula in F4 does. The revenues from the mahogany tables are calculated by a similar formula in cell F5. Notice that in both cases, the revenue formulas depend on the number of tables 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 table assembled (D4 for maple and D5 for mahogany). The constraints for this problem are shown in the lower right 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 Solver. We have specified that: The rough work hours are to be less than or equal to 80 The finish work hours are to be less than or equal to 30 The number of mahogany tables that can be assembled is less than or equal to 10 The number of each type of table 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 finish-work hours and rough-work hours used are in cells G4 and H4 respectively. You should notice that these formulas are also dependent on the number of each type of table assembled.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

68

To summarize, in order to use 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 cells to be changed. If constraints are involved, the formulas to be subjected to the constraints should also be dependent on the changing cells.

In the preceding worksheet, you can see that cells G4 and H4 contain formulas that will be subject to the constraints. Cell F6 contains the objective formula and cells D4 and D5 are the changing cells (the numbers of each type of table that will be made). 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 table that is made will be sold. To use Solver, click Data Solver:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

69

This will invoke the Solver Parameters dialog:

Place your cursor in the Set Objective 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 in the dialog. To enter the changing cells, place your cursor in the text area under the By Changing Variable Cells heading, and select the appropriate cells from the worksheet. For the problem shown here, the changing cells are D4 and D5.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

70

At this stage, the Solver dialog should look like this:

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:

To add the first constraint, place the cursor in the Cell Reference box and select the cell with the formula you want to constrain. In this particular example, cell G4 is selected, which contains the formula for calculating the total finish work used. Next, click in the Constraint box and click the cell that contains the appropriate constraint value. Here, we chose cell H10, which contains the value 30. 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 <= H10; that is, total finish work hours should be less than or equal to 30.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

71

Click OK to enter the constraint and close the Add Constraint dialog. The Solver Parameters dialog now looks like this:

Next, we will follow the same process to enter the cell references for the rest of the constraints: Total rough work hours less than or equal to 80: (H4 <= H9) Number of mahogany tables less than or equal to 10: (D5 <= H11) Number of mahogany tables greater or equal to 0: (D5 >= H12) Number of maple tables greater or equal to 0: (D4 >= H12)

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

72

Here is the resulting Solver Parameters dialog:

Here is the original worksheet with formulas shown:

Examine the worksheet carefully so that you understand the relationships between the objective, the changing cells, and the constraints as specified in the Solver Parameters dialog. To implement the Solver, click the Solve button at the bottom of the dialog.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

73

You will now see the Solver Results box:

If the Solver Results dialog reports that a solution has been found, the values that maximize the total profit (the solution) will now be visible in the changing cells in the worksheet (D4 and D5). Moreover, the value of the maximum profit will now be visible in the target cell (F6). The Keep Solver Solution radio button will be selected by default. If you click OK, the new (optimum) values will remain in the worksheet. If you select the Restore Original Values radio button and click OK, the solutions that the Solver found will not be entered into the worksheet and the original values will be retained. The following image shows the worksheet after the Solver solution has been implemented. If 10 maple tables and 10 mahogany tables are assembled, the total revenue will be maximized at 17500.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

74

Generating Reports and Scenarios with Solver


In the Solver Results dialog, you also have the option to save the results as a scenario that you can name and reload into the worksheet at a later date. (Refer to Lesson 1.2 for more information on scenarios.) To do this, click the Save Scenario button in the Solver Results dialog. You can also select one or more report types from the list at the right of the Solver Results dialog. Just click on a report type to select it and Excel will generate it for you. These formatted reports will be generated on separate worksheets. Now lets look at a Limits report based on the Solver solution. (It is generated on a separate worksheet if you select Limits from the report list in the Solver Results dialog before you click OK.) Here is what the report looks like for this case:

Changing Solver Values


Next, lets look at a Solver solution if some of the factors in the situation were to change.

Here we changed the price for the maple tables from 550 dollars to 750 dollars. Since we have not yet closed Excel or used Solver on another set of data and constraints, when we invoke the

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

75

Solver Parameters dialog, it will be populated with the same cell references and constraints as before.

When we run the Solver with the new price for a maple table entered into the worksheet, the Solver finds a new solution to maximize profits.

This time, we should assemble 20 maple tables and 5 mahogany tables, for a total revenue of 21000 dollars.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

76

Managing Solver Constraints


Lets have a look at a few more details about using Solver. In the Solver Parameters dialog, you will see a series of buttons next to the Constraints area:

Here is what each command does. If you want to add a new constraint, click Add. If you want to change a constraint, select it and click Change. If you want to delete a constraint, select it and click Delete. Reset All will clear all of the constraints, variables, and options in the Solver Parameters dialog

Choosing a Solving Method


You will also notice an option to select a solving method in the Solver Parameters dialog.

To choose a method, simply select it from the drop list. The default choice is GRG Nonlinear. To understand these solving method options, you have to know a little something about formulas. Lets start with one of the formulas in our furniture company example : C4*D4+C5*D5. This formula is using just basic multiplication and addition so it is a linear formula. In other words, if you graphed this formula it would basically look like a straight line. A formula like this: 3*(POWER(H11,3))+3 is not a linear formula. This is because we have a value (H11) that is being raised to an exponent of 3. In other words, if you graphed this formula it would look like a curve.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

77

If you use Solver with non-linear formulas (for example, formulas with exponents), use the GRG Nonlinear solving method. If you use Solver with linear formulas, we recommend that you use the Simplex LP solving method.

Using Solver as a Goal Seek Tool


Finally, you can also use Solver as a kind of advanced goal-seek tool. As an example, have a look at the following worksheet with formulas displayed.

Suppose you want to adjust the number of units sold, the price per unit, and the labor costs so that we generate a profit of $1000. How would you do this? One way to solve this problem is by using the Solver as a goal seek tool. To begin, you just display the Solver Parameters dialog in the usual way (Data Solver):

In the Solver Parameters dialog, we can simply choose cell B9 (total profit) as the objective, and then click to select the Value of radio button rather than Max or Min. The next step is to set

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

78

the value we are after; we will enter 2000 into the text box to the right of the Value of radio button. The final step is to enter the cells that we want to change to reach our objective. In this example the cells are B2 (units sold), B4 (price per unit), and B7 (labor costs). We can enter these cells into the By Changing Variable Cells text box by typing the references directly or clicking in the worksheet to select the cells. Once everything is ready, it is only a matter of clicking the Solve button in the dialog to find a solution.

When Excel finds a solution, the Solver Results dialog will appear and the solution values will be visible in the worksheet. As before, you can choose to keep the solution values, save them as a scenario, or restore the original values.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

79

Lesson 1.5: Excel and Hyperlinks


Sometimes it can be useful to create links in your worksheets that users can follow with just a click.

This worksheet contains three hyperlinks: one to another sheet in the same workbook, one to an e-mail address, and one to a web page. In this lesson, you will learn what hyperlinks are and how to insert them into a worksheet. You will also learn how to modify hyperlinks in a worksheet and how to browse hyperlinks in Excel.

What is a Hyperlink?
A hyperlink is an object 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 associated file or location will open. 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 together. This is, in fact, where most computer users first become familiar with hyperlinks. Quite often, hyperlinks come in the form of an underlined word or phrase in a bright blue font. This does not have to be the case, though, as hyperlinks can be a word, a phrase, a symbol, or even a picture! 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 on different servers 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

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

80

to a web page, to a file on a remote server, to a location in the same workbook, or to a specific e-mail recipient.

Inserting Hyperlinks
There are times when you might want to insert a link in your Excel worksheet that takes you to another location in the same workbook, or perhaps 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 that contains helpful information. Fortunately, in Excel 2010 it is fairly easy to insert hyperlinks into your worksheets. To start, right-click on the cell that will contain the link, and then click Hyperlink:

Another way to display the dialog is to first select the cell that will contain your hyperlink, and then choose Insert Hyperlink:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

81

Either action will open the Insert Hyperlink dialog:

Take note of the four buttons running down the left side of the dialog 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. At the top of the dialog, you can see a box named Text to Display. The text entered here will appear as a blue underlined hyperlink in the cell that you originally selected. This is what the user will see and click on. 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.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

82

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 dialog box.

You will also notice three buttons just to the left of the navigation area: Current Folder, Browsed Pages, and Recent Files.

If you click Current Folder, the drives, files, or subfolders of the current item displayed in the drop list will be displayed. In the preceding image, you can see that Computer is entered in the drop box, and the drives on Computer are displayed. You can use these navigation tools to navigate and select pretty much any file on your system.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

83

If you click the Browsed Pages button, a list of web pages that you recently visited will be displayed, like this:

If you click an item in the list to select it, information for the selected item (a URL) will be entered in the Address field and in the Text to display field (the text that forms the actual hyperlink).

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

84

If you click on the Recent Files button, you will see a list of recently accessed files.

If you make a selection from an item on one of these lists, the location information (URL or directory path) for the item will be entered in the Address field at the bottom of the dialog box (much like the preceding example for Browsed Pages). You can also take the old fashioned route and 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.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

85

You can also click the ScreenTip button in the upper right of the dialog box to add a brief comment that will appear when the mouse pointer hovers over the hyperlink.

Here is an example of a screen tip in action:

You can also the use the Bookmark button to link to a very specific location (like a cell range) inside another Excel workbook. First, select the Excel file from the list in the large center area, and then click the Bookmark button.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

86

You will then see the Select Place in Document dialog:

At this point you can click to select the specific worksheet that you want to link to and type in a specific cell reference. When you have finished making the necessary entries in the dialog box, click OK to return to the Insert Hyperlink dialog. For whatever type of hyperlink you specify, once you have chosen the correct settings, click OK to create your link.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

87

Editing Hyperlinks
To change the displayed text of an existing hyperlink, you can select the cell that contains the link, and then edit the link text in the formula bar:

You can also right-click the hyperlink and click Edit Hyperlink:

This action will display the Edit Hyperlink dialog, which is almost identical to the Insert Hyperlink dialog.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

88

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 Remove Link. Once you are ready to commit to your modifications, click OK.

Formatting Hyperlinks
Hyperlinks will generally appear in bright blue before they have been clicked and purple after they have been clicked. You can change the font color and size for an individual hyperlink by right-clicking it and choosing Format Cells:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

89

This will display the Format Cells dialog box, which you can use to modify the font characteristics, border, shading, and alignment of the link.

The method just described will allow you to format individual hyperlinks; but what about modifying the default color and font size for all hyperlinks?

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

90

To start, click the Cell styles button in the Style group on the Home tab. From the options that appear, find the Hyperlink style, right-click it, and choose Modify:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

91

The Style dialog will then open:

Make sure that the word Hyperlink is visible in the Style name text box at the top of the dialog. You should also see a check mark next to the word Font in the column of checkboxes on the left. This means that the style for hyperlinks currently includes only font settings. Next, click the Format button in the upper right of the dialog to open the Format Cells dialog.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

92

Here, you can make changes to the appearance of all hyperlinks:

When you are finished modifying the hyperlink style, click OK in the Format Cells dialog.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

93

You will now see the Style dialog again, with checkmarks corresponding to the style changes you made in the Format Cells dialog. If you are finished, click OK in the Style dialog to implement the changes.

Now every new hyperlink you create, along with the existing ones, will have this new style by default.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

94

Using Hyperlinks in Excel


To follow a hyperlink in Excel 2010, let your mouse pointer hover over it until a pointing hand appears. When you see the hand, left click the mouse and the target for the link will be opened with a program that is suited to do so. For example, if you click a link to a Word document, the document will open in Microsoft Word. If you click a link to an Access database, the database will open with Microsoft Access. If you click a link to a web page, the page will open with your default Internet browser. The following worksheet contains two hyperlinks.

The first link is to a Word document and the second is to an Access database. The two linked documents are in separate folders saved on the same computer as the workbook that contains the links. If you click the first link (the Word document) the target document will open in Microsoft Word. Depending on your security settings, you might see a dialog like this:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

95

This warning is reminding you that hyperlinks linking to unknown files can be a potential source of trouble, since a hyperlink could link to a file that contains malicious data. If you trust the source of the workbook or the linked file, click Yes. Then, the destination file will open:

You can see that the first link (in cell B1) is now purple, meaning that it has been followed. You should also notice that the linked document has opened in Microsoft Word.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

96

If we click the second link (in cell B11) another file will open, but because the target file is a database file, it will open in Access:

To remove a hyperlink from your spreadsheet, right-click the cell containing it and click Delete:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

97

This action will remove the hyperlink from the worksheet and the cell in question will be left empty. You can also right-click on a cell with a hyperlink and click Remove Hyperlink:

This action will remove the target information from the link, but the text of the link will remain in the cell. You can also insert a hyperlink function by clicking the Insert Function button by the formula bar:

This action will display the Insert Function dialog, from which you can select the Hyperlink function:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

98

If you select HYPERLINK and click OK in the dialog, the Function Arguments dialog box will appear.

In the Link_location text box, 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 box, you can specify the particular text or number that will be visible in the spreadsheet. When you click OK, the link will be inserted into the spreadsheet.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

99

You can also specify an image or other graphic as a hyperlink in your spreadsheet. To do this, just click the image and click Insert Hyperlink:

This action will display the same Insert Hyperlink dialog that we saw earlier. Use the Insert Hyperlink dialog to specify the target of the hyperlink, and then click OK to associate the linked location to the image. Once you have created the link, if you click on the image the link will be followed to its target, just like a regular hyperlink. You can edit and remove it in the same way.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

100

Section 1: 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.

Which of the following features is not a What-If Analysis tool? Goal Seek Subtotal Solver Single input data table To optimize a system of equations with Solver, you must specify Constraints Scenarios Solutions All of the above What is the difference between Solver and other What-If Analysis tools? Solver is an Excel add-in Solver can solve for more values in more complex problems Solver can be used to maximize or minimize and to solve for a value All of the above Which of the following statements is true? You should use goal seek to optimize systems of equations You should use scenarios to compare the results of different sets of values in a spreadsheet You should use scenarios to optimize systems of equations Any of the above Which of the following statements is false? A hyperlink can link to a web page on a remote server A hyperlink can link to a cell in the same worksheet A hyperlink can be used to import external data into Excel A picture can be used as a hyperlink To use automated subtotals you need A table of data Data arranged in columns with column labels Numerical data arranged with row headings Data arranged in separate workbooks

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

101

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

Automatic outlining works best with Numerical data organized into groups and sub groups by formulas or functions Numerical data arranged with row headings Numerical data organized into groups and subgroups without any formulas or functions A table of data To perform a correlation analysis in Excel you should consider Using the Solver Add-in Using the Analysis ToolPak Using what-if analysis tools You cannot perform a correlation analysis in Excel The Analysis ToolPak is Part of the What-If Analysis Tool group An Excel add-in with special formatting options An add-in that is useful for analyzing scientific data An add-in that can be used to connect with an external database Which of the following statements is true? Solver can be used as a goal seek tool Goal Seek is an Excel add-in Once installed, add-ins cannot be deactivated The Outline tools are on the Excel View tab

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

102

Section 2: Pivoting Data


In this section you will learn how to: Describe and create PivotTables Use the contextual PivotTable Tools tabs Add and remove PivotTable information using the Field List Change the Field List layout Pivot data Expand and collapse data Filter, sort, group, and refresh data Edit a data source Modify PivotTable row and column labels and values Use the Layout group on the Design tab Apply a style to a PivotTable Change PivotTable style options Manually format a PivotTable Use the PivotTable Options dialog Create and use a classic PivotTable frame Switch to a classic PivotTable frame Add data to a classic PivotTable Pivot data in a classic PivotTable Create a PivotTable based on external data Refresh external data Create a Slicer and use the Slicer Tools tab Download, install, and use PowerPivot Integrate Access and Excel data using PowerPivot Create a PivotTable from PowerPivot data

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

103

Lesson 2.1: Getting Started with PivotTables


An important function of any spreadsheet program is to help you derive meaning from your data. An Excel PivotTable is a great tool for doing this. A PivotTable can help you get different perspectives as you analyze the relationships between the columns and rows of your data. 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, summarizing, and analyzing information. A PivotTable helps you organize and manipulate the raw data in your spreadsheet to provide insight into patterns or relationships that might not be obvious at first glance. PivotTables also give you the power to summarize your data and view it in a different context, without changing the original content or structure of the data in the worksheet. 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 can base a PivotTable on data in your current workbook or on external data.) Rather than build several regular tables to explore how columns from an Excel worksheet relate to each other (or to see the data summarized in different ways), 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. In short, PivotTables enable you to 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, the 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 the source data can limit the usefulness of your PivotTable.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

104

The following image shows a block of contiguous data that is ideal for a PivotTable.

Notice that there are no empty rows or columns, and that every column of data has a unique label. When data like this is arranged as a PivotTable, you can quickly create views of the data that show (among other things): The profit for each product type across regions The sales figures for each product type across regions The profit for different product types by various sales people These are only a few of the scenarios that you could generate with a PivotTable based on the given data.

Creating a PivotTable
To create a PivotTable, select the range of data that you want to base the table on, and then click the PivotTable button on the Insert tab:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

105

This will invoke the Create PivotTable dialog:

Notice that you are allowed to select data from an Excel table or range, or from an external data source. If you forgot to select the range before you opened the dialog, you can enter it now. If you choose the external data source option, you can base your PivotTable on data outside your current workbook (i.e. another workbook, or another source like an external database). To start, select the Use an external data source radio button and click Choose Connection:

Then you will see a list of existing connections. A typical existing connection could be an MS query, or a connection you previously made to an Access data base for some other purpose. (There will be more on using external data later.)

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

106

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 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. Once you are ready, click OK to create your PivotTable:

Above you can see a new PivotTable area and the corresponding PivotTable Field List placed in the existing worksheet that contains the source data. Once your PivotTable area appears, you can add information to it by placing checks in the boxes next to the fields in the PivotTable Field List. For this example, checks will be placed next to the Month, Salesman, Region, and Profit fields:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

107

The PivotTable area will now be populated with the corresponding data:

As you can see in the following image, the profit has been organized by Month. It has also been organized by Salesman, with a total profit for each Salesman 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.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

108

The following close-up view of the table tells us that the total profit for Month 1 is 2775. The Salesman A. Smith generated a total of 840 in profit with 590 from the East region, and 250 from the Northeast region.

As you can see, a PivotTable can provide more informative views of your data than a regular table.

Using the PivotTable Tools Tabs


When you create a PivotTable in Excel, some useful tools for working with it will be provided with the rest of your Excel tabs. To access these tools, simply click anywhere within your PivotTable area.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

109

There should be two tabs available: Options and Design. Here is what the Options tab looks like:

Options Group Moving from left to right, Options is the first group of tools on the Options tab:

At the top of the group, a text box is provided so you can enter a PivotTable name. (This could help if you planned on referring to from within a macro or perhaps from another worksheet.) The Options command will open the PivotTable Options dialog, which we will discuss later on in this section. Active Field Group The next group of tools on the Options tab deals with the active PivotTable field. PivotTable fields are the ranges of data that you included in the PivotTable and they are typically identified by headings. The active field is the range of data that you are currently working in:

Above, you can see that the active cell is in the month column of the table, so the active field is Month. The green plus and red minus buttons in the Active Field group are for collapsing and expanding the active field.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

110

If you want more options for manipulating the active field, you can click the Field Settings button.

This action will display a dialog that you can use for fine tuning the active field:

Here you can decide if subtotals will be included in the table and if so, what function will be used to calculate them. By default, the subtotals in the table will be calculated as a sum:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

111

If you change this setting in the dialog to Average:

The PivotTable will reflect the change.

Group The next group contains grouping and ungrouping options:

These options can be used to group and ungroup data in a PivotTable in a way that is a bit like the grouping techniques that we will look at in Lesson 2.2. Sort & Filter Group You can use these options to sort your data in a number of ways or to insert a Slicer to filter your data:

There will be more discussion on sorting and Slicers later in this manual. Data Group This group contains two commands:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

112

The Refresh button is used to update the PivotTable with any changes that may have been made to the underlying source data. The Change Data Source command allows you to specify an entirely new range of data to base your existing table on. Actions Group Next up is the Action group of buttons:

The Clear button offers two options:

Clear All will clear the PivotTable of all data. Clear Filters option will remove any filters you have applied to the table. The Select command provides options for selecting all of your PivotTable or just particular elements of it:

The last button in the Action group, Move PivotTable, is useful if you want to relocate an existing PivotTable to a new worksheet or to a different area of the existing worksheet.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

113

Calculations Group This group provides tools for adjusting how the values and subtotals in your PivotTable are calculated and displayed:

If you click the Summarize Values By button, a list of options for calculating table values (such as subtotals) will appear:

Clicking the Show Values As button provides options to display your table values as percentages of various numbers, as differences from certain numbers, or as ranked values:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

114

The final option in the calculations group, Fields Items and Sets, lets you create new calculated fields for your table or even modify existing ones:

Tools Group The next group contains three commands:

The PivotChart will initiate the process of creating a chart based on your PivotTable data. We will explore this command in the next section. The final two commands allow you to apply OLAP tools to your PivotTable and apply What-If Analysis to the table. Both of these commands are beyond the scope of this manual. Show Group The last group on the Options tab will let you choose what elements of your PivotTable (and associated Field List) will be visible or hidden:

If a button is selected, its corresponding elements in the PivotTable (or Field List) will be displayed. In the image above, all buttons are highlighted, so the Field List, the collapse and expand buttons, and the field headers will all be displayed:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

115

PivotTables are like most things in Excel; if there is something you need to do, there is usually more than one way to go about doing it. The tools on the Options tab provide a quick and accessible way of getting things done with PivotTables. If you are looking to change the appearance of your PivotTable, check out the Design tab:

This tab contains three groups. Layout Group This group contains four commands:

Each of these commands expands into a menu allowing you to customize the chosen item. Heres an example:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

116

PivotTable Style Options Group This group lets you toggle various types of formatting on or off by checking or unchecking the respective box:

PivotTable Styles Group Last but not least, the PivotTable Styles group contains a gallery of pre-formatted themes to apply to your table:

Simply click a thumbnail to apply it, or use the arrows at the right of the gallery to view more styles.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

117

Adding and Removing Data with the Field List


We have already seen how to create a basic PivotTable by selecting a range of data as the source, and then choosing Insert PivotTable. This leaves us with a blank PivotTable area and a Field List containing items that are based on the headings (field names) in the source data.

As mentioned previously, a simple way to add data to the table is to place checkmarks next to the items in the Field List that you would like to include. In the following image, we have selected the Month and Profit fields from the Field List so that they automatically appear in the table.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

118

You can just as easily remove the fields from the table by clearing the checkmarks. (Note that the order in which you click to place your checkmarks is very important, as this will also be the order of placement for the fields in the PivotTable.) This method is quick and easy, but what if you want to have more choice in how the data is arranged in the table? At the bottom of the Field List you will notice a panel of four data boxes:

These boxes are named Report Filter, Column Labels, Row Labels, and Values. You can use your mouse to drag field names from the top of the Field List (the part with the checkboxes) down to these boxes. The structure of the resulting Pivot Table depends on where you drag and drop these field names. Have a look at the following example. The Month field has been dragged down to the Report Filter box:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

119

When this action is completed, the Month field will appear in the spreadsheet as part of the PivotTable.

Now, if we drag the Salesman field down to the Column Labels box and the Sales field down to the Values box, the Field List will look like this:

The resulting PivotTable will look like this:

Here we see the total sales for each salesman over all months combined.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

120

We could just have easily dragged other fields to the boxes at the bottom of the Field List to add to, or change the structure of the table. Moreover, we can easily drag fields away from the boxes at the bottom of the Field List to remove it (and remove the corresponding field/data from the table). For example, if you drag the Salesman field out of the Column Labels box and back up to the main list area (with the check marks) or pretty much anywhere outside of the bottom area containing the four boxes, the corresponding data will disappear from the PivotTable.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

121

Changing the Field List Layout


The default layout for the Field List looks like this:

Just like most other things in Excel, the Field List can be altered to suit your preferences. To do this, click the Field List Layout button in the upper right corner of the list:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

122

When you perform this action, a layout menu for the PivotTable Field List will appear:

This menu displays five preset layouts that you can choose from. To apply a layout to the Field List, just click on the layout option that you prefer. In most cases it is probably best to choose a layout that contains both the Fields section (checkboxes) and the Areas section.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

123

Here is what the first and second layout options on the menu will do to the Field List:

Pivoting Data
Why are PivotTables called PivotTables? Because they let you move data around easily (by dragging and dropping fields) to perform a sort of rotation on the structure of your table and at the same time, change your view of the data. The act of moving data around to change the table structure is called pivoting.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

124

Before you begin dragging and dropping, you should have some idea of what the different boxes at the bottom of the PivotTable Field List are used for.

As mentioned previously, you can drag fields into these boxes to add data to your PivotTable. What kind of table you end up with depends on what boxes you drop and drag fields into. The art of pivoting data largely depends on knowing where to place your fields. First, lets look at the Report Filter box. This area is best suited to fields that are used to identify periodic or organizational groupings of your other data. For example, you may have column headings for sales, profit, and expenses, which are grouped according to the specific month or year in which the sales, profits, and expenses have occurred. In this case, the month or the year field would be good candidates for the Report Filter box. This would allow you to populate the PivotTable with the data corresponding to whatever year or month you select. Have a look at the following PivotTable:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

125

This table shows the sales for each salesman according to region. Here is what the four Field List boxes look like for this table:

Now, suppose we drag and drop the Month field from the Field List to the Report Filter box:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

126

The PivotTable will now look like this:

If you look carefully, you will notice the word (All) next to the Month Field heading. This means that the table data has been summarized for all months. If you would like to summarize the data for just a single month, you could display the drop list for the Month field and choose a specific month:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

127

When you click OK, only the data for Month 2 will be presented in the table.

Now that you know what the Report Filter box is for, lets look at the remaining three boxes.

Fields dragged and dropped into the Values area provide the main data for your PivotTable. The fields you drag to this area will normally have some numerical value associated with them, like units sold, profit, or expenses. This is the kind of data that can be measured (often monetary) and totaled to reveal trends or indicate relationships between the non-numeric data.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

128

In the preceding image, the Values box contains the Sales field. Because Fields in the Values box will be subtotaled, the words Sum of have been tacked on so it reads Sum of Sales. In this case, the data values associated with the Sales field will appear in the main part of the PivotTable with totals automatically calculated:

Essentially, this PivotTable shows us the sales for each salesman, broken down across regions. Now suppose we wanted to see the sales for each region, broken down across Salesman. To do this, we would simply switch the positions of the Salesman and Region fields in the Field List boxes by dragging and dropping:

Now the Region field is in the Row Labels area and the Salesman field is in the Column Labels area. Here is what the PivotTable looks like:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

129

The data has just been pivoted in a basic way. Compare the table above to the following image of how the table used to look.

We have just seen two different views of the same data using only one table, thanks to the magic of PivotTables. The preceding table displays the Sales for each Salesman broken down across Region. When you are pivoting data and planning what view you want, it can be useful to think of things in terms of that description. For example, think of your PivotTable as showing numerical data for each identifier or organizational heading across another identifier or organizational heading. Even better, think of it as field or fields in the Values box for each field or fields in the Row Label Box, broken down across field or fields in the Column Label box. Thinking of things in those terms will help you understand how to pivot your data to get the view you are looking for.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

130

Lets look at a final example, based on the following Field List:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

131

Suppose you wanted to look at the profit for each product type broken down across salesmen. Lets start with the profit. To begin, we will drag the Profit Field to the Values box, since the profit data consists of numerical values and will make up the main part of the table:

Next, we want to look at the profit for each product type, so we will drag the Product field to the Row Labels box:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

132

Since we want to see the profit for each product type broken down by salesman, next we will drag the Salesman field to the Column Labels box:

Here is the resulting table:

Now we can see with a glance the total profit generated by product type 4 (1255), the total profit from salesman B. Doe (1495), and the two salesmen who sold both Type 2 and Type 4 products (J. Adams and M. Parker).

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

133

Would this information be as obvious if we look at the original data that the table is based on?

Clearly, knowing how to use PivotTables can be helpful when it is time to analyze your data.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

134

Lesson 2.2: Working with PivotTable Data


Now that you know how to create a PivotTable and how to pivot data, it is time to learn about some of the other options that Excel provides for manipulating your PivotTable data. In the following pages you will learn about filtering, sorting, grouping, and refreshing your PivotTable data. We will also explore how to expand and collapse data, and how to edit a data source.

Expanding and Collapsing Data


Have a close look at the following PivotTable.

You can see that there are multiple rows that show data for different months, different salespeople, and different product types. There are also profit figures in the column on the far right, as well as profit subtotals (in bold in the Sum of Profit column). This view of the table lets you see a lot of data, but it can be a little bit confusing, especially if you are new to PivotTables. Furthermore, part of the function of PivotTables is to summarize data, and make it easier to see what is going on.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

135

To help make the table more succinct and easier to interpret, we can use the expand and collapse buttons.

When you see a button in your table with a minus (-) sign, it means that the field associated with that button is fully expanded. This button is commonly called a collapse button, because when you click it the expanded data will collapse. In the previous example, all fields in the table are expanded. To simplify the presentation of the table and summarize the data, we can click on the collapse buttons of our choice. In the following image, we can see the profit generated by each salesman broken down by product type.

Perhaps this is a little too much information. For a clearer view, we can click the buttons next to the names of each salesman. We will lose the details about what product types were sold to generate what profits, but the resulting table becomes less cluttered:

We now have a succinct view of the profit for each salesman, as well as the total profits for Month 1. To show the hidden data, simply click the expansion button (+ sign).

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

136

Here is what the table looks like if we expand the data for salesman A. Smith:

Now you can see the product type data for only A Smith, as well as a subtotal for A Smith. Note that there are also collapse and expand tools on the PivotTable Tools Options tab:

To use these tools, just select a field in your PivotTable that has multiple rows of data associated with it, and click the Expand (+) or Collapse (-) button as required. By expanding and collapsing your PivotTable data intelligently, you can create a view of the table data that best suits your needs.

Filtering Data
Even after you create your PivotTable and then pivot the data the way you want, you may still find that the information isnt summarized just the way you need it to be. If you end up in this situation, the Excel filtering tools may be able to help you find exactly what you are looking for. Like other Excel tables, a PivotTable can contain AutoFilters. In the following PivotTable, for example, you will see an AutoFilter arrow next to the Row Labels column heading.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

137

Click the pull-down arrow to display a list of filtering commands:

The available filtering commands are shown in the red box. The list of checkmarks represents each of the unique identifiers for the table rows; names of salesmen in this case. There is also a checkbox that allows you to select or deselect all items. To filter out the data for a given salesman, just clear the corresponding checkbox:

In the example below, B. Doe has been filtered out.

Take note that when a row is filtered from the table, the grand total is adjusted accordingly. The appearance of the pull-down arrow button will also change when a filter has been applied.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

138

The button now has a funnel icon indicating that a filter has been applied. If you click the pulldown button after a filter is applied, you will see that the Clear Filter option has become available:

Clicking this option will remove the filter and the corresponding data will once again appear in the table. You can also manually re-check items to show the corresponding data. There are two additional options below the Clear Filter option: Label Filters and Value Filters. Clicking on either of these options will provide you with another menu that enables the creation of filters with user specified criteria. Here is what the Label Filters menu looks like:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

139

If you choose an option from the Label Filters menu, a dialog box will appear that prompts you to enter the criteria for your filter:

In this instance, combining the letter M for the begins with filter will filter out all rows that do not have a label (salesmans name) that begins with M. Note that you can click the pull-down arrow to see a drop list with more criteria options:

When you click OK, the filter will be applied.

The Value Filter works in much the same way as the Label Filters, except that they will filter based on criteria that you apply to the numerical data in your table:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

140

The criteria in this dialog should filter all table entries where the Sum of Sales value is greater than 650. Here is the PivotTable before and after the filter has been applied: Before After

A PivotTable can contain hundreds or even thousands of rows of data. If you want to filter everything out except for a particular set of data that you specify, use the search box at the bottom of the AutoFilter menu:

Searching for a particular row label will filter out all of the data associated with the labels that do not match, essentially finding the label that you are searching for.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

141

Finally, it is common to have a PivotTable in which there are multiple fields as row labels. For example, take the following PivotTable where the filtering options under the pull-down arrow are associated with the salesmens names rather than the product type:

What would you do if you wanted your filters to be based on product type instead of salesmen? In a PivotTable, the filter options will be associated with the row labels that are in bold font (the names of salesmen in this case). To change this, just rearrange the fields in the Row Labels box in the PivotTable Field List:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

142

Because Salesman is above Product in the Row Labels box, the salesmens names are in bold. Drag the product field up so it is in top position in the box, and the table will display product type labels in bold font:

Now the filter options under the pull-down arrow will apply to product type:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

143

You can also choose which row label to filter on by using the Select Field command in the AutoFilter menu:

This option will only be available if there is more than one row label available in the PivotTable.

Sorting Data
If you know how to filter data in PivotTables, sorting data is just as easy. If you click the same pull-down arrow that you used for filtering, you will see a few sorting options on the menu as well:

Choosing the Sort A to Z option will sort the table rows in ascending order. Choosing Sort Z to A will sort the table rows in descending order. If there are multiple row fields in the table, specify which field to sort by using the Select Field drop list.

If you want to sort your table on something other than just the row labels, choose More Sort Options from the menu.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

144

When you choose this option, a Sort dialog will appear.

Once again, options to sort in ascending or descending order are available with radio buttons. In addition, once you select a radio button, you can click the corresponding pull-down arrow to choose a field:

These additional options allow sorting on the numerical data in the Pivot Table. The options shown here will sort the data associated with the Salesman labels in ascending order based on the sales values.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

145

Here is the resulting table.

Notice that when you have applied a sort option to the table, the pull-down button will display a tiny arrow: . An upward arrow indicates an ascending sort, while a downward arrow indicates a descending sort. There is also a button on the bottom of the Sort dialog labeled More Options. If you choose this button, another dialog will appear with an AutoSort option. If this option is selected, the data will be sorted automatically every time the PivotTable is updated:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

146

There are also sort options available on the PivotTable Tools Options tab:

To sort data based on a specific row label in ascending order, click on data in that row label, and then click the sort ascending (A to Z) button. For example, if we click on the name of a salesman in the table, and then click on the sort ascending button (smallest to largest):

The table will then look like this:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

147

There is one more sort tool available in the Sort and Filter group of the Options tab:

Choosing this button will display another dialog with more options for sorting:

This dialog lets you specify a smallest to largest sort, or largest to smallest. It also lets you specify direction the data will be sorted in (top to bottom or left to right).

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

148

Note that the dialog is called Sort by Value. This is because a numerical value was selected in the PivotTable before invoking the dialog. If we first select a row label like salesman or product, the dialog will look a bit different:

Grouping Data
When you are working with PivotTables, there are also grouping tools available on the Options tab:

These tools are very similar to the grouping tools discussed in Lesson 1.1. To use them, first select a range of data that you want to group or ungroup, and then click the appropriate button. For example, here is a PivotTable that is somewhat awkward due to its length.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

149

To make the table more manageable, select the range of cells that contain the region labels and then click Options Group Selection:

As a result, the data will be grouped by region in the PivotTable and there will be a Group 1 option with a corresponding (-) collapse button available above the row of region labels.

To collapse the group, just click the collapse button and the PivotTable will look like this:

The region labels are now hidden, and the sales and profit data have been subtotaled and summarized. Now the important data can be seen at a glance.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

150

If you want to see all of the detail of the table again, just click the expand button (+). If you want to remove the grouping, click on the Group1 label to select it and then choose Options Ungroup:

The grouping will be removed and the PivotTable will appear as it did originally.

Refreshing Data
PivotTables are always based on some underlying source data. That data may be in another workbook, another worksheet, or perhaps a totally different location like an external database. The point is that the data that your PivotTable is based on can be easily changed by anyone who has access to the spreadsheet. By using the Refresh command, you can make sure your PivotTable changes accordingly when the source data has been altered. Here is a sample table of source data.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

151

Here is a PivotTable based on this data:

Now suppose that we remove the information for Month 3 in the source table:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

152

At this point, the PivotTable will still display the Month 3 data exactly as it did before. To update the table, click Options Refresh:

After performing this action, the PivotTable will reflect the changes in the source data:

This technique also works if you change the values in the source data. Study the PivotTable above for a moment, and then note the following changes to the source data.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

153

At first, the PivotTable will not reflect the changes, but after you click the Refresh button, the PivotTable will update:

The resulting table changes look like this:

Another way to refresh is to right-click the PivotTable and click Refresh:

This will also refresh the PivotTable to accommodate changes to the data source.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

154

Editing the Data Source


It might also be the case that the actual underlying cell range of the source data has been expanded:

In this kind of situation, you should update your PivotTable by choosing Options Change Data Source:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

155

Performing this action will display the source data, with a dashed line indicating the range of cells that are currently included in the PivotTable. There will also be a dialog that will allow you to select a new cell range:

Now, re-select the entire range of data with your mouse, and check to make sure that it is correctly entered into the dialog:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

156

As soon as you have successfully selected the new range, click OK. The PivotTable will be automatically updated to accommodate the new range and additional data:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

157

Lesson 2.3: Formatting a PivotTable


Up to this point the focus has been on practical PivotTable skills so that the table provides what you need in an analytical sense. Now that you understand something of the function and applicability of PivotTables, it is time to spend some time on presentation and modification so you can turn your PivotTable into a professional-looking report. In this lesson you will learn how modify your tables fields, values, and labels. You will learn how to apply layouts and styles to a PivotTable. You will also learn how to manually format a PivotTable, and use the PivotTable Options dialog.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

158

Modifying Fields and Labels


There are a few ways to modify the layout of the labels and fields in your PivotTable. To start, select a field in your PivotTable (the Month field in this example):

Next, click Options Field Settings:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

159

Then you will see the Field Settings dialog:

Under the Subtotals and Filters tab, you will find options for Automatic Subtotals (the default setting), None (no subtotals), and Custom (where you can choose how the subtotal will be calculated). Custom options include Sum (the default), Count, Average, Max and Min, and several others. It is important to understand that these subtotal functions are intended for use with fields representing numerical data values, like a profit or sales field. Since we are using the Month field in this example, which is descriptive rather than numerical, these subtotals are not really applicable.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

160

Instead, the options on the Layout and Print tab are best suited for the Month field:

These options allow you to change the layout of a field and its accompanying labels. To start, lets look at the two radio buttons on this tab.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

161

First, here is a sample PivotTable. Notice how the row labels (from the Month and Product fields) are arranged in one column.

If the Display labels from the next field in the same column checkbox is cleared, the layout of the labels in the table will look like this:

Notice how Month and Product are now separated. Suppose now that the second radio button had been selected instead.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

162

The options for the first radio button are no longer accessible, and the change in layout of the table is almost the same as before, with the small difference that the second fields labels (the product types) line up in the same row as the first fields labels:

If you put a checkmark in the Repeat item labels box:

The label for the selected field (Months) will be repeated for every row with corresponding data:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

163

If you specify Insert blank line after each item label:

A blank line will be included after the total tow for each different label:

If you place a checkmark next to Show items with no data:

The labels will be displayed in the table even if there is no source data for them, as long as the PivotTables range includes the empty data rows.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

164

For example, here is the source data for a table:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

165

You should notice that the range that the PivotTable is based on contains empty rows. Even so, the labels for the empty rows are included in the PivotTable.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

166

Modifying Values
We just talked about modifying the layout of descriptive fields and their associated labels. For value fields with numeric data, the process is almost the same. First, select a value in your PivotTable:

Then, click Options Field Settings:

This time, the Value Field Settings dialog box will look slightly different:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

167

On the first tab, you will see options for creating totals and subtotals for the selected field. The default function is Sum, but you can click a function type in the list to select it and apply the new calculations to the values associated with the selected field. For example, if we click Average and then click OK:

The PivotTable data will now reflect averages for the Profit values instead of summed totals:

The Show Values As tab in the Field Settings dialog will give you another set of options for modifying the numerical data in your PivotTable:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

168

To see these options, click the pull-down arrow on the right to see the drop list:

In the image above, % of Grand Total has been selected. This means that the values for Profit will be expressed as percentages of the total profit. Clicking OK will implement the changes in the PivotTable.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

169

This is just one of several ways you can choose to display the numerical data for the Profit field. For another, lets assume that you want to show the profit values as a percentage of the total profits for the East region. To do this, you would choose the % Of option from the Show values as menu:

Next, choose the Base Field (Region in this case) and the Base Item (the East label) from the lists provided in the dialog:

After these selections are made, clicking OK will implement them in the table. In this case, the profit values will be represented as percentages of the profit for the eastern region.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

170

As a final note, whenever the Field Settings dialog box is displayed for a numerical type of field, you will see a Number Format button at the bottom:

If you click this button, a Format Cells dialog will appear with a list of number format options that that can be applied to the numerical data in the PivotTable. When you select an option in the list, additional controls will appear in the dialog to help configure the details of the chosen format. These additional options will vary according to the type of number format you select. In the following example, the Accounting format is selected, so options appear for setting the number of decimal places and the appropriate monetary symbol.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

171

After you set up the format, click OK in the Format Cells dialog and then in the Field Settings dialog. The new format will be applied to the values in your PivotTable:

Finally, you can easily change what a PivotTable label says by selecting the cell that contains the label and then editing the label in the formula bar. This simple method applies to both row and column labels:

Using the Layout Group on the Design Tab


The Layout group of options on the PivotTable Tools Design tab provides a quick and easy way to change the layout of your labels and values in much the same way as using the Field Settings dialog. The Layout Group is found on the far left of the Design tab:

Each button in the Layout Group will open a menu of options when clicked. These options can change the layout of your labels and values much like the options in the Field Settings dialog. The Field Settings dialog provides more options, and may allow for a bit more fine tuning (such as different number formats for numeric data, but the options in the Layout group are easier to access and can be quickly implemented.
2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

172

For example, have a look at the following PivotTable:

There are grand totals for both rows and columns and subtotals at the top of each Month group. The month labels and the product type labels are both in the same column, and there are no blank rows in the table. All of the layout elements just listed can be modified with the Layout group.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

173

If you click the Subtotals command, you will see a menu containing three options:

If you click the Do Not Show Subtotals option, all totals except the grand totals will be removed from the PivotTable:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

174

If you choose the Show all Subtotals at Bottom of Group option, the PivotTable will display subtotals at the bottom of each grouping.

Similarly, if you click Show all Subtotals at Top of Group, the table will display the subtotals at the top of each grouping.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

175

The next button is the Grand Totals button. If you click this button, a menu of options for displaying Grand Totals will appear.

The options here are fairly self-explanatory. You can choose: Off for Rows and Columns: Display no grand totals On for Rows and Columns: Display grand totals for both rows and columns On for Rows Only: Display grand totals for rows but not for columns On for Columns Only: Display grand totals for columns but not for rows The next button in the Layout group is the Report Layout button:

The options available here are once again very similar to the options available from the Field Settings dialog.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

176

The Show in Compact Form option will show all of the column labels in a single column, while the Show in Outline Form option will show the labels for the second field in the column immediately to the right of the labels for the first field. The Show in Tabular Form option will arrange the PivotTable layout to look almost the same as Outline Form, except the labels for the second field will start on the same row as the label for the first field. The Repeat All Item Labels option will display every instance of a label (much like what appears in the source data). The Do Not Repeat Item Labels option will remove these redundant labels. The final layout menu is Blank Rows:

This button provides two options: to insert blank rows after every field grouping or to remove the same blank rows.

Applying a Style to a PivotTable


Excel provides a variety of preset styles to choose from to make formatting your PivotTable easy. Each style includes a combination of borders, shading, font, and color formatting. The PivotTable Styles are available on the PivotTable Tools Design tab:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

177

On the Design tab, you will see thumbnails of the styles in the PivotTable Styles group. You can see what your table might look like with a given style applied to it by letting your mouse pointer hover over any thumbnail:

When you find a style that you like, just click on the thumbnail to apply it to your PivotTable. If you right-click on a thumbnail, you will see this menu:

Of primary concern to us at this point are the first two options. If you click Apply and Clear Formatting the style will be applied to the PivotTable, but previously applied formatting (like fonts for labels or data values) will be cleared. If you click Apply and Maintain Formatting, the formatting of some previous elements (like bold or italic fonts on data values and labels) will remain when the style is applied.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

178

To see a wider range of styles to choose from, you can use the arrow buttons at the right side of the style preview menu:

The up and down arrows will scroll groups of style thumbnails into view. The More button ( ) will show you the full gallery:

As before, you can let your mouse pointer hover over a thumbnail and a preview of the selected style will be applied to your table. Click any thumbnail to make the application permanent.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

179

Changing PivotTable Style Options


Lets look at the PivotTable Style Options group next:

This group is made up of four checkboxes: Row Headers Column Headers Banded Rows Banded Columns Checking an option will change the formatting of that component to make it stand out from the rest of the table. Banded Rows/Banded Columns will apply borders and/or shading (depending on the current tables style) to every second row in your PivotTable; a helpful feature if you have a lot of data. The actual application of these formatting options can differ between styles, but here is an example of banded rows:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

180

Manually Formatting a PivotTable


If you cannot find a preset style that you like, you can always manually format your PivotTable. One way to do this is to select individual cells or ranges of cells and apply fonts, font color, borders, and fill color with the formatting options on the Home tab:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

181

You can also select individual cells or ranges of cells and apply a preset cell style by choosing Home Cell Styles, and then clicking the cell style of your choice:

Similarly, you can select a cell or a range of cells in your PivotTable, and choose Home Format to see basic formatting options:

Here you can hide or unhide selected rows or columns, change the width or height of selected columns or rows, or lock a selected range of cells.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

182

Using the PivotTable Options Dialog


To open the PivotTable Options dialog, click Options Options:

This dialog provides multiple tabs, each containing options related to the tabs heading. First, the Layout and Format tab provides options for changing the presentation of your table elements and the format of its values and cells:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

183

The Totals and Filters tab provides tools for displaying grand totals and for enabling and modifying filtering and sort options:

The Display tab provides options to display or hide certain table elements and to make changes to the layout of the table:

The Printing tab provides options for changing the print layout of the table:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

184

The Data tab provides options for specifying how certain aspects of PivotTable data are handled:

For example, you could mark the appropriate check box to make sure that the source data is saved with the file (which could be useful for an external data source), or that the data in the table be refreshed each time the workbook is opened. As with most other dialogs, once you have made your option choices, you can click OK in the lower right to commit to them, or you can click Cancel to close the dialog without implementing your choices.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

185

Lesson 2.4: Using the Classic PivotTable Layout


At this point we have covered quite a lot of ground on the subject of Excel PivotTables. Creating a table, formatting it, and pivoting the data should pose little difficulty now, but there is always something new to learn! In this lesson, well learn about the older-style Pivot Table, called the classic layout.

Creating an Empty (Classic) PivotTable Frame


Some Excel users like to work with a classic PivotTable layout (also called a classic PivotTable frame) because the classic layout allows you to build a PivotTable intuitively, by dragging and dropping fields right onto the table area. Of course, even with a classic layout, you can always use the usual methods for adding data to the table if you want to. A classic PivotTable frame begins with the creation of a standard PivotTable. (See Lesson 2.1 if you need a refresher.)

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

186

Once you have a standard PivotTable, the next step is to display the PivotTable Options dialog. You can do this by right-clicking in the standard PivotTable area and choosing PivotTable Options:

Alternatively, you can click in the PivotTable area and then choose PivotTable Tools Options Options:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

187

When the PivotTable Options dialog appears, click the Display tab. Place a checkmark next to the Classic PivotTable layout option and then click OK.

At this point you should see a classic PivotTable frame in your worksheet:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

188

Switching an Existing PivotTable to a Classic Layout


If you have already created a PivotTable it is easy to convert it to a classic layout, even if it contains data.

Simply follow the steps we just discussed. First, display the PivotTable Options dialog by either right-clicking in the table and clicking PivotTable Options, or by clicking PivotTable Tools Options Options.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

189

When the PivotTable Options dialog appears, click the Display tab and then click to select the checkbox for the Classic PivotTable layout option:

Now, click OK in the dialog to apply the classic layout:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

190

Adding Data
With a classic layout, it is easy to add data to the PivotTable. If you wish, you can add data in the same way that you would with a standard PivotTable: place checkmarks in the Field List to select the fields that you want to add to the PivotTable.

For more control on how the table is arranged, you can drop and drag fields from the top part of the Field List to the Report Filter, Column, Row, and Value Area boxes at the bottom of the Field List:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

191

Here is what the resulting PivotTable would look like:

Or, you can simply drag fields directly from the Field List and drop them in the PivotTable frame:

Just make sure that you drag and drop the fields into the areas in the table frame labeled, Drop (field type) Fields Here:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

192

You can just as easily remove the data from a classic layout table by dragging and dropping the field name from the PivotTable back to the Field List, or to basically any place outside of the PivotTable borders:

You can also remove data by deselecting fields in the Field List, or by dragging the fields out of the area boxes at the bottom of the Field List (just as you would with a standard PivotTable).

Pivoting Data
If you recall, pivoting data is the technique of rearranging the structure of your PivotTable to explore various relationships between your data fields. In a classic PivotTable layout, you can pivot data by dragging and dropping fields directly to and from the table area. To make the best use of your classic layout PivotTable, you should understand what the various areas in a PivotTable are for. You can see by examining an empty classic PivotTable frame that the table is broken into four main areas: Report Filter Fields Column Fields Row Fields Value Fields

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

193

These regions of the PivotTable correspond to the table area boxes at the bottom of the PivotTable Field List:

The Report Filter area allows you to filter based on the labels that are associated with the field you drop here. It is ideally suited to fields that are used to identify periodic or organizational groupings of the data in your other columns. For example, if we put the Salesmen field in this region, we will be able to filter all the table data based on the labels (salesmens names in this case) associated with that field:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

194

The Row Field and Column Field areas of the table are used to further categorize the data that you want to examine. When you place fields in the row and column field areas of the table, you will see how these fields relate to each other in the context of the data in the Value Fields area. For example, in the following table, we have dragged the Region field to the Row Field area of the table and the Product Field to the Column Field area of the table:

Now, when we drag a field to the Value Field area of the table, we will see the values for that field subtotaled and listed for each region, and across every product type. The Value Field area provides the underlying context for the rest of the PivotTable. The field(s) that you choose for the Value Field area of the table normally have numeric values associated with them, like units sold, profit, or expenses. This is the data that will be measured and totaled to reveal trends or indicate possible relationships between the non-numeric data. To continue with the previous example, suppose we drag the Sales field to the Value Fields area:

Now we see the units sold for each region, broken down across product types.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

195

To remove fields (and the associated data) from the table, clear the corresponding check boxes in the Field List. Clearing all of the checkboxes will leave an empty classic PivotTable frame.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

196

Lesson 2.5: Advanced PivotTable Tasks


If you can create a PivotTable, format it the way you want, and pivot the table data intelligently, then you have the skills to take your data analysis and report presentation to the next level. None the less, PivotTables are such a valuable tool that examination of a few more advanced topics is well worth the effort. In this lesson, we will explore how to create a PivotTable based on external data and how to use two new tools: PowerPivot and Slicers.

Creating a PivotTable Based on External Data


PivotTables are only as good as the source data that they are based on. In most cases your PivotTables will be based on data in the same workbook, but it is not unusual for a situation to arise where you must base your PivotTable on data from an external source. The most direct way to create a PivotTable from external data is to select the Use an external data source radio button in the Create PivotTable dialog:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

197

If this radio button is selected, the Choose Connection option becomes available. If y ou click this button, you will be able to select a data source from a list of existing connections (if there are any available) via the Existing Connections dialog:

In this dialog, simply click an item in the list to select it, and then click the Open button. (It goes without saying that you should choose a connection that leads to underlying data suitable for a PivotTable.) If you cannot find a connection that is suitable, click the Browse for More button. Then, a standard navigation dialog will appear so that you can navigate to an external data source of your choice:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

198

Select the data source in the navigation dialog and then click Open. Now the Existing Connections dialog will close leaving the Create PivotTable dialog. In the dialog, you will now see a Connection name indicating your selection.

Now it is just a matter of selecting the location for the PivotTable and clicking OK. If the connection is valid and is suitable for a PivotTable, you should see an empty PivotTable frame and Field List appear in the location that you specified in the dialog:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

199

Now it is just a matter of dragging and dropping fields from the list to the row, column, and value areas at the bottom to build the table. Another way to create a PivotTable from external data is to choose Data Existing Connections:

Next, select an appropriate data source from the dialog box that appears and click Open:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

200

Then you will see the Import Data dialog:

With the options in this dialog, you can specify a table, a PivotTable Report (this is what you should select to create a PivotTable), or a PivotChart and PivotTable report. You can also specify a new or existing worksheet for your PivotTable. Once you are finished making your selections, click OK to create your PivotTable frame and PivotTable Field List from the external data source. If you do not have any existing connections, you can create a new one, just as long as you have access to an external data source. To do this, choose Data From Other Sources:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

201

In the resulting menu, you can create a connection to an SQL server, an Analysis Services cube, an XML file, or a Microsoft Query:

You may have to seek advice from your IT personnel or network administrator with regard to what type of data source is appropriate. Once you have created a connection to an external data source, you can create your PivotTable by following the same procedures as described previously for an existing connection. It is also possible to create a connection to external data in an Access database by choosing Data From Access:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

202

When you click this button, a Select Data Source dialog box will appear, allowing you to navigate to a Microsoft Access database on your computer or on a network drive:

When you find and select a database, click the Open button in the lower right of the Select Data Source dialog. You will see the now familiar Import Data dialog:

Once again, you can use the options in the Import Data dialog to specify the type and location of the table you want to build from the imported data. Remember, for a PivotTable choose PivotTable Report.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

203

Here is an example Access database table containing source data:

The following image shows the resulting PivotTable frame and Field List in Excel:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

204

It may be the case that a regular Excel table that is based on data from an external source exists in your workbook.

If this is the case, you can just select the range in the table and choose Insert PivotTable to create a PivotTable based on that data. The Create PivotTable dialog will appear and you can proceed to create your table as you normally would, just as if the source data originated in current Excel workbook.

You should note that in this case, even though the underlying data is from an external source, the range that the PivotTable is based on already exists in the workbook. There is no need to choose the Use external data source radio button.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

205

Refreshing External Data


Once you build a PivotTable using external data, you can refresh the table by clicking Data Refresh.

At this point, you may see a security notice:

This notice is reminding you that using external data can be dangerous and that you should know and trust the source. If you do know that the data source can be trusted, click OK and the data will be refreshed. You can also refresh the PivotTable by right-clicking a cell in the table and clicking Refresh:

Dont forget the Refresh button on the PivotTable Tools Options tab! Using any of these refresh options will update the PivotTable with changes made to the data in the underlying external source. Of course, if the PivotTable is based on external data it is a good idea to refresh it periodically to make sure your data remains current.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

206

Creating a Slicer
Slicers are a new tool in Excel 2010, and they can be a great help when working with PivotTable data. The main purpose of PivotTables is to help you analyze information and find patterns or trends that might be difficult to spot in a large volume of raw data. The Slicer tools take this idea to the next level! To create a Slicer, first click anywhere in the PivotTable to display the PivotTable Tools tabs. Next, choose Options Insert Slicer:

Now you will see the Insert Slicers dialog with all of the fields from your PivotTable. Place checkmarks to select the fields that you want to use as slicers and click OK:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

207

When the Slicers first appear, they will be stacked as shown below:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

208

The Slicers will be easier to use if you can see each one distinctly. To do this, click and drag its title area. Once you have the Slicers arranged so you can clearly see all of the field labels that they contain, you can start using them. For an example, have a good look at the following image showing the Salesman, Region, and Product Slicers.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

209

Now, to see what is going on with a particular field, just click on that Slicer. For example to see what is happening with salesman A Smith, just click on A Smith in the Salesman Slicer:

When you click on a label, you will see that some labels in the Slicers will have their original shading, while others will be shaded differently than they were before:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

210

The items that have their original shading (East, North, and Northeast regions, and Type 1, Type 3, and Type 5 products) are items that are associated with A. Smith. This means that A Smith sold products only in the East, North, and Northeast regions, and only sold product types 1, 3, and 5. Moreover, the PivotTable itself has changed after clicking salesman A. Smith and shows only the data for A. Smith, with respect to the East, North, and Northeast region. This corresponds to the selections made with the Slicers.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

211

Compare this to the PivotTable before the Slicers were used:

As you can see, Slicers are a great way to cut through volumes of data and find specific details with respect to a selected element. To clear the Slicers, click on the filter symbol in the upper right of the Slicer box that you originally clicked:

Now both the Slicers and the corresponding PivotTable will return to their original form.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

212

If you want, you can select more than one field label from a given Slicer. To do this, click to select the first one, and then hold the Ctrl key as you click more labels. Suppose we wanted to know what was going on in the East and North regions. First we would click East and then we would hold Ctrl and click North in the same Slicer. Here are the results:

Now we see the active salesmen and the products sold across both regions. The following image shows the resulting PivotTable:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

213

Using the Slicer Tools Tab


To see the Slicer Tools tab, click in a blank area of a Slicer:

On the far left of the tab, you will see a Slicer Settings button. If you click this button, a Slicer Settings dialog will appear:

Here you can change the name of the Slicer or the caption that is displayed in the Slicer header. You can also choose how the items (labels) in the Slicer are sorted, and you can specify how items with no data or items that have been deleted from the data source are displayed. To commit to the settings you choose, click OK in the dialog. The next button on the Slicer Tools tab is PivotTable Connections:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

214

When you click this button, a PivotTable Connections dialog will open, where you can specify what PivotTable your Slicer is associated with. (This is useful if you have more than one PivotTable in the workbook.)

In this dialog, place a checkmark next to the PivotTable(s) that you want to change in response to the choices you make with your Slicer. To disassociate the Slicer from a given table, clear the checkmark for the appropriate item. When you have made your selections, click OK to implement them. The next section on the options tab is the Slicer Styles gallery:

This gallery works just like the PivotTable Styles gallery. To apply a style to a Slicer, just click on a thumbnail in the preview menu. The corresponding style will be applied to the active Slicer.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

215

It is a good idea to apply styles to your Slicers (especially if you have several) to help differentiate between them. Sometimes, if you are using several Slicers, there will not be enough room on your screen to arrange them all without any overlaps. Heres an example:

The Arrange group is for dealing with stacked Slicers. To move a Slicer in the stack, click to select it and then choose the appropriate button from the Arrange group. For example, based on the image above, if we wanted to move the orange Slicer to the top, we would click on it to select it and then choose Bring Forward:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

216

The following image shows the result:

If you click the Selection Pane command:

A pane that lists all of your Slicers will appear on the right of the screen:

This pane can help you find a Slicer that you need in a cluttered screen. To make a given Slicer active, just click it in the list. If you click on the eye icon next to a Slicer name, that Slicer will be hidden.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

217

To see it again, just click the box:

The final two groups (Buttons and Size) can be used to alter the size the Slicer buttons and the size of the Slicer box itself:

You can alter the settings for any of these size attributes by clicking the small arrows provided in the text boxes to change the settings in small increments. Alternatively, you can enter a value directly into a text box to change the corresponding size attribute.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

218

Lesson 2.6: Using PowerPivot


PowerPivot is an Excel add-on that is available for free for Excel 2010. You may remember our discussion of Excel add-ins from Lesson 1.3. The PowerPivot add-on can be thought of in the same way: it is additional software that is not installed with Excel, but instead is added on later if required. Once installed, this additional software extends the functionality of Excel even more. PowerPivot has special compression and processing algorithms that allow you to work efficiently with immense amounts of data. PowerPivot also facilitates the integration of data from multiple sources, and has been designed with extra features and flexibility for environments that rely on Microsoft SharePoint and or Microsoft SQL servers.

System Requirements
To get started with PowerPivot, you must first download and install it. For PowerPivot to work properly, your system must meet a few minimum requirements. These are: Windows XP with Service Pack 3, Windows Vista with Service Pack 2, Windows 7, or Windows Server 2008 or higher .NET Framework 3.5 SP1 may be required if you are not running Windows 7 Excel 2010 3.5 gigabytes of free hard disk space 1 gigabyte of RAM (2 gigabytes or more is recommended) 500 MHz processor or higher

Downloading and Installing PowerPivot


Once you have determined that your system is capable, download the PowerPivot add-on from Microsoft (http://www.microsoft.com/downloads). Search for powerpivot at the top of the page. Remember to download the version (32 or 64 bit) that corresponds to your installation of Office 2010.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

219

Here is what the PowerPivot download site looked like at the time of publication:

We simply clicked the first Download button to save the file to our computer. Once the PowerPivot file has finished downloading, check that the Publisher is Microsoft Corporation and run the file.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

220

Now, follow the installation directions to install PowerPivot:

When you start Excel for the first time after this installation, you may see a dialog asking you if you want to install PowerPivot in Excel:

Click Install to complete the PowerPivot installation.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

221

Importing Access Data


When PowerPivot is fully installed in Excel you will see a PowerPivot tab:

To get a feel for what PowerPivot can do, lets have a look at an example. First, look at the following Access database table:

Here we have a simple list of the salesmen that work for a company. The data includes an ID number, the balance for each salesmans expense account, and the miles that they traveled to sell the companys products. Now, have a look at the following Excel worksheet:

Here we have a table listing the salesmen for the company with accompanying data about the regions they work in, the products they sell, the sales (in units), the customers they sold to, and the profit they generated.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

222

Ideally, it would be nice to integrate all of this data in some way. This kind of data integration can be performed with relative ease by using PowerPivot. To analyze the data from these different sources, we will open Excel 2010 and click PowerPivot PowerPivot Window:

The PowerPivot window will now open. Well click From Database From Access on the Home tab to obtain the data from the external database:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

223

In the Table Import Wizard that appears, we will click the Browse button to choose the database that we want. Then, it will be reflected in the wizard:

If a username and password are required to access the database they can be entered at this point. Once everything is ready, well click the Next button at the bottom of the Table Import Wizard to proceed.

Next we must choose how to import the data:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

224

Since this database is very basic, the simplest route is to choose the first radio button, so we can select our data from a list of tables in the database. When we click the Next button in the wizard, a list of the available database tables is displayed. Since there is only one table in this database, our choice is simple.

We will make sure there is a checkmark next to the Sales Accounts table and then click the Finish button at the bottom of the wizard.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

225

When we see that the data has been successfully imported, we can close the Table Import Wizard:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

226

When the wizard closes, the imported data will be visible in the PowerPivot window.

Importing Excel Data


Next, we will click the small can icon to find data from our Excel workbook:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

227

This action will display the Table Import Wizard again, but this time, a scrolling list of other potential data source types will be available. To get the data from our Excel workbook, we will scroll down until we see the Excel File option. Well click it to select it and then click Next:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

228

As before, we can browse to the file we need and choose it as our data source.

We will now make sure that the path to the file is correct and we will select the Use first row as column headers option. (This will ensure that our imported data will have column labels.) Once we are ready, we will click the Next button at the bottom of the wizard. Now we will choose which worksheet to import from (Sheet1 has our data):

To continue, well click the Finish button at the bottom of the wizard.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

229

When we see the success message and the number of rows transferred, we can click the Close button to close the wizard.

When the wizard closes, the imported data will be visible in the PowerPivot window:

Remember, we already imported data from an Access database into PowerPivot. You can get to this data you want to see by choosing the appropriate tab at the bottom of the PowerPivot window, just like you would with Excel worksheets.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

230

Integrating Data with Relationships


Now that we have data from two separate external sources, the next step is to integrate the sources in PowerPivot. To do this, we should create a relationship between the two data sources. If we look at the data for imported from the Excel workbook (Sheet1) on the tab, we see that there is a Salesman ID column.

This ID number uniquely identifies each salesman. Similarly, if we click on the tab at the bottom of the PowerPivot window to see the data imported from the Access database (Sales Accounts), we again see a Salesman ID column:

Since the Salesman ID fields in each data source uniquely identify the same salesmen, this is the column (field) we should use to integrate our data. To do this, choose Design Create Relationship in the PowerPivot window:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

231

In the Create Relationships dialog, we will make sure that both data sources use the same column (Salesman ID) for the relationship. Then well click Create:

Creating a PivotTable with PowerPivot Data


Once the relationship between the data has been created, you can create a PivotTable. Simply click the PivotTable button at on the Home tab in the PowerPivot window:

You will see a Create PivotTable dialog:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

232

We will choose the New Worksheet radio button and click OK. This will place the PivotTable frame and Field List in a new worksheet in Excel. You will see two sets of fields: one for the external Access database data and one for the external Excel workbook data.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

233

Now we can drag and drop fields to build a PivotTable just as we did before. The amazing thing is that this PivotTable will combine and integrate data from two separate external data sources:

In the PivotTable above, we can see the Expense Account Balance from the Access database for each salesman, as well as the Sales and Profit values from the Excel workbook. This PivotTable can be modified using any of the tools we have already discussed. You can, just as before, easily pivot the data by dragging and dropping fields. Or, you can apply a style to the PivotTable with the PivotTable Tools Design tab. You can even use slicers to analyze the data. As an example, here is a formatted version of the table, with the salesmens mileage added.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

234

Here is the Field List for the above table:

As you can see, the table combines and integrates data from both sources. You can save this Excel workbook like any other, and when you open it again, all of the data will still be available. After opening the workbook, you can see the data simply by displaying the PowerPivot window again (PowerPivot PowerPivot Window):

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

235

If the data in the external sources has changed, you can refresh the data by choosing Home Refresh in the PowerPivot window:

You will then need to refresh the PivotTable as well (back in Excel).

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

236

Section 2: Review Questions


1. A. B. C. D.

To pivot data means To change data from a row orientation to a column orientation To change the justification of data in a selected range To move data using Paste Special To rearrange data fields in a table or chart in such a way as to change the perspective on relationships between the data Which of the following statements is true? A PivotTable is not different from a standard Excel table A PivotTable is also known as a flat table A PivotTable is like several tables rolled into one A good PivotTable must be based on an external data source Why is the order that you place checkmarks next to fields in a PivotTable Field List important? It affects the layout of the table It determines the order in which field labels will appear in the table Both of the above This is a trick question; the order does not matter How can you pivot data by dragging fields directly onto a table? Drag the fields from the boxes in the bottom of the Field List to the table First, clear all checkmarks from the Field List Create a Classic PivotTable frame This is not possible in Excel 2010 PowerPivot is a great tool to use if you want to. Get data from external sources Combine and integrate data from several different sources Import and organize immense amounts of data All of the above Which of the following statements is true? PowerPivot comes installed with Office 2010 PowerPivot can be purchased from the PowerPivot Web site PowerPivot is part of the Analysis ToolPak add-in group None of the above

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.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

237

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

A field in a PivotTable corresponds to a _______ in a regular table. Function Absolute reference Column heading Numeric data type In a PivotTable, labels can be described as. Instances of a particular field A name for the PivotTable A text representation of numerical data Any data that can be sub-totaled If non-numerical data is placed in the Values area of a PivotTable. The data will show up as zeros Excel will display a warning informing you that the data is illegal The data will be averaged The data will appear as counts

Can you create Slicers for a standard data table? A. Yes B. No C. Only for tables that have corresponding charts

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

238

Section 3: Charting Pivoted Data


In this section you will learn how to: Create a PivotChart from scratch or from an existing PivotTable Add data to a PivotChart Pivot chart data Use the PivotChart contextual tabs (Design, Layout, Format, and Analyze) Rename fields Change the chart type Apply a style to a chart Manually format chart elements Change the layout of chart elements Create a PivotChart based on external data Create a slicer for a PivotChart Create a scenario-based PivotTable and PivotChart Create a PivotChart with PowerPivot data

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

239

Lesson 3.1: Getting Started with PivotCharts


In the previous section, we looked at PivotTables at length and learned how PivotTables can enhance data analysis. Even though PivotTables are powerful and informative tools, they still display data in a two dimensional table format, consisting of rows and columns of descriptive text and numerical values. Just as standard Excel charts can provide a more graphical or visually intuitive view of regular tables of data, a PivotChart can provide a graphical representation of data in a PivotTable:

In this lesson you will learn how to create a PivotChart, add data to a PivotChart, and pivot charted data.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

240

Creating a PivotChart from Scratch


In Excel 2010, you can create a Pivot chart from scratch, or you can create a PivotChart based on an existing PivotTable. To create a PivotChart from scratch, choose Insert PivotTable PivotChart:

When the Create PivotTable with PivotChart dialog box appears, select the range of data for the chart with your mouse (or enter it manually into the Table/Range text box) and then choose the location (new worksheet or existing worksheet) for the chart.

(Notice that this is almost the same as the process used to create a PivotTable.) Once you are ready, click OK.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

241

At this point, you will see a PivotTable area, a Field List, and a PivotChart area:

Creating a PivotChart from Existing Data


To create a chart based on an existing PivotTable, simply click inside the PivotTable, and then click a chart type from the Charts group on the Insert tab:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

242

In this example, Column has been selected as a chart type. Next, we will click a type from the menu that appears:

The PivotChart will now appear in the same worksheet that contains the PivotTable that it is based on:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

243

Adding Data to your Chart


The methods for adding data to a PivotChart are a lot like the methods for adding data to a PivotTable. Lets start with an empty PivotChart (created from scratch):

To add data to the chart, we can simply place checkmarks to select the fields we want to include from the Field List:

Here we have selected the Month field, the Salesman field, and the Units Sold field, to add them to the PivotChart. It is important to note that just as with PivotTables, the order that you select fields in the Field List will determine the order that the corresponding fields are arranged in the chart.
2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

244

If you want more control over how the data is arranged in the chart, you can drag fields down to the Axis Fields, Legend Fields, Report Filter, and Values area boxes at the bottom of the Field List.

The Axis Fields area is where you place fields that you would like to appear on the X axis of the chart. The Legend Fields area is where you would place the fields that you want to analyze using the Axis fields. The labels associated with these fields will form the legend (color coded) area of the PivotChart. The Values area is where you place your numerical data. This is the data that will be measured and charted in the PivotChart in the form of columns, bars, or lines (depending on the chart type). Finally, the Report Filter area box is where you place fields that you would like to use to filter your views of the data.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

245

Look at the following PivotChart and the mapping of the different chart areas to the corresponding area boxes in the Field List:

Your reasoning as to the arrangement of various fields will be very similar to your approach to a regular PivotTable. It all depends on what aspects of your data you want to analyze. Remember, you can clear data out of your PivotChart by clearing the checkboxes in the Field List, just the same as you would with a PivotTable.

Pivoting Data
Pivoting data in a PivotChart is pretty much the same as with a PivotTable. How you pivot the data depends on the relationships or perspectives that you want to explore.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

246

Examine the following PivotChart and accompanying Field List carefully.

This chart shows the profit for each salesman, broken down by product type. Another way to think of it is to say Value Field for each Axis Field, broken down by Legend Field. Now, suppose that you wanted to see the profit generated by each product type, broken down by salesman. Since we still want to analyze profit, the Profit field can remain where it is in the Values box:

Because we want to see the profit for each product, we should place the Product field in the Axis Fields box:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

247

And finally, because we want the profit for each product type broken down across salesman, we should drag the Salesman field to the Legend Fields area:

Basically, we have just switched the positions of the Salesman field and the Product field from where they were before. Here is the resulting PivotChart.

The chart shows the profit for each product type, broken down across salesman. Now, suppose that we want to see the profit for each salesman and for each region, broken down across customers. Because we want to see profit for each region and for each salesman, we should chart the region labels and salesman labels on the bottom (X axis).

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

248

To start, we will clear all of the existing data from the chart by clearing the checkboxes in the Field List. Next, we will drag the Region and Salesman fields into the Axis Fields box in the Field List:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

249

Because we want to break the profit data down across customers, we should drag the Customer field into the Legend Fields box:

And finally, because we want to analyze profit data, we should put the profit field into the Values box:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

250

As you can see, you can place more than one field at a time in an area box. You can do this when pivoting data in a PivotTable as well. Now, lets have a look at the X axis of the resulting PivotChart.

Here you can see that the chart shows profit for each salesman and for each region. You should notice how the salesman are grouped according to the region they work in. (For example, you can see that A Smith and B Doe both operate in the East and in the Northeast.) If you look at the Axis Fields box, you will see that Region is above Salesman in the list:

You can drag the Region field down lower in the box, so that it appears below the Salesman field:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

251

Now, you will see these fields grouped differently in the PivotChart:

The Regions are now grouped according to Salesman; in other words, Region is now a subgroup of Salesman. Basically, the Field that appears first in the Axis Fields box will be the top level group. The field that appears second will be a subgroup. You can change the relative position of fields in the same box by dragging, or by clicking the small arrow associated with a field and selecting the appropriate option:

Notice that you can also remove a field from the PivotChart with the Remove Field command.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

252

Basically, pivoting data in a PivotChart is very similar to pivoting data in a PivotTable. You should keep in mind however, that the results you get when pivoting data in a PivotChart will also depend on the specific chart type that you are using.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

253

Lesson 3.2: Using the PivotChart Tools Tabs


Excel 2010 provides quite a variety of options to help you manage, format, move, pivot, and control your PivotChart. Most of these options are in the PivotChart Tools contextual tabs:

The PivotChart Tools are organized on four tabs: Design Layout Format Analyze This lesson will provide an overview of the tools on each of these tabs.

Using the Design Tab


The Design tab looks like this:

Like the options on the other Excel tabs, these PivotChart tools are grouped according to function. On the Design tab, the groups are: Type Data Chart Layouts Chart Styles Location The names of these groups are generally indicative of the function of the options that belong to them. Lets start with the Type group. The Change Chart Type command lets you choose what type of PivotChart to display in your workbook. This option will display a dialog with a side panel listing the different categories of charts that are available. In the large (scrollable) main area of the dialog, each subtype of chart that belongs to a given category will be displayed as a thumbnail image.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

254

Heres an example:

When you first display this dialog, the type of PivotChart that you are currently using will be highlighted. In the example above, the current chart is a Column chart. The particular variety of column chart is highlighted in the main area. You can access different chart types by selecting the categories in the list on the left, or by scrolling over the chart thumbnails in the large main area of the dialog. To select any given chart type, click on the thumbnail to highlight it. Next in the Type group is the Save As Template command:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

255

If you click this button, a Save Chart Template navigation dialog will appear:

From this window you can save the current chart type as a template for later use. Just enter a name for the template and click the Save button. The chart type, formatting, layout, and style information will all be saved as a template in the default Microsoft Templates folder. You can then apply the saved template to other PivotCharts whenever you like. The next group of options on the Design tab is the Data group:

The first tool in this group is Switch Row/Column, which will switch the positions of the fields in your chart. (Axis Fields will be switched with the Legend Fields. Just imagine switching the positions of the row and column labels in a PivotTable.)

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

256

The other option (Select Data) in the Data group can be used to change the range of data that a chart is based on. However, it is used primarily with standard charts and its functionality can be limited with PivotCharts. The next group on the Design tab is Chart Layouts:

This is essentially a thumbnail gallery for a variety of chart layouts. Click a thumbnail to change the layout, or view the full gallery by clicking the More arrow on the right side of the group:

The thumbnails will look different depending on what type of PivotChart (column, bar, pie, and so on) that you are working with. Note that choosing a new layout options will not change the data or the positions of the fields with respect to the charts X or Y axis. The different layouts will simply offer different dimensions of the chart (length and width) or provide different spacing, size, and placement arrangements for the chart elements. Next on the design tab, you will find the Chart Styles group:

This group offers thumbnails of various chart styles; just click a thumbnail to apply it. A style is a preset combination of borders, shading, font, and color scheme options that you can apply to your PivotChart to make it more visually interesting. The styles do not change the relationships between the fields and data in your PivotChart, or the basic layout of the chart (size and spacing); rather, the style options will give the PivotChart a more finished or polished appearance.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

257

Like other galleries that we have looked at, you can click the More arrow to view the full range of options:

It is important to note that these thumbnail previews will change to reflect the type of chart you are working with. (The thumbnails in the image above are provided for a column based PivotChart.) The final option on the Design tab is Move Chart:

When you click this button, a Move Chart dialog will appear:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

258

Here you can choose any of the existing sheets in your workbook (Object in radio button), or on a new worksheet (New Sheet radio button).

Using the Layout Tab


Our next tab is Layout:

The first group on the Layout tab is Current Selection:

The combo box in the Current Selection group will display the PivotChart element that is currently selected (the chart area in this case). You can select various chart elements by clicking on them in the chart itself, or by clicking the menu and choosing an element:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

259

Once you select a chart element, you can click Format Selection to display more options for formatting the selected element.

If you click Reset to Match Style the selected chart element will revert to the default formatting for the overall style that has been applied to the rest of the chart. The next group is Insert:

You can use these buttons to insert a picture (like a company logo), select from a wide range of shapes (to highlight important data), or add a text box (for extra chart information). The next group of tools is Labels:

These options let you configure the labels for each element of your chart. To configure the label for a given element, click the element name and then choose the desired configuration.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

260

For example, if we click Chart Titles, we will see these options:

Note the More Title Options command, which opens the Format Chart Title dialog. The next group is Axes:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

261

The Axes command lets you independently modify the horizontal and vertical axes of your chart:

The Gridlines command will allow you to add or remove gridlines and specify major and/or minor gridlines. Gridlines can make it easier to estimate the quantities represented in column or bar charts:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

262

Next we have the Background group:

These options will allow you to modify the background fill and floor of a 3-D PivotChart. They will also let you modify the background of the plot area on a standard two dimensional PivotChart. The options that are available in this group will depend largely on the type of chart (3-D or 2-D) and the style of chart. The Analysis group can be useful to clarify and interpret your charted data:

These controls can indicate trends and patterns in your data and also provide some statistical indicators. The Trendline options can show an average direction or trend in a particular group of data, while the Lines menu lets you add or remove Drop Lines or High/Low lines. Up/Down Bars show the growth or shrink of a series of data. Finally, Error Bars indicate error ranges for your charted data that can be measured as standard error, percentage (5%), or as a standard deviation (a measure of the general dispersion of data around the average). Once again, the options available in this group will depend on the type of PivotChart (line, column, pie, etc.) that you are using. Finally, in the Properties group, you can change the name of your PivotChart.

To change the chart name, just click in the box and type. This can be a useful option for identifying PivotCharts if you haves multiple PivotCharts (or other charts) in the same workbook.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

263

Using the Format Tab


The PivotChart Tools Format tab provides even more controls for modifying the look and feel of your PivotChart:

The first group is Current Selection, which works the same as the Current Selection group on the Layout tab:

These controls allow you to select individual elements of your PivotChart. (Remember, you can also select chart elements by clicking on them in the chart itself.) The Shape Styles group allows you to modify the border color and style, background color, and 3-D effects of the selected chart element:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

264

You can choose to apply a pre-defined style or modify each component separately. If you click the option button in the lower right corner of the tool group, a dialog will appear that will provide even more options for modifying the selected chart element:

The next group of options is the WordArt Styles group:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

265

Once again, you can choose to apply a pre-defined style:

There are also controls for modifying the font and outline color and for adding text effects:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

266

If you click the options button in the lower right of the group, the Format Text Effects dialog will open. As you might have guessed, this dialog gives you finer control over the color, fill, style, and other aspects of WordArt:

The Arrange group lets you work with various objects in the chart area. You can use these commands to decide how objects in the chart will be positioned:

The options that are available in this group will depend on the presence of other objects in your chart (like shapes). If objects overlap, you can decide which is on top of the other using the Bring Forward and Send Backward commands.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

267

The Selection Pane lets you select which entities to work with in a worksheet. You can also make objects visible or hidden by clicking the eye icon:

You can line items in the chart up with the Align command. As well, you can use the Group command to group several objects together as one, making them easier to work with. There is also an option to rotate objects in the chart if you so desire. Finally, we have the Size group:

You can adjust the width and height of the current chart or chart object using the small arrows provided (for small incremental changes) or by entering size values directly into the textboxes.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

268

Clicking the option button will open the Format Chart Area dialog box with the Size category displayed:

Using the Analyze Tab


The final PivotChart Tools tab is Analyze:

The other PivotChart tabs are also available as standard chart tools, but the Analyze tab is unique to PivotCharts. At this point the idea of PivotTables, PivotCharts, and the general concept of pivoting data should not be strange to you. You can probably guess the functions of a few of these options just from their names! The first group is Active Field:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

269

The textbox shows the currently selected field. In this case, the active field is Region. Here is the chart axis showing the labels for this field:

If we click Collapse Entire Field, the region labels will collapse, and the X axis of the PivotChart will look like the following:

To see the Region labels again, we would click Expand Entire Field. The chart axis would return to its original state. The next group is Data:

Insert Slicer is used for creating PivotChart Slicers. (You might remember Slicers from Lesson 2.5: powerful tools that can help you cut to the heart of your data.) The Refresh button will update your PivotChart with any changes made to the underlying source data. If your source data changes frequently, be sure to use the Refresh command regularly. The Clear button provides two options. The first option, Clear All, will clear all of the fields from the PivotChart, leaving an empty chart area. The second option, Clear Filters, will remove any filters that you have applied to the fields in the PivotChart.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

270

The next group is Show/Hide:

If the PivotChart Field List is hidden, the Field List button will display it. The Field Buttons options will allow you to display or hide various commands on your PivotChart.

You can specify which buttons you want to appear in the PivotChart by selecting or de-selecting items in the list.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

271

Here is a basic PivotChart:

Here is the PivotChart after turning off Axis and Value field buttons:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

272

Lesson 3.3: Formatting a PivotChart


So far, most of the PivotCharts we have seen have been in the form of column charts with a basic layout and simple formatting. Now it is time to learn how to change the appearance of a PivotChart to improve visual interest, and create a more professional, polished look.

Renaming Fields
When you create a PivotChart (or a PivotTable) in Excel, the column headings in the region of source data will be used as the field names for the chart or table in the Field List. Here are the column headings in the source data table:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

273

And the following image shows them in the PivotTable Field List as field names:

If you change a column heading (a field name) in the source data and then refresh the PivotChart or PivotTable, the new column name will be updated in the Field List. However, the labels associated with the old field name may disappear from your chart. In this case, you will have to re-add the updated field to the chart. Another option for changing the names of fields in a PivotChart is to right-click on a field and click Field Settings:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

274

Then the Field Settings dialog will appear:

In the dialogs Custom Name box, enter the name that you want for the given field. In this case, we changed the name from Salesman to Sales Person. When you click OK, the change will be implemented.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

275

Note that when you change a field name in this way, the change does not propagate back to the source data:

Changing the Chart Type


When you create a PivotChart in Excel, the default setting is a basic column chart:

If this basic chart type shows the information you want to convey in a way that best suits your needs, then by all means stick with it. However, you shouldnt feel limited to any single chart design. Excel provides a wide range of chart types that you can use for your PivotChart, plus it is really easy to change from one chart type to another.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

276

To change your PivotChart type, click Design Change Chart Type:

(You can also find this option on the right-click menu.) Now we will see the Change Chart Type dialog:

The thumbnail that is highlighted in the dialog corresponds to your current chart type. To switch to another chart type, just click on another thumbnail and click OK. When you choose a chart type for your PivotChart, it is wise to consider the quantity and type of data that you are presenting. It is possible that a given chart type may not be well suited to your goal of showing the information clearly. You should always try to find a chart type that is easy to understand, and that clearly shows any trends or patterns that you are trying to communicate.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

277

A simple column chart, for example, is ideal for comparing various levels of some value over a changing variable. A good example is the levels of units sold over different sales regions:

Another, perhaps even better way to show this kind of relative comparison would be with a pie chart:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

278

The chart types that are offered in the Change Chart Type dialog include: Column Charts Line Charts Pie Charts Bar Charts Area Charts X Y Scatter Charts Stock Charts Surface Charts Doughnut Charts Bubble Charts Radar Charts Each one of these chart types will typically have two or more versions or sub-types available. Thats a lot of charts to choose from! When it comes to PivotCharts though, there are some limitations: you cannot apply the Bubble, X Y Scatter, or Stock chart types to PivotTable data. Have a look at the following fancy PivotChart:

The chart looks good superficially, but can you really get any meaning out of it in terms of what the data is telling you?

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

279

Now look at the same information depicted as a simple column PivotChart:

Which chart is easier to understand? Keep in mind that the purpose of any chart is to make it easier to see and understand what is happening with the data. If you are changing chart types, make sure that you are making things clearer and not more confusing. This is especially true of PivotCharts, because as you pivot the data, the trends, patterns, or relationships displayed in the chart can change. If you find a chart type that you think works well, you can set it as the default chart type by selecting it in the Change Chart Type dialog and then clicking the Set as Default button. When you click OK, your selection will become the new default chart type.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

280

Here we have chosen a simple Bar chart type as the default:

Now, when a new PivotChart is created in Excel, it will be created as a bar chart:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

281

Applying a Chart Style


The Design tab features a gallery of pre-designed PivotChart styles:

A style is simply a preset combination of borders, shading, font, and color scheme options that you can apply to your PivotChart to make it more visually interesting. Although a style is applied to a chart type to enhance the appearance of the PivotChart, it will not change the fundamental structure or organization of the PivotChart. Basically, there are numerous preset styles that you can apply to each of the different chart types. Taken together, the chart type option and the style option offer a multitude of different choices for how to present your PivotChart. To apply a style to your PivotChart, click in the chart and then choose the Design tab. You can scroll through the Chart Styles gallery with the small arrow buttons:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

282

You can also display the full gallery by clicking the More arrow ( ):

The thumbnails that appear in the menu will reflect the type of the PivotChart to which you are applying the style. In the above example, the PivotChart is a column type, so the thumbnails show what the style would look like on that type of chart. Here is the same preview menu, but the PivotChart in question is now a bar chart:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

283

To apply a style, just click a thumbnail. The style will be applied immediately to your PivotChart:

Remember to try to choose a style that helps to demonstrate what your PivotChart is about. The purpose of these tools is to make data easier to understand.

Manually Formatting Chart Elements


There are still more tools in Excel 2010 that that can be used to change the appearance of a PivotChart! On the PivotChart Tools Format tab, there are a number of options that enable you to manually format individual parts of the PivotChart.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

284

The following PivotChart is a standard column type:

Now, well click in the chart and click PivotChart Tools Format:

Now, click directly on a chart element to select it. The element that you have selected will be displayed in the Current Selection box:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

285

Alternatively, for a more precise way of selecting a chart element, you can click the Current Selection box and then click an element:

When a chart element is selected, it will have selection markers around its perimeter:

Once youve selected the element you want, you can manually format it by using the tools on the Format tab. Lets say that you want to add shading to the selected element.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

286

To do this, click the Shape Fill command:

Now, click on one of the color swatches to fill the selected element with that color:

Now lets click in the main center area of the chart, to select the plot area:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

287

Next, we will add a fill color as before:

Now the Plot area is shaded:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

288

Next, we will display the Shape Fill options again and choose Gradient:

This will display another submenu containing gradient thumbnails:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

289

Here are the results:

You can also manually apply an outline to the selected chart element using the options on the Shape Outline menu:

First, you can change the color of the outline by clicking on one of the swatches provided in the menu.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

290

There is also an option for weight (thickness of the lines):

In the following image, a 4.5 point outline has been applied to the selected area:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

291

In addition to the fill and outline options, there are also Shape Effects that you can manually apply:

Each of the options on the Shape Effects menu contains a submenu with more choices. If you let your mouse pointer hover over a thumbnail, you will see what the effect would look like if applied to the selected chart element.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

292

The following image shows what our original PivotChart looks like with a Glow effect applied, along with the fill and gradient effects:

Remember, you can manually add effects like this to any of the chart elements that can be individually selected. In the following example, fill, outline, and shape effects have been added to the Sum of Profit series:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

293

Any time that you select an element in a chart, you can right-click to see a context menu for that element. In the menu, you will see an option to open the Format dialog for the given element. For example, here is the format option when you select and right-click on the Y Axis of the chart:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

294

Here is the resulting dialog:

As you can see, fill, lines, and other effects can be accessed from these contextual dialogs. However, the options here are more advanced and allow you to fine-tune each setting.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

295

Changing the Layout of Chart Elements


We have seen how to apply a style to a PivotChart, change the chart type, and manually format selected chart elements. Now it is time to look at how to change the layout of the PivotChart elements. The first step is to click in the chart and click the PivotChart Tools Layout tab:

Each one of the controls in the Labels, Axes, and Background groups will have a sub menu of further options that lets you customize the layout of that element. The best way to understand these options is by taking a look at what happens to a PivotChart when they are selected. Here is a basic column PivotChart:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

296

To add a title to the chart, choose Layout Chart Title:

This action will display the following menu:

You can use these options to decide if and where to display a title. For this example, the Above Chart option is selected. This will display a new Chart Title element above the PivotChart:

At this point a title can be entered by typing it in the region provided. If the chart already had a title, you could use the menu options to automatically position the existing title above the chart, or as an overlay on the chart:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

297

With the Axis Titles button, you can create titles for your horizontal and vertical axes:

As before, a region will become available to enter an axis title:

If you choose Layout Legend, a menu will appear with options for positioning the PivotChart Legend:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

298

In this example, the Show Legend at Top option is selected. Here is the result:

If you choose Layout Data Labels, you will see options for displaying data labels in your PivotChart:

These layout options will display the actual data to add detail to the standard graphical representations (like bars or columns). (Notice that each option has a thumbnail indicating where the data will be placed.)

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

299

The following image shows an example of data labels applied to the outside end of the columns in the PivotChart:

Choosing Layout Data Table will reveal options to add a data table to your PivotChart. (A data table provides an alternative to data labels. Instead of placing specific values right with the corresponding column or bar on the PivotChart, a data table will include the numerical data values in an organized table below the chart.)

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

300

The following image shows a simple bar PivotChart with a data table and data labels for the sake of comparison:

Our next layout button is in the Axes group and is labeled Axes. This button will give you options for changing the layout of the horizontal and vertical axes:

For the horizontal axis, you can choose: None: Do not show the horizontal axis Show Left to Right: The default for most chart types with labels listed from left to right Show Axis Without labeling: Do not show any labels or data on the horizontal axis Show Right to Left Axis: Switch the orientation of the horizontal axis, so the vertical axis is on the right For the vertical axis, you can choose: None: Do not show the vertical axis Show Default Axis: Show the vertical axis on the left Show Axis in Thousands/Millions/Billions: Incremental numbers on the vertical axis will use a scale based on chosen unit Show Axis with Log Scale: The numbers on the vertical axis and the corresponding graphical data will use a base 10 logarithmic scale

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

301

You can also add (or change the layout of) horizontal and vertical gridlines with the Gridlines command:

Gridlines can help the user determine levels in a chart with more accuracy:

You can apply no gridlines, major gridlines (spaced at each label), minor gridlines (spaced evenly across the interval for a label), or both minor and major gridlines. The above image shows a PivotChart with major and minor horizontal gridlines, but only major vertical gridlines.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

302

Lesson 3.4: Advanced PivotChart Tasks


Just like PivotTables, PivotCharts can be based on external data sources, analyzed with Slicers, incorporated as part of a scenario report, and even used with PowerPivot. Having acquired a solid understanding of the fundamentals of PivotTables and PivotCharts, it is time to cover some of these more advanced concepts.

Creating a PivotChart Based on External Data


The process for creating a PivotChart based on external data is almost the same as for a PivotTable based on external data (since when you create a PivotChart a corresponding PivotTable is created as well). To start, choose Insert PivotTable PivotChart:

In the Create PivotTable with PivotChart dialog, select the Use an external data source radio button and then click Choose Connection:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

303

In the Existing Connections dialog, select the connection to the external data that you want to use:

In this example, the connection is to an Access database table called testTable. After selecting the connection, click the Open button at the bottom of the Existing Connections dialog:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

304

Then, you will see the connection name in the Create PivotTable with PivotChart dialog:

Click OK to create an empty PivotTable and PivotChart with a Field List drawn from the external data source. When you see the empty PivotTable area and corresponding Field List, drag the fields down to the appropriate boxes in the Field List (just like before) to add data to the PivotChart.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

305

It may be the case that you already have data in your workbook that is based on an external data source. If this is the case, select the range of data that you want to base the PivotChart on, and choose Insert PivotTable PivotChart:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

306

In the resulting dialog, make sure that the selected range is correct, specify a location for the PivotChart, and then click OK:

(The accdb file extension visible in the Table/Range textbox indicates that the source fo r this worksheet data is an Access database file.) When you click OK, a PivotTable area, PivotChart area, and Field List will be created. The fields in the list will be from the data range (based on an external source) that you selected.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

307

If you choose Data Get External Data, you will see an option for retrieving data from an Access database:

Since information in a database is arranged in tables, this kind of external data is ideally suited to a PivotTable or PivotChart! When you click the From Access option, a navigation window will appear. You can use this window to browse to an Access database:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

308

When you have selected the database that you want to use as a source and click Open, an Import Data dialog will appear:

Simply select the PivotChart and PivotTable Report radio button, specify a location for the data, and click OK. This will create an empty PivotTable and PivotChart and a Field List with fields drawn from the external data, just as before. If you choose another type of source data (like a text or XML file), you will not see the PivotChart option in the Import Data dialog:

To base a PivotChart on this external data source, you must click OK to this dialog to import the data into a worksheet as a regular table of data. Next, select the range and create a PivotChart as discussed before. The resulting PivotChart will be based on the data in your worksheet (which is in turn based on data from an external source). Remember, just like a PivotTable or a regular table based on external data, you should use the Refresh option if you want to update the PivotChart with changes made to the underlying source data. If your PivotChart is based on a data range in an Excel worksheet, and that data range is in turn based on an external data source, you should refresh the data range in the worksheet before refreshing the PivotTable.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

309

Creating a Slicer
Slicers are an exciting new tool for Excel 2010. In Lesson 2.5 we discussed Slicers in the context of PivotTables. Now we will see what can be done with Slicers and PivotCharts. In the following example, we have a basic PivotChart that shows sales and profit for various geographical areas under the direction of different salesmen.

You can use a Slicer with a PivotChart in almost the same way that you would with a PivotTable. To create the Slicer, click in the chart and then choose Analyze Insert Slicer:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

310

In the Insert Slicers dialog, we will select the fields that we want to work with:

When you click OK, you will see the Slicers:

Now it is time to use the Slicers to find exactly what we want. The idea is the same as it was for PivotTables. Click in a Slicer to select an item (or Ctrl-click to select multiple items) and the other data will be filtered out of the chart. You can make selections in different Slicers to combine the filters.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

311

Lets suppose we want to see the profit for A Smith and M Parker for the Mideast area. To do this, we will click A Smith in the Salesman Slicer, and then hold the Ctrl key and click M Parker. Next, we will click Mideast in the Area Slicer. The other two Slicers, Product and Profit, will show results that reflect the items selected above.

The results of the Slicer choices are reflected in the PivotChart:

To clear the Slicers, click the button

in the upper right of the Slicer.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

312

If you click the arrow on the Slicer button on the Analyze tab you will see a Slicer Connections command:

This command will invoke the Slicer Connections dialog:

Here you can disconnect a Slicer from the underlying PivotTable and PivotChart. This will basically make the Slicer inactive: if you click an item in the disconnected Slicer, nothing will happen with the PivotTable, PivotChart, or the other Slicers. To re-connect the Slicer, just select it again in the Slicer Connections dialog and click OK.

Creating a PivotTable and PivotChart from a Scenario


In Lesson 1.2, we discussed creating scenarios in Excel. As you might recall, a scenario is a set of cell values that is stored and substituted into your worksheet at your convenience. Since the rest of the data in the worksheet will be fully calculated based on the scenario you use, you can compare and contrast the results of one scenario with another by switching between them. It is also possible to create a scenario summary in the form of a PivotTable. If you have a PivotTable, you can then create a PivotChart which you can use to build a graphical representation of your scenarios.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

313

As an example, look at the following worksheet.

The worksheet shows financial data for a chain of fictional businesses with a location in each of the cities listed. For each city, there is a corresponding scenario with projected changes in the financial data. To see the list of scenarios, choose Data What-If Analysis Scenario Manager.

This action will display the Scenario Manager dialog, where you can see a list of the scenarios that are saved with the workbook. You can select a scenario and click the Show button in the dialog to recalculate the worksheet data based on the selected scenario. To compare the scenarios you could show each one, one after the other, but you would not see the results of the scenarios at the same time.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

314

Another way to look at the scenarios is to create a scenario PivotTable. To start, click the Summary button in the Scenario Manager dialog:

Then, in the Scenario Summary dialog, select the Scenario PivotTable report radio button, and specify the range for the Results cells that you are interested in:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

315

Here we have selected the range H2:H6, which contains the Profit for Boston, New York, Atlanta, and Miami, as well as the combined profit for all city locations. (The values in these result cells will change depending on the scenario used.) To create the PivotTable, click OK in the Scenario Summary dialog. Here is the result:

You will notice that the column labels are the cell references for the range of result cells we chose. These cells correspond to the profit for each city (H2 to H5) and the total profit (H6). To make the table easier to understand, we can re-label these columns:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

316

Now that we have a PivotTable with the results from all of our scenarios, we can create a PivotChart. To do this, just click in the PivotTable, click the Insert tab, and use the Chart group to pick a chart type:

For this example, a 2-D column chart has been selected:

The PivotChart shows the results of all five scenarios (as specified by our choice of result cells).
2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

317

For even better analysis, click in the PivotChart and choose Analyze Insert Slicer:

In the Insert Slicers dialog, we will choose $B$2:$F$5, since this is the range for the changing cells in all five scenarios:

When we click OK, our Slicer will appear:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

318

Now we can easily look at whatever scenario we want. For example, suppose we choose the Atlanta scenario by itself:

Here is the resulting PivotChart:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

319

Now, suppose we want to compare the Current state of affairs with the scenarios for New York and Miami:

This makes it easy to view multiple scenarios at once.

Creating PivotCharts with PowerPivot Data


In Lesson 2.4, we discussed a powerful Excel add-in called PowerPivot. With PowerPivot, you can import and integrate multiple data sources (from multiple external files) and then pivot the combined data almost as if it came from a single table. Now we will explore how to use PowerPivot with PivotCharts. To begin, we will open Excel and make sure that the PowerPivot add-in is installed:

Next, well launch PowerPivot by clicking the PowerPivot Window button:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

320

Now we can see the data from two external data sources. One sheet contains data imported from an Access database:

The other sheet has data from a separate Excel 2010 workbook:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

321

To see the PivotChart options, click Home PivotTable arrow:

You will see a PivotTable/PivotChart menu:

This menu has options for a number of PivotTable/PivotChart combinations. These include: A single PivotChart on a sheet A PivotChart and a PivotTable arranged horizontally on a sheet A PivotChart and PivotTable arranged vertically Two PivotCharts on a sheet arranged horizontally Two PivotCharts on a sheet arranged vertically Four PivotCharts on a sheet A flattened PivotTable (for Excel Services) For the purposes of this example, we will choose a single PivotChart:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

322

Then you will need to choose where in Excel to place the chart:

In this case, we will place the PivotChart in a new Excel worksheet:

There will now be two new worksheet tabs at the bottom of the Excel screen: one for the PivotChart itself (an empty chart area and corresponding Field List), and another for the PivotChart data (an empty PivotTable and a corresponding Field List).

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

323

The data can be added to the PivotChart by dragging the fields you want down to the boxes at the bottom of the Field List. Because the Field List is based on a PowerPivot connection that integrates two data sources, you will see two sets of fields in the list:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

324

The two sections in the Field Lists are named after the corresponding data sources that have been imported into, and combined, with PowerPivot.

Here is a sample PivotChart generated from the combined Field List:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

325

As with any PivotChart, choosing Analyze Insert Slicer, will allow you to create Slicers:

Because the data for the PivotChart comes from different sources, there are two distinct sections in the Insert Slicer dialog:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

326

To create the Slicers, select the fields that you want to use and click OK. In the dialog above, there are eight Slicer fields selected. Here are the results:

PowerPivot, PivotTables, PivotCharts, and Slicers, are amazing tools. Even learning to use them at a basic level will greatly enhance the power and flexibility of data analysis in Excel.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

327

Section 3: Review Questions


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

Which of the following statements outlines an advantage of using PivotCharts over regular charts? They can change what they represent depending on how you pivot the data They can be used with Slicers A single PivotChart can be used to show the same information as multiple standard charts All of the above What is the best chart type for a PivotChart? Pie chart Bar chart Scatter chart None of the above When you click a label in a Slicer it is a lot like Filtering the data Re-formatting the data Adding new data Validating the PivotTable or PivotChart data What chart types can you not use with a PivotChart? Surface charts Stock charts Bubble charts Scatter charts All of the above What is the best way to modify Slicers? Using the Format tools on the Home tab Using the Styles tab Using the Format Filters tab Using the Slicer Tools tab When you click on a PivotChart, what contextual tabs will you see? Options and Design Design and Layout Design, Layout, Analyze, and Format Design, Style, Analysis, and Format

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

328

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

Which of the following statements is true? (Select all that apply.) A PivotChart will almost always have an associated PivotTable You cannot use a PivotChart on data that has been combined with PowerPivot If you pivot the data in a PivotTable, the PivotChart associated with it will not change You can refresh the data in a PivotChart Which of the following combinations is not possible? A PivotChart and a PivotTable A standard chart and a Slicer PowerPivot data, a PivotChart, and a Slicer A standard table and a standard chart Which of the following functions can be used to summarize numerical data in a PivotChart or PivotTable? Sum Average Count StdDev All of the above Which of the following is not a recommended data source for a PivotTable or PivotChart? A Word document An Access Database A text file A database query

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

329

Section 4: Advanced Excel Tasks


In this section you will learn how to: Use the PMT and FV functions Understand and use logical functions Use the IFERROR function with array formulas Differentiate between VLOOKUP and HLOOKUP Find an exact or approximate match with VLOOKUP Use VLOOKUP in an array formula Understand AutoFill lists Create, use, modify, and delete custom AutoFill lists Link, consolidate, and combine workbooks Pivot consolidated data using the PivotTable and PivotChart Wizard

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

330

Lesson 4.1: Using Advanced Functions


Excel 2010 puts a tremendous variety of built-in functions at your disposal. Some of these functions, such as Average and Sum, are quite straightforward and easy to apply. There are some other functions however, that are not as easy or intuitive, but are still very useful. In this lesson, we will take a look at some of Excels more advanced financial functions, namely, the PMT (payment) and FV (future value) functions. We will also explore Excels logical functions and look at how they can be used in a worksheet.

Using the PMT Function


The PMT (payment) function is one of Excels more advanced financial functions. If you have a loan at a constant interest rate and you are paying the loan with fixed periodic payments, the PMT function will calculate the amount of a single loan payment. To select this function, click Formulas Financial PMT:

For example, if you take a loan of $10,000 at 6% annual interest over 4 years, you can use the PMT function to calculate what the monthly payment on the loan will be. To start, lets look at the list of arguments for the PMT function:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

331

The Rate argument is the interest rate per payment period. This means that if you have a 6% annual interest rate, and your payments will be paid once a month, the rate will be 6%/12. The Nper argument is the number of payment periods required for the loan. If you are repaying the loan over four years, the Nper argument would be 4*12, for four years of 12 monthly payments. The Pv argument is the present value of the loan; in this case, the face value of the amount you are borrowing. If you borrow $10,000, the Pv is 10000. The Fv argument and the Type argument are optional in this function. You can use an Fv argument to specify an amount that is left outstanding after the loan payments are made for all payment periods. If you leave this option out, it will default to 0, meaning that the loan will be paid in full at the end of the payments. The Type argument will specify if the payment is made at the beginning or end of the payment period. If you enter an argument of 0, payments will be due at the end of the payment period. With an argument of 1, payments will be due at the beginning of the period. If you leave this argument out, it will default to 0. For the case described above, you would have a Rate of 6%/12, an Nper of 4*12, and a Pv of 10000, which translates to a loan for 10000 dollars at 6% paid monthly over 4 years. The resulting function arguments look like this:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

332

You will see that a formula result of -234.85 has been provided in the dialog. This is how much the monthly payment would be. If you click OK in the dialog, the formula will be entered and the value will appear in the active cell in the worksheet.

If you choose to type the function directly into the formula bar, rather than using the Insert Function features, your function should look like this:

Notice that this typed-in function contains the same arguments as before, with each argument separated by commas. If you wish, you can also use cell references as function arguments, instead of direct numerical values:

In this worksheet, the PMT functions in the Payment per month column use cell references, as shown in the formula bar.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

333

Remember, if you are using worksheet values as function arguments, you can just click on a given cell to enter a reference to the cell containing the value into the Function Arguments dialog.

Using the FV Function


Another interesting financial function is the FV or future value function. This function returns the future value of a series of periodic payments to an investment at a fixed interest rate. For example, if you put $5,000 a year into an investment that yields 6% annual interest, the FV function can tell you how much your investment will be worth after a given period. Lets begin by examining the arguments for the FV function.

The Rate argument is the interest rate that you expect to earn on your investment. If you are contributing payments to your investment once a year, you should use an annual rate. If you are paying into your investments on a monthly basis, you should use a monthly interest rate. The Nper argument is the number of payment periods over which you will contribute to your investment. The Pmt argument is the payment that you make each payment period. The Pv argument is an optional lump sum that you can begin with. (By default, this argument is 0.) The Type argument will specify if the payment is made at the beginning or end of the payment period: enter 1 for payments at the beginning of the payment period and 0 for payments at the end of the payment period. (By default, this argument is also 0.)

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

334

If you contribute $5,000 dollars a year at an interest rate of 6% for 10 years, the function arguments would be as follows:

At the end of 10 years, you would have almost $66,000:

Notice the FV function in the formula bar. Just as with the any other function, you can use cell references as function arguments for the FV function instead of direct numerical values.

Understanding Logical Functions


Excel 2010s logical functions are: AND OR NOT FALSE TRUE IF IFERROR These logical functions are important when doing advanced work in Excel because they can help you control the behavior of your worksheets based on specific logical conditions. The AND function will return true if all of its arguments are true. If one argument is false, the AND function will return false. For example, the logical statement 1<10 is true, and the statement 2>1 is also true. As a result, the compound statement 1<10 AND 2>1 is true, because both of the statements that are being joined by AND are true:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

335

Notice that the arguments joined by AND are placed in parentheses and separated by commas. The Excel function =AND(1<10, 2>1) means the exact same thing as saying 1<10 AND 2>1 in plain English. Because 1 is less than 10 and 2 is greater than 1, the Excel AND function returns the logical value True. The following table (called a truth table) may help you understand the AND function. In the last column of the truth table, you will see the value returned by the function according to the corresponding values of the function arguments. A True False True False B False True True False AND (A, B) False False True False

The logical OR function will return true if one or more of the arguments to the function are true. For instance, the compound statement 1<10 OR 2<1 is true, since 1 is less than 10. It does not matter that the statement 2<1 is false, because you have a choice of either 1<10 OR 2<1 to make the compound statement true. If one or both of the arguments is true, the overall OR statement will also be true. In Excel, you compose an OR function as follows. =OR( argument1, argument2, argument3, argument4,.argument255) . If one or more of the function arguments is true, the OR function will return true:

Here is a truth table for the OR function: A True False True False B False True True False OR(A,B) True True True False

The NOT function has the following structure. =NOT(argument). Basically, if the argument is true, the NOT function will return false. If the argument is false, the NOT function will return true. (In other words, not true is false, and not false is true.)

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

336

In the following example, =NOT(10>1) will return false, because 10>1 is true and NOT(true) is false.

Here is the truth table for the NOT function: A True False NOT(A) False True

The FALSE function will simply return the logical value false. The function takes the form =FALSE() with no arguments. It is a way of specifying a logical value of false in a cell, formula, or larger function.

The TRUE function will simply return the logical value true. The function takes the form =TRUE() with no arguments and is a way of specifying a logical value of TRUE in a cell, formula, or larger function.

The IF function takes the form =IF(logical test ,value1, value2). This is a very important logical function. Essentially, if the logical test evaluates to true, the IF function will return value1. If the logical test evaluates to false, the IF function will return value2. For example, =IF(10>1,100,200) will return 100, because 10>1 is true. On the other hand =IF(10<1,100,200) will return 200, because 10<1 evaluates to false.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

337

The IF function is ideal for making choices based on logical tests. Furthermore, you can nest IF functions one inside another, like this: =IF(A1=10,100,IF(A1=5,200,0)) In the case of this IF function, if the value in cell A1 is 10 the function will return 100. If the value in A1 is not 10, the function will test if the value in A1 is 5. If the value in A1 is 5, the function will return 200. If it is not 5 (and also not 100) the function will return 0. Here is the formula in Excel:

When you nest logical functions, you must make sure that the number of closing parentheses matches the number of opening parentheses used in the function. If you count the parentheses in the function from the image above, you will see two opening and two closing parentheses:

As with virtually any function, you can use cell references in an IF function as well as direct arguments. The IFERROR function is of the form =IFERROR(expression, value if error). Basically, the function will return the value of the expression if the expression is not an error. If the expression causes an error (such as a division by zero error) the function will return a specified value that you supply. Take the following IFERROR function as an example: =IFERROR(10/A1,1000) This function will return the value of the expression 10/A1, unless cell A1 contains a value of 0. If A1 is 0, then 10 /A1 will create a division by zero error, and the value 1000 will be returned:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

338

Now, the value in cell A1 is changed to 5:

2 is returned by the function because 10/5 =2. Lets look at another example.

Can you tell what is happening with this formula? If D1 +3 results in an error, then a value of 1000 will be returned. If there is no error, the result of D1 + 3 will be returned. Since D1 is 11, 14 is returned (11 + 3) and displayed in the cell containing the formula. Now look at this variation:

This time, 1000 is being returned in the formula cell. This means that an error has occurred. This is because the value in cell D1 is not a value at all: cell D1 contains two Is. If you try to add text with a number, you get a value error. Because there is an error, the formula returns 1000. Of course, you could return almost any type of data if there is an error. Have a look at the following example:

In this case, we have specified the word Error as a return value when the IFER ROR function detects an error. There is an error in this case because cell C1 contains nothing at all, and a numerical value is required for division.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

339

Using Logical Functions


Examine the following worksheet:

This worksheet is used to calculate the future budget increase for different divisions of a fictional company. You will notice that the Miami location has had its budget increased from 1,500,000 to 1,800,000. Also, the L.A. location has had its budget increased from 2,000,000 to 2,400,000. The question that arises here is, What reasoning was used to arrive at these budget increases for these cities? For the answer to this question, look at the formula bar for a cell from the Budget Increase column:

Here is the formula from cell F2: =IF(OR(C2-D2>500000,AND(C2>D2,E2>20%)),B2*1.2,B2) To understand this formula as a whole, you must first understand how each logical function is used in the formula. To start, remember that the IF function will return a certain value based on a logical test: =IF(logical test ,value if test is true, value if test is false) In this case, the logical test is: OR(C2-D2>500000,AND(C2>D2,E2>20%))
2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

340

Remember, the OR function will return true if one or more of its arguments are true. The first argument in the OR function is C2-D2>500000. This is a simple argument that will return true when the value of cell D2 subtracted from cell C2 is greater than 500,000. The second argument in the OR function is AND(C2>D2,E2>20%). This is a logical AND function which will return true only when the value in C2 is greater than the value in D2 AND the value in E2 is greater than 20%. If the first argument to the OR function is false, the AND function must return true for the OR function to be true. Alternatively, if the AND function returns false, the first argument to the OR function must return true for the OR function itself to return true. If we use the column headings instead of specific cell references, the logic of this OR statement reads: OR(Forecast Revenues-Previous Revenues>500000,AND(Forecast Revenues>Previous Revenues, %Market Share>20%)) To explain it further: If (%Market Share is greater than 20% AND Forecast Revenues are greater than Previous Revenues) OR (Forecast Revenues subtract Previous Revenues is greater than 500000), return true. When the OR function returns true, the IF function will give the value B2*1.2: the original budget increased by 20 percent When the OR function returns false, the IF function will give the value B2: the original budget value.

If you wanted to summarize the formula shown in the formula bar in plain English, you could say the following: If the forecast revenues show more than a 500000 dollar increase over the previous revenues, or if the forecast revenues are greater than the previous revenues and the market share is greater than 20 percent, the budget will be increased by 20 percent. Otherwise, the budget will remain the same. Logical functions can be difficult to grasp at first, especially if they are nested into a larger formula. If you are confused by a formula involving one or more logical functions, take your time and carefully study the function arguments. Study one function at a time until you understand the logic and the test conditions and the value or values that the function will return. If you understand each individual function in a formula, pretty soon the entire formula will make sense to you.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

341

In a situation like this, with a complex logical formula, it may help to examine the nested functions in a formula from inside to out. To break this complex formula down once again: AND(C2>D2,E2>20%): Returns true if %Market Share is greater than 20% AND Forecast Revenues are greater than Previous Revenues. (Both must be true.) OR(C2-D2>500000,AND(C2>D2,E2>20%)): Returns true if Forecast Revenues subtract Previous Revenues is greater than 500000 OR result from AND function is TRUE. IF(OR(C2-D2>500000,AND(C2>D2,E2>20%)),B2*1.2,B2): IF the OR function returns TRUE increase the original budget by 20 percent (multiply it by 1.2). Otherwise, keep the original budget.

Using IFERROR with Array Formulas


In a perfect world, worksheet data would not contain errors. We all know, however, that errors can easily occur! A typing error, an unexpected formula result, a problem importing data, poorly designed macros, and bad VBA code can all cause problems for a worksheet. However, the IFERROR function can help compensate for errors in a worksheet. First, have a look at the following worksheet which lists a series of distances, times, and speeds.

You can see an error in cell D17. Here is the formula bar for that cell:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

342

D17 is supposed to display the average speed based on all of the speeds listed in column D. The problem is that cells D3 and D9 have errors: a division by zero error and a value error. The AVERAGE function will not work on a column of data that contains an error. In this example, it is easy to find and correct the errors in the data because there are not that many rows of data, no data is hidden, and the math (dividing a column of distance measurements by a column of time measurements to get the speed) is simple. In a larger and more complex worksheet, however, the errors could prove difficult to deal with. Fortunately, we have the IFERROR function at our disposal. If we combine this function with the power of array formulas, we can check our column of data for errors before a calculation is made. Lets begin with a little refresher on the IFERROR function. It has the following form: =IFERROR(expression, user specified value) This function will return the value of the expression if the expression is not an error. If the expression causes an error, the function will return a value that you specify. (Refer to the Understanding Logical Functions concept in this lesson for more information.) We need to make the IFERROR function test our entire column of data for errors and return the data only when it is legitimate (no error in the cell). This legitimate data must then be used by the AVERAGE function to calculate the average of all of the legitimate data cells in the column. Look at the following potential solution: =AVERAGE(IFERROR(D2:D16, FALSE)) Breaking down this formula we have: IFERROR(D2:D16, FALSE): If the value in the range D2:D16 is not an error, that value will be returned. Otherwise, a logical FALSE value will be returned. =AVERAGE(IFERROR(D2:D16, FALSE)): Whatever is returned from the inner IFERROR function will be averaged. (The AVERAGE function ignores logical FALSE values.) Now, we will plug this new formula into Cell D17 of the worksheet to calculate the average, regardless of cell errors:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

343

Here is the resulting worksheet:

The formula calculates an average of 0.00. This is a slight improvement over the error value we received before, but clearly it is still incorrect. What went wrong? The IFERROR function and the AVERAGE function are not processing the entire range of data. To make this happen, we have to turn the formula into an array formula. This will allow the IFERROR function to create an array that holds each expression from the range if it is not an error and a logical FALSE value when there is an error. The AVERAGE function will then average this array while ignoring the FALSE values.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

344

To turn the formula into an array formula you must press and hold the Ctrl key and the Shift key at the same time that you press Enter to enter the formula:

If you were successful, curly braces will appear around the formula:

The only purpose of the curly braces is to indicate that the formula is an array formula. Note that the braces cannot be typed in to create an array formula. They must appear as a result of pressing Ctrl + Shift + Enter.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

345

The following image shows the result with the array formula in place:

Now we can calculate the average speed even with error values in the column of data. This array formula will work with any type of error value that may arise. Furthermore, this general idea will also work with functions like SUM, MAX, and MIN, that would typically return an error in these circumstances.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

346

Lesson 4.2: Using the VLOOKUP Function


Excel provides two lookup functions that you can use to quickly retrieve information from data organized in a table. The functions are called HLOOKUP (horizontal lookup) and VLOOKUP (vertical lookup). In this lesson, you will learn how to use the VLOOKUP function to find data, limit VLOOKUP to an exact match, and find the closest match with VLOOKUP.

Understanding VLOOKUP and HLOOKUP


The VLOOKUP function will look in the leftmost column of a table for a value you specify. When it finds the value you specify, 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 somewhere across that row. HLOOKUP is similar, but it will look horizontally across the upper row of your table, and then retrieve data from somewhere below in the column. 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.

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.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

347

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) . If we activate cell F1 and enter =VLOOKUP("England",price,2) into the formula bar, 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 the second (2) column of the table, in the row where the match was found. You should notice, that England, price, and 2 are the exact arguments used in the function. For this example, the true or false argument was left out. The relevance of the true or false argument in the VLOOKUP function will be discussed shortly. To use the VLOOKUP function correctly, you need to have your spreadsheet data laid out properly in table form with at least two columns. The first column in the table will contain the keys (identifiers that the VLOOKUP function will examine for a match). In the example just shown, the keys are the names of the countries. This first column can be referred to as the lookup column. The other columns in your table will contain data that corresponds to the column of keys. Your table can be several columns wide, and you can specify which column VLOOKUP will retrieve 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.
2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

348

You do not have to use text values (like the country names used here) in your lookup column. If it is more appropriate, numbers or dates will serve just as well. If you want some help when you are using VLOOKUP, use the Insert Function dialog:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

349

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

Simply enter the function arguments in the fields provided.

How to Find an Exact Match with VLOOKUP


As mentioned briefly before, the VLOOKUP function can have 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. If it cannot find an exact match, no data will be returned.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

350

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. The value 925 is returned to cell D1.

If there are two or more exact matches, the data corresponding to the first matching value found in the lookup column will be returned.

Finding an Approximate Match with VLOOKUP


If the final argument in your VLOOKUP function is TRUE, VLOOKUP will search the lookup column for an approximate match to the search value you enter in the function. If there is an exact match to your search value in the lookup column, the corresponding item from that row will be returned. However, if no exact match is found, a value corresponding to what Excel deems is an approximate match will be returned.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

351

For 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. Japan is the closest match to jpn that Excel can find in the lookup column.

Similarly, if you enter Ity as the search value for the function, the airfare corresponding to Italy will be returned:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

352

This feature can be useful if you have a lengthy lookup column and you arent quite sure how to spell what you are looking for; however, there are no guarantees when looking for an approximate match. If you omit the final argument in your VLOOKUP function, it will default to TRUE, and search for a closest (approximate) value if an exact match cannot be found. If you use the TRUE argument (intentionally or by default), the values in the lookup 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 may also produce unexpected results. If you use FALSE as the final argument to your function (for an exact match), the lookup column does not have to be sorted.

Using VLOOKUP as an Array Formula


You have just seen how to use VLOOKUP to find a data value in a row that corresponds to the presence of a search value in a lookup column. Now that you know how to return a single data value with VLOOKUP, the question becomes, how do you use VLOOKUP to find multiple values? Study the following worksheet. It is an extension of the previous examples in this lesson.

The range of data in the Air Fare table is called ticketData. This range contains information regarding the availability of first and second class seats. If there are seats available, the value is yes, and if there are no seats available, the value is no. Suppose you want to have the VLOOKUP function return the data for the ticket price, and for the seats that are available. You can perform this task by using VLOOKUP as an array formula.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

353

Here is a VLOOKUP function that will retrieve three data items: =VLOOKUP("Japan",ticketData,{2,3,4}) As before, the first argument is the search value: Japan. The next argument is the range of data to be searched. (The range has been named ticketData to make things easier.) As you already know, the next argument is supposed to identify the column from which VLOOKUP retrieves the data if a match is found. This time, a set of three numbers has been given as the argument {2,3,4} rather than just one number. Our intention is to have VLOOKUP retrieve multiple values from the table of data. To make this function work, we must first select a set of three cells to receive the data. Next, we will add the VLOOKUP function to the formula bar:

To make the function work as intended, we will now enter it as an array formula (by pressing Ctrl + Shift + Enter). We know the function has been successfully entered as an array formula by the curly braces that appear around it:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

354

The VLOOKUP function now returns multiple data items from the table based on a match with the search value Japan:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

355

Lesson 4.3: 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 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 clicking and dragging over the cells to fill. Did you know that Excel lets you go one step further by creating own custom AutoFill lists? In this lesson you will learn what a custom AutoFill list is, as well as how to create, use, and modify one.

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 and number combinations that change by a fixed amount, like Region1, Region2, Region3, etc. 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, 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 2010 allows you to create a custom AutoFill list that does not need to increase or decrease by a fixed increment. 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 the same way as default AutoFill lists:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

356

Creating a Custom AutoFill List


To create a custom AutoFill list, start by clicking File Options:

In the Options dialog, choose the Advanced category:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

357

Now, scroll to the bottom of the main window and click Edit Custom Lists:

You will then see the Custom Lists dialog:

The Custom lists area contains AutoFill lists that already exist.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

358

In the List entries area, you can create a list by entering 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 area so that each word is on its own line.

When you click Add, the custom list will be added to the Custom lists area on the left. There, you will see the text or numbers that you just added, in a comma separated list.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

359

You can also select a range of cells from your worksheet and import them as a custom list. This is a great way to create a custom AutoFill list from existing headings or labels in your worksheet. You must remember, though, that the selected cells can only contain text (not numbers). To create a list using this method, just select the list items that you want from your worksheet, open the Custom Lists dialog, and click Import. (You can also display the dialog first, place your cursor in the Import box, and then select a range of data from the worksheet with your mouse.) When the correct cell range is entered into the Import box, click Import to create a list:

Once you have finished creating custom lists, click OK to close the dialog.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

360

Using a Custom AutoFill List


You can 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 your custom list. Next, select an adjacent cell and type the second item in your list. When you have entered enough data to allow Excel to identify your list, select the cells containing the entries you have made. Place your mouse pointer on the small square in the bottom right of the selection.

Your pointer should turn into a cross (+). Hold your mouse button down and drag over the cells that you want to fill with your list items. When you reach the end of your list entries, the list will be repeated from the beginning until you stop dragging:

You can just as easily AutoFill down columns as you can across rows.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

361

Modifying a Custom AutoFill List


You can make changes to a custom AutoFill list by invoking the Custom Lists dialog just as before. If you select a list from the Custom lists field on the left, you will see the individual list entries on the right:

In the List entries field, you can add new entries, remove individual items, or change existing entries. When you are finished modifying your custom list, click Add to implement the changes you made. You should see the new, modified list replace the original one in the field on the left.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

362

Deleting a Custom AutoFill List


To delete a custom list, select it from the area on the left and click Delete:

You will see the following warning:

When you click OK in, the list will be removed from Excel. Be careful because there is no way of recovering deleted lists! You will need to re-create it if you want to use it again.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

363

Lesson 4.4: Linking, Consolidating, and Combining Data


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 create a complete and unified picture of data even from information that may be in multiple places. In this lesson, you will learn about linking and consolidating workbooks and worksheets.

Linking Workbooks
As you know, a cell reference in Excel (like A7) simply refers to the cell at the intersection of column A and row 7. A cell reference like Store!A7 refers to the cell at column A and row 7 in the worksheet named Store. Taking this one step further, the reference [Sales.xlsx]Store!A7 refers to cell A7 in worksheet Store in the Sales workbook. This kind of linking can be useful if you have several sheets that reference the same pool of data. If you create links from the different sheets to the source data, the linked cells in the other worksheets or workbooks will be updated automatically when you update the source data. (It is important to note that both workbooks must be open at the same time for updating to occur.) To link two workbooks, open both of them. First, select source data from the source workbook. Next, click Home Copy. Now, switch workbooks and 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.) Click Paste Link:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

364

Alternatively, click Paste Special and then click Paste Link in the dialog:

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

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

365

Here are two different workbooks:

Cell F13 in the Workbook2 has been linked to cell B5 in Workbook1. As well, B3:B12 in the Workbook2 has been linked to the range I2:I11 in Workbook1.

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 and stored in different workbooks. Each workbook would have the same layout and structure (template), but the data

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

366

in each will be different. With Excel, you can consolidate the different workbooks, summarizing and totaling the data in one place to get a unified view of your information. To consolidate workbooks in Excel, first open the workbooks, and then 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, so that the destination worksheet has the same labels and uses 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.) Below you can see three open workbooks: DestinationWorkbook, WorkBookSource1, and WorkBookSource2. Notice that all three workbooks have a parallel structure in terms of columns, rows, and labels:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

367

To consolidate the workbooks, we will select cell B2 in DestinationWorkbook (the workbook with the empty cells) and choose Data Consolidate:

This will display the Consolidate dialog:

The Function menu contains a variety of functions that you can use to combine data. In this example, the default SUM function is used. The Reference box is where you enter the ranges of data to be consolidated. You can enter the ranges manually or by selecting them from the different workbooks with your mouse or keyboard. (The latter method is recommended as it is much easier.) Once a range is entered,

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

368

click Add to add it to the All references box. This field will contain all the workbook cell references that are to be consolidated. For this example, we will click the Reference box and select B2:E14 from WorkbookSource1. This range will be displayed in the Reference field in the Consolidate box. Clicking Add button will add it to the All references box. We will then select the same range from WorkBookSource2 and click Add. The Consolidate dialog now looks like this:

At the bottom of the dialog, you will notice the phrase Use labels in, with two checkboxes below it:

You can check these boxes to consolidate sheets based solely on row labels or column labels. That means that 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. (This is why consolidation can be is easier when all the worksheets involved have the same labels and design layout!) For this example, the checkboxes are empty so the consolidation will be based on the actual cell locations. If you check the Create links to source data box, the information in the destination workbook will be updated if the cell content in the contributing source workbooks is changed (like linking the workbooks).

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

369

When we click OK, the source workbook data will be consolidated and combined into the destination workbook:

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, right-click, and click Copy:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

370

Next, right-click on a cell in the destination worksheet (preferably at the upper left of the destination range) and click Paste Link or Paste Special:

(If you click Paste Special, the Paste Special dialog box will appear. When it does, click Paste Link. If you click the Paste Link command directly, you dont have to do anything else.) The linked data will now appear in the destination worksheet at the cell or range you specified:

Linking cells is one way of combining worksheet data. You can also consolidate multiple worksheets belonging to the same workbook. Consolidating worksheets in the same workbook is a lot like consolidating multiple different workbooks. First, set up your worksheets so they all have a similar layout. Next, select a cell at the upper left of the destination range and click Data Consolidate.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

371

In the Consolidate dialog, click in the Reference box, and then select a range of cells from another worksheet in the workbook. Click Add to add it to the All references box:

Add any additional references as necessary. If you want to link the data in addition to consolidating it (so that it is updated when changes are made to the source cells), select the Create links to source data box:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

372

Once you are ready, click OK. Your worksheets will now be consolidated in the destination range.

Pivoting Consolidated Data


To close off this lesson on linking and combining, we will now turn to the task of pivoting consolidated data. This method requires using the PivotTable and PivotChart Wizard, which is not accessible from the ribbon. First, press Alt + D. This should display the following message:

Now, let go of Alt + D and press the P key (think P for PivotTable). This should open the PivotTable and PivotChart wizard. To start, select the Multiple consolidation ranges radio button. In this example, the PivotChart report (with PivotTable report) option is also selected. This will automatically create a PivotChart and a PivotTable based on a consolidation of the data ranges to be specified.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

373

Click Next. In this step of the wizard, you can have a single page field created automatically, or you can choose to create your own page fields.

Since we are creating a PivotTable and PivotChart based on consolidated ranges, it might be difficult to create page fields that are effective for both. Also, remember that only numerical data can be consolidated, so any text labels that are not row labels or column labels in the source data will not appear in the consolidated data. (You will see a column or row of zeros instead of text.) However, for this example, we will accept the default option: Create a single page field for me.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

374

Once you are ready, click Next. You will now choose the ranges to consolidate:

This works just like the process used for standard data consolidation. First, click in the Range box, and then select a range of data. Remember: The data should be in a table-like format, with no empty columns. The column labels and the row labels in the range will be carried over to the resulting PivotTable, but any other text will not be. All of the ranges should have the same basic structure and the same column and row labels.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

375

When a range has been chosen, click Add to add the range to the All ranges area. The following image shows the wizard dialog after four ranges have been added for consolidation.

This image shows the same four ranges of data as they appear in four separate worksheets:

Notice how the ranges have the same column and row headings, and the same table-like structure.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

376

Once you are ready to proceed to the final stage of the wizard, click Next. In this step of the wizard, you can choose to display the PivotTable report either in an existing worksheet, or a new worksheet:

You can see that we have chosen a new worksheet. To create the PivotTable/PivotChart report, click Finish. Here is the resulting PivotTable, PivotChart, and Field List for the consolidated data:

The PivotTable and the PivotChart reflect the sum of the corresponding data values in the source worksheets. (The SUM function is the default option and cannot be changed in the wizard.)

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

377

Because we have a PivotTable and PivotChart, we can use Slicers to help analyze the consolidated data. To do this, click in the PivotChart and click Analyze Insert Slicer:

For this example, we will select the Row and Column fields (which contain text labels):

Once we click OK we will see the Slicers:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

378

Now the consolidated data can be analyzed by clicking the various field labels in the Slicers. For example, here is the Slicer arrangement to show the Production Capacity and the Units Shipped for Product 2 and Product 5, and the results:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

379

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.

Why is VLOOKUP used more than HLOOKUP? Because HLOOKUP is slow compared to VLOOKUP Because you can only use HLOOKUP with numerical data Because most often, worksheet data is logically arranged in vertical columns There is no such thing as HLOOKUP Which function might you use to calculate the eventual worth of an investment plan? PMT FV An array formula Any of the above When using the FV or PMT functions with monthly payments and an annual interest rate of 6%, you would use which of the following interest rate arguments? .6 6% * 12 6% 6%/12 Which three functions can be used to consolidate data? Average, Correlation, Count Sum, Future Value, Max Sum, Average, Count Average, Sum, PMT Which error type will prevent the Sum function from working? Division by zero Value error Both of the above Neither of the above; the Sum function will work regardless of errors What key combination do you use to enter a function or formula as an array formula? Ctrl + Shift + Enter Ctrl + Alt + Enter Alt + D + P Ctrl + A

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

380

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

What key combination do you use in Excel 2010 to invoke the PivotTable/PivotChart wizard? Ctrl + Shift + Enter Alt + D and then P Ctrl + P Ctrl + C What argument would you include in the VLOOKUP function to find an exact match to the lookup key? True Exact False Find How can you recognize an array formula in Excel? {formula or function} (formula or function) [formula or function] /formula or function/ Which of the following statements is true about custom AutoFill lists? They do not need to change by a fixed increment They can include text and text/number combinations They work the same way as default AutoFill lists All of the above

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

381

Section 5: Macros, Visual Basic, and Excel Programming


In this section you will learn how to: Record, edit, and play a macro Modify macro security settings Use the Visual Basic Editor when working with macros Add code and comments to macros Use and record relative reference macros Assign a keystroke to a macro Copy a macro from a workbook or template Declare variables Iterate over a range Prompt for user input Use If, Then, and Else Statements

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

382

Lesson 5.1: Creating a Basic Macro


Like other applications in the Microsoft Office family, Microsoft Excel has the ability to use macros. Macros are very useful if you perform a task repeatedly, as they are used to automate processes and increase productivity. In this lesson, we will explore the basics of macros.

Recording a Macro
The first step in the creation of a macro is to record one. When a macro is being recorded, Excel will store any action in the Excel window in the macro that you are creating. When you have completed all the actions that need to be recorded, you will stop recording. Now you can run this macro to repeat the recorded actions as necessary. To record a macro, click View Macros Record Macro:

The Record Macro dialog should open:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

383

In this dialog, you can choose a name for the macro that you will be recording, where this new macro will be stored, and add a description of its actions to it. When you are ready to record a macro select the OK button. Once the OK button has been selected Excel will then record all of your actions inside the Excel window. Once you have completed all of the actions that you need included in the macro, select the Macros drop-down command again, and click Stop Recording:

At this point the new macro will be complete.

Editing a Macro
Once a macro has been recorded, you can edit it easily in Excel. First, click the Macros dropdown command, and then click View Macros:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

384

Then the Macro dialog should open:

Select the macro that you would like to edit from the list and click the Edit command on the right:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

385

Then the selected macro will open in Microsoft Visual Basic for Applications. We will cover how to work with this application later on in this section.

Running a Macro
Once a macro has been recorded, you can run it at any time by clicking the Macros command directly on the View tab:

Selecting this will the launch the Macro dialog, in which you can choose the macro that you would like to run. After you have chosen a macro, click the Run button:

The selected macro will then complete the tasks that you have previously recorded. As you can see, this can greatly improve efficiency when working with long, repetitive tasks in Excel. With one click you can complete dozens of steps in just a few seconds!

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

386

Understanding Macro Security


Excel includes several safeguards that help protect you against viruses that can be transmitted through macros. One of the most important safeguards that Excel uses is the digital signature; these are used so that users can verify that macros are from a trustworthy source. If you open a workbook that contains macros, you can verify their source before enabling them. This can help prevent virus infection as macros from untrustworthy sources are at high risk of containing malicious code. Instructor Tip: Microsoft Excel security settings may be applied at an administrative level. Therefore, as a general user, you may not have access to these settings. If this is the case, you must contact your network administrator to change these settings. To access macro security settings, there are two methods that you can use. The first is to use the Developer tab. This tab is disabled by default. To enable it, click File Options:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

387

Then, navigate to the Customize Ribbon category and select the check box beside Developer:

Click OK to implement your changes. You can now access macro security settings by clicking the Macro Security command inside the Code group:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

388

The second way to open this dialog is to click File Options, and then click the Trust Center category. Click the Trust Center Setting button:

The Trust Center dialog window will then be open on your screen. Select the Macro Settings category if it has not already been selected. No matter which method you use to open this window, it will look similar to this image:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

389

Inside this dialog, you want to concentrate on the Macro Settings section. Here there are four radio buttons to choose from; each of these options handles macros in different ways.

These four buttons are arranged in descending order by most secure to least secure, with the default setting being Disable all macros with notification. The default settings are a happy medium between disabling all macros and enabling all macros. If you disable all macros, you will not be able to use macros at all, losing any functionality that is provided by them. However, enabling all macros is very dangerous; this setting will greatly increase the risk of running malicious macros. The middle two options are generally the more commonly selected. The third option, Disable all macros except digitally signed macros, is a good choice. This will run any macro that has been digitally signed by its author, but not any that are unsigned. This ensures that the macro being run is from a trusted source. Back inside the Trust Center dialog, you may have noticed a checkbox under the Developer Macro Settings section:

This checkbox is used to control access to the VBA object model from any macro. By ensuring that this box is deselected, you can prevent malicious code from self-replicating. If there is a macro that requires access to this object model, this check box must be selected. By default it is deselected, and is best left as such, unless in unique circumstances.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

390

Lesson 5.2: Visual Basic and Macros


In this lesson, we will delve deeper into macros with Visual Basic for Applications. We will first go over the Visual Basic Editor. Then, we will explore how to add code and comments to your macros.

Opening the Visual Basic Editor


Like many other functions in Excel, there are a number of ways to open Microsoft Visual Basic for Applications (VBA). The most common method is to use the Macro dialog box, which can be accessed by selecting View Macros inside the Macros drop-down command on the View tab:

When you have the Macro dialog open, you can then select the macro that you would like to open in VBA, and then click the Edit button:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

391

The Visual Basic Editor will then open on your screen with the macro code available for editing:

Another way to open the editor quickly is to open the workbook that contains the macro that you would like to edit, and then press Alt + F11 on your keyboard. Either method can be used when you are ready to edit a macro in VBA.

Understanding the Visual Basic Editor


Once the Visual Basic Editor opens, it may be a little overwhelming at first, as it does appear very complex. It includes a wide variety of options to edit your macro and a variety of different views. For this lesson, we will only focus on specific components inside VBA that are used to create and edit your macro.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

392

When the Visual Basic Editor is opened while using Excel, you will see some code inside the workspace (as long as the workbook contains a macro):

This is the code for the macro in the workbook that you have open in Excel. In this example, it is fairly short as the macro completed a simple function. (The more complex a macro is, the longer the code.) You can view the whole workbook by looking inside the Project pane at the top left of the window:

As you can see, there is an entry for each sheet inside the workbook, under the Microsoft Excel Objects folder. Any macros that are in this workbook are listed under the Modules folder. You can open any of these objects by double-clicking on them within the pane.
2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

393

The area that we will be focusing on will be the workspace inside the editing window, as this is where any new code is added or existing code edited. It should be noted that you do not need to save modified code; it will be saved when the workbook itself is saved using Excel.

Adding Code to your Macro


Adding code to your macro is a fairly straight forward process when using the Visual Basic Editor. You need to only place your cursor to where you would like the code to be inserted and enter it. When you are done, close the editor window and the new code will be applied.

VBA allows you much more control over your macros, as it allows you to tailor its underlying code to your needs. To edit existing code, you will require some familiarity with Visual Basic code syntax, but we will cover some of the basic elements of VB code in the next lesson.

Adding Comments to Visual Basic Code


If you have used any type of computer code language before, then you should be familiar with comments. Comments can be thought of as notes that are added to the code. These notes can contain whatever you would like, such as reminders and notices to those other than yourself who may modify this code.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

394

You have probably already seen comments in Visual Basic yourself, but you may not have realized it. Comments appear as green text inside the VBA workspace and are preceded by an apostrophe ():

When an apostrophe has been placed at the start of a line, anything on that line will become a comment and not recognized by VBA as code, so it will be ignored. This means that if you would like to disable a line of code, but not remove it, you can comment it out. Just place an apostrophe at the beginning line of that code:

It should be noted that when creating a comment line it will not change to green until you move your cursor off of that line.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

395

Lesson 5.3: More Macro Tasks


There are a number of more advanced settings that can be taken advantage of when creating a macro. In this lesson, we will cover relative reference macros, as well as how to copy macros and assign keystrokes.

What are Relative References?


When you use Excel to record a macro it will record only what you did, not how you did it. This works for most types of macros that you will be creating, but not all. What do you need to do if you wanted a macro to record in more detail? Imagine that you would like to move from cell A1 to cell C1; you can do this by pressing the right arrow key on your keyboard. By default Excel will not record that this key was used; instead, it only records that C1 has been selected. Now imagine that you have recorded these actions, but you would like to use this macro on A2 so that it would select C2. However, when the macro is executed, C1 will be selected. This is because instead of recording that you moved two cells to the right, it only knows that C1 has been selected. To remedy this issue, Excel includes the ability to record macros relatively. If we recorded the macro created above using relative references, it would know to move to the right of any cell selected, instead of blindly selecting C1 all the time.

Recording a Relative Reference Macro


If you would like to record a macro relatively, relative references need to be enabled. You can do this by selecting Use Relative References from the Macros drop-down command on the View tab:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

396

You are able to see when Relative References has been enabled by a slight border around the icon:

When Relative References has been enabled, you can then record your macro just as if you would record any other: by selecting Record Macro from the Macros drop-down command. When you are done recording this macro, select the Stop Recording option from the same drop-down. The only difference is that everything you do will be relative, so you cannot make changes to a specific cell.

Running a Relative Reference Macro


Running a relative reference macro is slightly different than running a regular macro. You need to be aware of what cell you have selected, as everything that the macro will do will be relative to that cell. When you have the proper cell selected, you can then go through the process of selecting the Macros drop-down command, selecting View Macros from the menu, choosing the macro that you would like to use, and then clicking Run.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

397

The key is to always remember that the macro will run relative to your starting cell. In this example the macro that was used turns the fourth cell from the right of the starting cell yellow:

The red boxes denote the starting point from which the macro was run. As you can see, its all relative to the starting position.

Assigning a Keyboard Shortcut to a Macro


One of the more useful settings to keep in mind when creating a macro with Excel is the ability to assign a shortcut key to your macro. This allows you to use macros even faster by bypassing the Macros drop-down command and using a keyboard shortcut to run a macro. You can assign a shortcut key when creating a macro or after the fact. When creating a macro, you may have noticed a field labeled Shortcut key inside the Record Macro dialog box:

Inside this field you can type any letter that you like. Once a letter has been entered, you can run this macro by pressing and holding Ctrl and then tapping the letter that you have chosen. Be mindful that if you insert a letter that is already used in a standard Excel keyboard shortcut, such as Undo (Ctrl + Z), it will be overwritten by this shortcut.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

398

You may also apply a shortcut to an existing macro by opening the Macro dialog box and then clicking on the Options button:

The Macro Options dialog box should then open:

As you can see, this dialog box has the same Shortcut key field as you saw previously when creating a new macro. Simply type the letter that you would like to assign to this new shortcut and click OK to apply it.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

399

Copying a Macro from a Workbook or Template


Unfortunately, there is no simple way to copy a macro from a workbook or template within Excel itself. You must use the Visual Basic Editor, which is included with Microsoft Office. First, ensure that the workbook with the macro that you want to copy is open in Excel. With the right workbook open, press Alt + F11 on your keyboard. (This is a great shortcut to remember as it is a quick way to open the Visual Basic Editor.) When the editor is open, you should see a screen similar to this:

Next, place your cursor inside the workspace containing the code and press Ctrl + A on your keyboard to select all the code. Once all the code is selected, press Ctrl + C to copy it.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

400

Now open the workbook that will use the copied macro. You should now see that Excel workbook available in the original VBA window, inside the Project pane on the left. Select it to expand its contents:

Because there is no macro on this workbook, you need to create a module to hold the one that we are copying.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

401

Click the Insert menu and then click Module from the list:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

402

With the new module created, the workspace will select it. It will be blank as there is no code inside it yet. Right-click inside the workspace and select Paste:

The code that you copied from the previous workbook should now be pasted inside the current workspace. You can now press Alt + F11 again to close the VBA window.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

403

Now, click View Macros to verify that the operation worked. You should see the copied macro inside the Macro window, ready to be used:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

404

Lesson 5.4: Advanced Visual Basic Tasks


Now that we have covered the basics of how to use Visual Basic for Applications, we are going to examine it in more detail. In this lesson, we are going to focus on the code used for macros in Excel. By the end of this lesson you should have a good idea of how to declare variables and much more.

Declaring Variables
Simply put, variables are containers that are used to store values (data). In Excel, this variable can be declared as any type, describing the kind of values that they hold. For example, a variable that has been declared as an integer can only contain numerical digits, without decimal points. There are a number of other data types to choose from, including string, Boolean, and date data types. Here is a basic example of declaring a variable in Microsoft Visual Basic for Applications:

This example can be broken down like this. The first line Dim x As Integer, creates a variable x, and then declares it as an Integer data type. (Remember that an integer data type is applied when only whole numbers are used.) The second line, x = 2, is where the variable is assigned a value. The third line states that the value of cell A1 on the workbook will be that of x, or by extension, 2.

Iteration over a Range


When creating a macro, you may have requirements to insert a particular value amongst a range of cells on the Excel worksheet. You wouldnt want to do thi s manually as it is quite time consuming, but luckily a macro can be made to do that quite easily! Lets look at the code for such a macro:

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

405

As you can see, you only need just a few lines to complete this macro. Lets fo cus on the first line of code:

You will recognize a few items on this line. First, a variable has been declared (cell). The remainder of this line is telling the macro to look inside the Sheet1 worksheet, between cells A1 and F5. To complete this, a Range attribute has been used, which will select all cells between the first one, and the second. The next line defines the values for all cells within the previously mentioned range as 123456:

The result will look like the image below:

As you can see, this can be a very powerful tool. By mastering ranges you can greatly increase the speed at which Excel spreadsheets are completed.

Prompting for User Input


Excel has the built-in ability to prompt the user for input using macros. This will usually take the form of a dialog box that will appear in the middle of the users screen. Inside this dialog box, the user will be able to enter information which will be used with the current workbook.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

406

Lets look at a basic example of a user input dialog:

For this example, suppose that this dialog will appear when a particular macro is run. The user would then enter any number and click the OK button. Then, the number inside this dialog will be placed as the value inside a specific cell on the current Excel sheet:

In this case, 42 has been added as a value for cell C1. Now lets examine the underlying code that controls user input when coding macros in VBA.

As you can see, there is not much to it. The first line defines a variable and a variable type, which in this case is an integer. The next line is what controls the user input:

This line is declaring that the Number variable is whatever number is entered inside the input box. The InputBox section of this line controls the dialog itself. Using InputBox you can add text inside the box (Please enter a number), as well as header text for the dialog (A number is required).

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

407

The next line is telling the macro where the information entered into the input box will be placed. In this case, C1 has been chosen as this cell:

The last line in this chunk of code declares that the current cell that has been selected (which was declared in the previous line) will contain whatever value is held by the Number value:

Using If, Then, and Else Statements


The most commonly-used statements that you will see when working with macros are the IF, Then, and Else statements. These types of statements are usually called conditional statements. They are called as such because they are used to execute code when specific conditions have been met. For example, if you were working with a worksheet that contained numerical employee performance test results, you can create a conditional statement that will display if the employees scored poorly, good, or very good. Lets examine some code that will do part of what the above example describes.

As with the other macros that we have covered so far, the top part of the code is used to declare any variable types that are required for this macro. We would like to concentrate on the lines below these declarations:

This line declares a value of the performance variable. This is the variable that will hold the numerical grade that has been entered into cell A1.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

408

Now lets start examining the If, Then statement on the ne xt line:

The initial portion of this line states that if the value that has been pulled from the workbook and stored in the performance variable is equal to or greater than 80, then this section of code will run. This is where the Then portion of this statement comes into to play. If a score of 80 or higher has been entered as a value, then the value for the result variable will become very good. The last portion of this code will insert the value of the result variable into cell B1:

The Else statement is not found in this example because it works like the Then statement, just in an opposite fashion. For example, lets return to the employee performance test results example. You can create a statement that will run if the value found in a range is greater than or equal to 80. These values will display very good, whereas everything else will display fail:

By simply adding Else to the end of an If, Then line, you have created an Else statement. If you do use an Else statement, you should enter End If below this line.

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

409

Section 5: 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.

What is relative reference used for? To run a macro on a specifically selected cell To run a macro in relation to what cell has been selected To run a macro that is in reference to another None of the above What syntax does Microsoft Visual Basic for Applications use? C++ ASP Java Visual Basic What occurs when you record a macro? All steps taken by you in the Excel window are played back Whatever you type in the Excel window is recorded All steps taken by you in the Excel window are recorded All of the above What color are comments in Visual Basic for Applications? Red Blue Yellow Green What does it mean to assign a keystroke to a macro? To assign a shortcut (e.g. Ctrl + E) To add another step to the macro To add an action to the macro To record using relative reference What is the keyboard shortcut to open VBA? Ctrl + F4 Ctrl + V Alt + F11 Alt + F12

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

410

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

To run a macro, what are the steps that you need to follow? Click the Macro drop-down command, click View Macros, click the macro from the list, and click Run Click the Macro drop-down command, Click View Macros, click the macro from the list, and click Edit Click the Macro drop-down command, Click View Macros, click the macro from the list, and click Step Into Press Alt + F11 What is one of the key components of macro security in Excel? Data types Save settings Digital signatures All of the above What best describes a variable? A value A container A data type An attribute Which of these data types are valid in VBA? String Boolean Date All of the above

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

411

Index
Add-Ins .........................................................................................................See Data Analysis Tools Analysis ToolPak.......................................................................................30, 35, 40, 41, 43, 45, 101 Array Formula ..................................................................................... 329, 344, 345, 352, 353, 379 AutoFill List Creating a custom list ............................................................................................................. 358 Creating from imported data .................................................................................................. 359 Editing ..................................................................................................................................... 361 Using ....................................................................................................................................... 360 What is? .................................................................................................................................. 355 Classic PivotTable Adding fields ........................................................................................................................... 190 Pivoting data ........................................................................................................................... 192 Removing fields ............................................................................................................... 192, 195 Setting PivotTable Layout ....................................................................................................... 188 Combining Worksheets ............................................................................................................... 369 Consolidating Workbooks ........................................................................................................... 365 Consolidation options ............................................................................................................. 368 Pivoting consolidated data ............................................................................................. 372, 376 Data Analysis Tools Anova tool ................................................................................................................................. 36 Correlation tool ......................................................................................................................... 37 Default add-ins .......................................................................................................................... 34 Enabling..................................................................................................................................... 32 Help ........................................................................................................................................... 44 Random Number Generation tool ............................................................................................ 40 Rank and Percentile tool ........................................................................................................... 41 Solver tool ................................................................................................................................. 50 Data Tables One input .................................................................................................................................. 50 Specifying one input ................................................................................................................. 54 Specifying two inputs ................................................................................................................ 57 Two input .................................................................................................................................. 50 What are?.................................................................................................................................. 50 Euro Currency Tools ................................................................................................................ 45, 48 Excel Options Dialog ........................................................................................................... 386, 388 Function Arguments Dialog .................................................................................................. 98, 349 FV Function Arguments............................................................................................................................... 333 Using ....................................................................................................................................... 334 What is? .................................................................................................................................. 333

2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

412

Goal Seek..................................................................................................3, 61, 62, 63, 65, 100, 101 Computing goals ....................................................................................................................... 63 Parameters ................................................................................................................................ 62 With Solver................................................................................................................................ 77 Grouping ......................................................................................................................................... 4 Manual grouping ....................................................................................................................... 10 Removing grouping ................................................................................................................... 12 Show/hide data ........................................................................................................................... 7 HLOOKUP Function ..................................................................................................... 329, 346, 379 What is? .................................................................................................................................. 346 Hyperlinks Alternate text ............................................................................................................................ 83 Hyperlink function .................................................................................................................... 97 Images as hyperlinks ................................................................................................................. 99 Insert Hyperlink dialog .............................................................................................................. 81 Inserting .................................................................................................................................... 80 Place in document .................................................................................................................... 86 Removing .................................................................................................................................. 97 ScreenTip................................................................................................................................... 85 Styling ........................................................................................................................................ 90 Using ......................................................................................................................................... 94 What are?.................................................................................................................................. 79 Insert Function Dialog ................................................................................................... 97, 348, 349 Logic Functions............................................................................................................................ 334 AND ......................................................................................................................................... 334 AND truth table ....................................................................................................................... 335 FALSE ....................................................................................................................................... 336 IF 337 IFERROR................................................................................................................................... 337 IFERROR and array formulas ................................................................................................... 341 NOT ......................................................................................................................................... 335 NOT truth table ....................................................................................................................... 336 OR ............................................................................................................................................ 335 OR truth table ......................................................................................................................... 335 TRUE ........................................................................................................................................ 336 Using ....................................................................................................................................... 339 Macro Adding code to ........................................................................................................................ 393 Assigning shortcut key to ........................................................................................................ 397 Commenting............................................................................................................................ 394 Copying between workbooks ................................................................................................. 399 Editing ............................................................................................................................. 383, 390 Macro Dialog ........................................................................................................... 384, 390, 398 Prompting for input ................................................................................................................ 406
2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

413

Record Macro dialog ....................................................................................................... 382, 397 Recording ................................................................................................................................ 382 Relative reference ........................................................................................... 381, 395, 396, 409 Running ................................................................................................................................... 385 Security ................................................................................................................................... 386 Microsoft Office Access 2010 .94, 96, 102, 105, 201, 202, 203, 221, 222, 229, 230, 232, 233, 303, 306, 307, 320, 328 Microsoft Office Word 2010 ......................................................................1, 33, 79, 80, 94, 95, 328 Microsoft Visual Basic for Applications ........................................................ See Visual Basic Editor Outlining................................................................................................................................ 4, 6, 10 Applying ...................................................................................................................................... 5 Clearing ....................................................................................................................................... 7 PivotChart Adding data ............................................................................................................................. 243 And PowerPivot ...................................................................................................................... 319 Chart types .............................................................................................................................. 241 Creating ................................................................................................................................... 240 External data source ....................................................................................................... 302, 307 Pivoting data ........................................................................................................... 245, 249, 252 Scenario PivotChart......................................................................................................... 312, 316 Slicer ................................................................................................................................ 309, 311 Slicer Connections ................................................................................................................... 312 What are?................................................................................................................................ 239 PivotChart Formatting Axes titles ................................................................................................................................ 297 Chart background.................................................................................................................... 288 Chart layout............................................................................................................................. 295 Chart title ................................................................................................................................ 296 Chart type ....................................................................................................................... 275, 278 Choosing the right chart type ................................................................................................. 278 Data tables .............................................................................................................................. 300 Editing shapes ......................................................................................................................... 285 Gridlines .................................................................................................................................. 301 Legend ..................................................................................................................................... 297 Renaming fields....................................................................................................................... 272 Styles ....................................................................................................................................... 281 PivotChart Tools Analysis ................................................................................................................................... 262 Chart backgrounds .................................................................................................................. 262 Chart layouts ........................................................................................................................... 256 Chart styles.............................................................................................................................. 256 Chart types .............................................................................................................................. 253 Insert object ............................................................................................................................ 259 Labels ...................................................................................................................................... 259
2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

414

Shape styles ............................................................................................................................ 263 Size .......................................................................................................................................... 267 Slicer ........................................................................................................................................ 269 WordArt .................................................................................................................................. 264 PivotTable Adding/removing fields........................................................................................................... 117 Changing source data.............................................................................................................. 112 Changing to classic layout ....................................................................................................... 188 Clearing ................................................................................................................................... 112 Creating ................................................................................................................................... 104 Creating from external data.................................................................................................... 196 Creating in PowerPivot ........................................................................................................... 231 Data source ............................................................................................................................. 105 Defining fields ......................................................................................................................... 106 Defining range ......................................................................................................................... 106 Expand/collapse data ...................................................................................................... 134, 135 External data warning ............................................................................................................. 205 Field List .................................................................................................................................. 117 Field Settings ........................................................................................................................... 110 Importing data ........................................................................................................................ 200 Managing external data connections ..................................................................................... 199 Naming .................................................................................................................................... 109 Pivoting data ........................................................................................................................... 128 PivotTable Options dialog ....................................................................................................... 182 PivotTable Tools tabs .............................................................................................................. 108 Refreshing data ............................................................................................................... 112, 205 Report Filter box ..................................................................................................................... 124 Selecting elements .................................................................................................................. 112 Show Values As ....................................................................................................................... 113 Show/hide elements ............................................................................................................... 114 Summarizing values ................................................................................................................ 113 Using Access data............................................................................................................ 201, 203 What is pivoting? .................................................................................................................... 123 What is? .................................................................................................................................. 103 PivotTable Data AutoSort .................................................................................................................................. 145 Changing source data.............................................................................................................. 154 Clearing filters ......................................................................................................................... 138 Filtering data ................................................................................................................... 136, 137 Group Selection ...................................................................................................................... 149 Grouping ................................................................................................................................. 148 Label Filters ............................................................................................................................. 138 Refreshing data ............................................................................................................... 150, 153 Sort By Value dialog ................................................................................................................ 147
2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

415

Sorting data ..................................................................................................................... 143, 144 Ungrouping ............................................................................................................................. 150 Value Filters ............................................................................................................................ 139 PivotTable Formatting Automatic subtotals ................................................................................................................ 159 Compact form ......................................................................................................................... 161 Data calculations ..................................................................................................................... 168 Field Settings ........................................................................................................................... 158 Grand Totals ............................................................................................................................ 175 Manual formatting .................................................................................................................. 180 Number formatting ................................................................................................................. 170 Report Layout.......................................................................................................................... 175 Subtotals ................................................................................................................................. 173 Table layouts ........................................................................................................................... 171 Tabular form ........................................................................................................................... 162 PMT Function Arguments............................................................................................................................... 330 What is? .................................................................................................................................. 330 PowerPivot ......1, 102, 196, 218, 219, 220, 222, 226, 229, 230, 231, 236, 238, 302, 319, 323, 324, 326, 328 Creating PivotTable ................................................................................................................. 231 Creating relationships ..................................................................................................... 230, 231 Downloading and installing..................................................................................................... 218 Importing data ........................................................................................................ 221, 226, 228 Opening ................................................................................................................................... 221 Refreshing data ....................................................................................................................... 235 System requirements .............................................................................................................. 218 Viewing data ........................................................................................................................... 234 Scenarios Choosing a scenario .................................................................................................................. 22 Creating ..................................................................................................................................... 19 Creating with Solver .................................................................................................................. 74 Creation options ....................................................................................................................... 20 Editing ....................................................................................................................................... 23 Merge details ............................................................................................................................ 26 Merging ..................................................................................................................................... 24 Scenario Manager ............................................................18, 19, 22, 23, 24, 26, 27, 28, 313, 314 Summary report ........................................................................................................................ 28 Using multiple ........................................................................................................................... 22 What are?.................................................................................................................................. 17 Selection Pane..................................................................................................................... 216, 267 Slicer .................................................1, 102, 206, 209, 213, 214, 238, 269, 309, 325, 326, 377, 378 Arranging................................................................................................................................. 215 Changing PivotTable association ............................................................................................ 214
2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

416

Formatting .............................................................................................................................. 217 Inserting .................................................................................................................................. 206 Moving ............................................................................................................................ 208, 209 Settings.................................................................................................................................... 213 Styles ....................................................................................................................................... 214 Using multiple Slicers .............................................................................................................. 212 With scenario PivotCharts ...................................................................................................... 317 Solver ......................... 3, 30, 34, 35, 45, 50, 65, 66, 67, 68, 71, 72, 73, 74, 75, 76, 77, 78, 100, 101 Adding constraints .................................................................................................................... 70 And scenarios ............................................................................................................................ 74 As advanced goal seek tool ....................................................................................................... 77 Changing parameters ................................................................................................................ 76 Defining constraints .................................................................................................................. 66 Enabling..................................................................................................................................... 65 Executing the operation............................................................................................................ 73 Generating reports.................................................................................................................... 74 Identifying goal ......................................................................................................................... 66 Modifying values ....................................................................................................................... 75 Objective formula ..................................................................................................................... 67 Results dialog ............................................................................................................................ 73 Setting changing cells................................................................................................................ 69 Setting constraints .................................................................................................................... 70 Setting objective ....................................................................................................................... 69 Solver Parameters dialog .......................................................................................................... 69 Solving methods........................................................................................................................ 76 What is? .................................................................................................................................... 65 Subtotals Adding ....................................................................................................................................... 13 Grouping and ............................................................................................................................ 16 Options ...................................................................................................................................... 14 Removing .................................................................................................................................. 16 Trust Center ........................................................................................................................ 388, 389 Visual Basic Code snippets.......................................................................................................................... 407 Comments ............................................................................................................................... 394 Conditional statements........................................................................................................... 407 ELSE statements ...................................................................................................................... 407 IF statements .......................................................................................................................... 407 Input Box ................................................................................................................................. 405 Iteration .................................................................................................................................. 404 Restricting access to object model ......................................................................................... 389 THEN statements .................................................................................................................... 407 Variables.................................................................................................................................. 404 Visual Basic Editor ....................................................................................... 381, 390, 391, 393, 399
2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced

417

Keyboard shortcut for ............................................................................................................. 391 Opening ................................................................................................................................... 391 Project pane ............................................................................................................................ 392 Viewing objects ....................................................................................................................... 392 Workspace .............................................................................................................................. 392 VLOOKUP Function ............................................. 329, 346, 347, 348, 349, 350, 352, 353, 379, 380 As an array formula......................................................................................................... 352, 354 Finding an approximate match ............................................................................................... 350 Finding an exact match ........................................................................................................... 349 Using ....................................................................................................................................... 347 What is? .................................................................................................................................. 346 What-If Analysis .......................................................................................... 18, 26, 28, 54, 100, 313 Data Table ................................................................................................................................. 59 Goal Seek................................................................................................................................... 62

2005-2011 Velsoft Training Materials, Inc.

You might also like