Start learning with our library of video tutorials taught by experts. Get started

Excel 2008 for Mac: Pivot Tables for Data Analysis

Using data in a formula


From:

Excel 2008 for Mac: Pivot Tables for Data Analysis

with Curt Frye

Video: Using data in a formula

When you create a formula, it's usually a good idea to draw the formula's values from the original data source. That way, if the source changes, your formula's result will update the next time Excel recalculates your workbook. But what do you do if your Pivot Table contains data drawn from an outside source and you can't get out the original tables? In that case, you can refer to a cell within the Pivot Table using a GetPivotData formula. I will work my first example on the same worksheet as the Pivot Table so you can follow along more easily, and then I will create a more realistic example on another worksheet. A GetPivotData formula uses two arguments.

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
Please wait...
Excel 2008 for Mac: Pivot Tables for Data Analysis
1h 6m Intermediate Sep 22, 2009

Viewers: in countries Watching now:

In Excel 2008 for Mac: Pivot Tables for Data Analysis, Microsoft Most Valuable Professional Curt Frye helps dispel the common fear of the Pivot Table feature, demonstrating how to use this powerful tool to discover valuable business intelligence. Curt shows how to create Pivot Table reports from internal Excel data and outside data sources, use filters to focus on the most important data in the sheet, and prepare a Pivot Table report by applying formats and rules. Exercise files accompany this course.

Topics include:
  • Sorting across data sources to show relative importance Adding, removing, and positioning subtotals and grand totals Creating conditional formats to highlight subsets of data Using color scales to emphasize specific information Adding a trendline to a PivotChart report Updating and refreshing PivotTable data sources
Subjects:
Business Data Analysis
Software:
Excel Excel for Mac
Author:
Curt Frye

Using data in a formula

When you create a formula, it's usually a good idea to draw the formula's values from the original data source. That way, if the source changes, your formula's result will update the next time Excel recalculates your workbook. But what do you do if your Pivot Table contains data drawn from an outside source and you can't get out the original tables? In that case, you can refer to a cell within the Pivot Table using a GetPivotData formula. I will work my first example on the same worksheet as the Pivot Table so you can follow along more easily, and then I will create a more realistic example on another worksheet. A GetPivotData formula uses two arguments.

First I will type in the function name and left parenthesis, and the two arguments that the GetPivotData function takes are Pivot_Table and the name. Pivot Table refers to any cell within the Pivot Table. I always use the cell at the top left corner of the Pivot Table, in this case cell A3, because I know it's not going to change. Regardless of how I pivot and rearrange the body of the Pivot Table, cell A3 will remain constant, and will always be within the area of the Pivot Table. So that's what I type: A3.

Name is a little more complicated, so I will just walk you through it. Name is a string, which you identify by enclosing in double quotation marks. The Name argument contains the values in the row and column areas that Excel uses to identify a particular cell within the Pivot Table. So say, for example, that I wanted to find the value in C5, which has 2008, January, and FirmA, as the values that you used to hone in on it. So, I type in 2008, a space - no comma just a space - January, FirmA, Double quotes. Close the parentheses. Return. And there you have the value, 67 and 67.

You are not limited to creating GetPivotData functions that point to cells at the lowest level of organization within a Pivot Table. Say, for example, that I wanted to find the total for 2008 in January for both FirmA and FirmB. To do that, I can edit my formula to remove the reference to FirmA. And I am left with 2008 January, which corresponds to this row here, with a Grand Total of 197. When I hit Return, the same value appears as the formula's result. And just to conclude the example string, if I wanted to find the total for 2008, I can just create a function that looks like that. Hit Return.

And I have the value of 1887, which is the 2008 total, also found here in cell E17. One nice thing about creating GetPivotData functions is that you don't need to have the fields in the same order in which they appear in the body of the Pivot Table. So, let's say, for example, that I wanted to find the value for 2008, January, FirmA, but I want to put them in a different order. I can do that, just so long as Excel is able to identify which columns and which rows point to the cell that I am interested in.

So for example, if I put in "FirmA January 2008", hit Return, I get the same result, 67. Just like it's supposed to be. You can also use GetPivotData functions to provide arguments for formulas. As an example, let's look at the summary worksheet that I have created here called Dashboard. On the summary Dashboard, I have created functions that find the total sales for FirmA in 2008, and the same for FirmB in 2008, and FirmA and FirmB in 2009.

One thing I would like to point out, in this formula, is that because the Pivot Table that contains the data I am using in this function comes from another worksheet, I had to put Sheet1 at the front of the cell identifier. So I have Sheet1, which is the name of the worksheet where the Pivot Table resides, an exclamation mark indicating that I have stopped typing in the name of the worksheet. I am about to type the name of the cell, and then A3, which is the name of the cell. And then the second argument gives me FirmA 2008, which reflects the data that I want to use in this cell.

Hit Escape to stop editing the function. If I wanted to create a function that used more than one Pivot Table data point, I can do so by separating the values with commas. So let's say that I wanted to find the average in 2009 of the sales for FirmA and FirmB. To do that, I would type = to start the formula, type in Average, left parenthesis. And then as the first argument I will type in GetPivotData, left parenthesis, and then Pivot Table identifier: Sheet1, exclamation mark, A3, the cell at the top-left corner.

And then I am looking for FirmA 2009. Close the parenthesis, but this is just for the first value used in the average formula. Type a comma, now I have GetPivotData, left parenthesis, Sheet1, A3, FirmB 2009, double quotes. Close the parenthesis. Close the parenthesis again, so that now I've created an average formula with two arguments. Hit Return.

And I get the correct answer of 898. The GetPivotData function makes it easy to summarize Pivot Table data in your worksheets. If it's not practical to draw the data from the original source, you can always use the Pivot Table reference instead.

There are currently no FAQs about Excel 2008 for Mac: Pivot Tables for Data Analysis.

Share a link to this course
Please wait... Please wait...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.
Upgrade now


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Upgrade now

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Excel 2008 for Mac: Pivot Tables for Data Analysis.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Welcome to the redesigned course page.

We’ve moved some things around, and now you can



Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked