0% found this document useful (0 votes)
11 views7 pages

Creating and Managing Pivottables

The document provides a comprehensive guide on creating and managing PivotTables in Excel, including steps to create a basic PivotTable, add slicers, and group records. It also explains how to use the GETPIVOTDATA function to reference data from a PivotTable. The instructions are detailed with step-by-step processes for effective data analysis and visualization.

Uploaded by

antoniofreches
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views7 pages

Creating and Managing Pivottables

The document provides a comprehensive guide on creating and managing PivotTables in Excel, including steps to create a basic PivotTable, add slicers, and group records. It also explains how to use the GETPIVOTDATA function to reference data from a PivotTable. The instructions are detailed with step-by-step processes for effective data analysis and visualization.

Uploaded by

antoniofreches
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

OneNote https://euc-onenote.officeapps.live.com/o/onenoteframe.aspx?ui=pt-PT&...

Creating and Managing PivotTables

PivotTable reports and PivotCharts are collaborative ways to quickly condense and
rearrange large amounts of data. Use a PivotTable report to analyze and display the
numerical data in detail and to answer unforeseen questions about your data. In this
section, you will learn to create a basic PivotTable. PivotCharts are covered in a later
section of this lesson.
You can use a PivotTable report if you need to analyze large amounts of data in many
different ways, summarize data by categories and subcategories, expand and collapse
levels of data to drill down and filter your results, or move rows to columns or columns to
rows to examine different summaries of the data.
Creating a PivotTable
PivotTable reports are used to examine and analyze related totals. Examples are
calculating a long list of figures or comparing several facts about each piece of numerical
data. In this exercise, you create and modify a PivotTable report.

STEP BY STEP Create a PivotTable


GET READY. LAUNCH Excel if it is not already open.
1. OPEN the 04 PivotTables.xlsx workbook from the data files for this lesson.
2. SAVE the workbook as 04 PivotTables Solution.xlsx in the lesson folder on your
flash drive.
3. On the Data worksheet, click cell A1. Press End and then press the down arrow.
Notice that there are 25,001 rows of data.
4. Press Ctrl+Home to return to the top of the worksheet.
5. Click the Insert tab and then in the Tables group, click the Recommended
PivotTables button.
6. Scroll down the list and click Sum of Units Sold by Product (Figure 4-6).

Figure 4-6: Using the Recommended PivotTables dialog box


7. Click OK and name the new sheet Products. The PivotTable Fields pane displays on

1 de 7 14/04/2021, 14:34
OneNote https://euc-onenote.officeapps.live.com/o/onenoteframe.aspx?ui=pt-PT&...

the right side of the window and the PivotTable appears on the worksheet.

Take Note When you click any cell outside of the PivotTable, the PivotTable Fields
pane disappears. To make it reappear, you simply need to click on any active cell in
the PivotTable that is showing data.

8. In the Products worksheet, drag the Region field in the PivotTable Fields pane down
to the Columns area. The products are now summarized by region—the regions
appear as column headings.
9. Drag the Sales Rep field to the Filters area.
10. Cell B1 currently shows (All). Click the Filter drop-down arrow, choose Garrett
Vargas, and then click OK. Now, the PivotTable data reflects only the units sold by
Garrett.
11. Click the Filter drop-down arrow again and choose (All). Click OK.
12. In the PivotTable Fields pane, in the Values area, click the Sum of Units Sold drop-
down arrow and then select Value Field Settings. The Value Field Settings dialog
box opens.
13. Click the Number Format button. The Format Cells dialog box opens (showing only
a Number tab). In the Category list, click Number, change the Decimal places to 0,
and then select the Use 1000 Separator (,) check box. Click OK two times to close
both dialog boxes. The values in the PivotTable now show the number format you
chose.
14. Click the PivotTable Tools Design tab. Click the More button in the PivotTable
Styles group and apply Light Green, Pivot Style Medium 14. Your PivotTable
should look similar to Figure 4-7.

Figure 4-7: Results of PivotTable


15. SAVE the workbook.
PAUSE. LEAVE the workbook open to use in the next exercise.

After you create the initial PivotTable report by defining the data source, arranging fields
in the PivotTable Fields pane, and choosing an initial layout, you can perform additional
tasks as you work with and improve a PivotTable report. Most of these options are
available on the PivotTable Fields pane or the PivotTable Tools tabs that display when you
select any cell in the PivotTable.

2 de 7 14/04/2021, 14:34
OneNote https://euc-onenote.officeapps.live.com/o/onenoteframe.aspx?ui=pt-PT&...

Adding Slicers to PivotTables


A slicer filters the entire PivotTable, restricting the sums, counts, averages, and so on, to
only those fields selected in the slicer or filter field. The following exercise will walk you
through how to add one or more slicers to an existing PivotTable. You’ll also learn how to
use a specialized type of slicer—a timeline—to allow you to more quickly filter dates in
PivotTables.

STEP BY STEP Add Slicers to an Existing PivotTable


GET READY. USE the 04 PivotTables Solution.xlsx workbook that is open from the
previous exercise.
1. Select the worksheet PivotTable - Slicers.
2. Select any cell in the PivotTable and close the PivotTable Fields pane. Click the Insert
tab and then in the Filters group, click the Slicer button. In the Insert Slicers dialog
box, select the Sales Rep check box and then click OK.
3. Position and resize the slicer so that it covers all of cells L2:L8.
4. On the Slicer Tools Options tab, in the Buttons group, use the Columns control to
increase the number of columns to 2. Widen the slicer to make all data visible, if
needed.
5. Click inside the PivotTable.
6. Click the PivotTable Tools Analyze tab and then in the Filter group, click the Insert
Slicer button.
7. Select the State Abbr check box and then click OK.
8. Position and resize the slicer so that it covers all of cells L10:L26.
9. On the Slicer Tools Options tab, in the Buttons group, use the Columns control to
increase the number of columns in the State Abbr slicer to 6. Widen the slicer to
make all data visible, if needed.
10. In the Sales Rep slicer, click the button for Amy Strande.
11. In the State Abbr slicer, click the button for AK. Hold down Ctrl and then click the
buttons for GU, MH, and VI. Your worksheet should look like Figure 4-8.

Figure 4-8: A PivotTable with two slicers added

3 de 7 14/04/2021, 14:34
OneNote https://euc-onenote.officeapps.live.com/o/onenoteframe.aspx?ui=pt-PT&...

12. Click the Clear Filter buttons (the small funnel icons with the red “X” symbols in the
top-right corner of each slicer) to clear the filters.
13. Select the worksheet PivotTable – Grouping. Next, we’ll add a timeline slicer to
filter dates in a PivotTable.
14. Select any cell in the PivotTable and close the PivotTable Fields pane, if necessary.
Click the Insert tab, and then in the Filters group, click the Timeline button. In the
Insert Timelines dialog box, select the Date check box and then click OK.
15. Position and resize the timeline so that it covers all of cells L3:R10.
16. Click the MONTHS arrow near the top-right corner of the timeline and then select
YEARS. Click the bar under 2016 and then drag the right handle to the right to
include 2017. The PivotTable adjusts to display only data from 2016 and 2017.
17. On the Timeline Tools Options tab, click the More button in the Timeline Styles
group and then select Light Orange, Timeline Style Dark 2. Your worksheet should
resemble Figure 4-9.

Figure 4-9: A PivotTable with a timeline slicer added


18. SAVE the workbook.
PAUSE. LEAVE the workbook open to use in the next exercise.

Grouping Records in a PivotTable


Normally, data in PivotTables gets grouped based on a hierarchy inherent in the data. For
example your data might contain countries/regions, state/province, and city fields. If you
were grouping your data geographically, then you might have three levels of row
headings—different cities being grouped together by state/province, and
states/provinces being grouped by countries/regions.
Sometimes you will want to group rows or columns of data in a PivotTable by hand and
show results for aggregations of these custom groupings of rows and/or columns. By far
the most common groupings are based on date. Excel offers several built-in tools for
grouping date data. You can group date data by year, quarter, month, day, hour, minute,
and second.

STEP BY STEP Group Records in a PivotTable


GET READY. USE the 04 PivotTables Solution.xlsx workbook that is open from the
previous exercise.
1. Select the worksheet PivotTable – Grouping if it isn’t already selected.

4 de 7 14/04/2021, 14:34
OneNote https://euc-onenote.officeapps.live.com/o/onenoteframe.aspx?ui=pt-PT&...

NOTE: If you added the timeline slicer in the previous section, click the Clear Filter
button on the timeline so that the PivotTable will display data from all years.
2. Right-click any date in column A of the PivotTable and select Group from the
shortcut menu.
3. Notice in the Grouping dialog box that the data runs from Jan 1, 2008 to Jan 1,
2018. (It’s worth noting that even though the highest date value in the Date column
is 31-Dec17, Excel’s Grouping dialog box populates the “Ending At” field with
1/1/2018).
4. In the By list, select Months (only months) and then click OK.
5. Notice that even though we have ten years’ worth of data, our PivotTable now
contains only twelve (12) rows of detail data running from Jan through Dec. This is a
common mistake when grouping data by date! Our “Jan” row contains sales data
from Jan 2008, Jan 2009, Jan 2010, and so on, through Jan 2017.
6. Right-click any of the cells containing a month heading and select Group.
7. Select both Years and Months and then click OK.
8. Select cells B4:C4.
9. Click the PivotTable Tools Analyze tab and then in the Group group, click the
Group Selection button.
10. Change the text in cell B4 to Group D.
11. Repeat steps 8–10 for cells E5:H5 and change the value of E4 to Group G.
12. Repeat steps 8–10 for cells H5:K5 and change the value of H4 to Group T.
13. Repeat steps 8–10 for cells K5:N5 and change the value of K4 to Group W.
14. Click the PivotTable Tools Design tab and then in the Layout group, click the
Subtotals button and then select the Show All Subtotals at Top of Group option.
15. Click the PivotTable Tools Analyze tab. In the Show group, make sure the
+/Buttons toggle button is turned on. (Small [-] buttons should display beside the
“Group D” and “Group G” labels and beside the years in column A.)
16. Click the small [-] buttons for Group D, Group G, 2008, and 2009. The specified
product group columns and year group rows collapse. Compare your PivotTable to
Figure 4-10.

Figure 4-10: A PivotTable with row and column groupings

5 de 7 14/04/2021, 14:34
OneNote https://euc-onenote.officeapps.live.com/o/onenoteframe.aspx?ui=pt-PT&...

17. Right-click any of the row header cells in column A (the ones containing a year or a
month).
18. Point to Expand/Collapse and select the Collapse Entire Field option from the
flyout menu.
19. SAVE the workbook.
PAUSE. LEAVE the workbook open to use in the next exercise.

Take Note If you take a closer look at the Grouping dialog box for date grouping, you
will notice that the option for grouping by week is not listed. If you need to group by
week, then select Days (and only Days) as the grouping option. When you do, you will
notice that a small spinner control at the bottom of the dialog box becomes enabled.
Simply change the Number of Days to 7. To change the day of the week when the
grouping begins, change the Starting At value at the top of the Grouping dialog box.

Using the GETPIVOTDATA Function


You can use the GETPIVOTDATA function to pull data from a PivotTable so that you can
reference the data in a location outside of the PivotTable—either on the same worksheet
or in another worksheet.

STEP BY STEP Use the GETPIVOTDATA Function


GET READY. USE the 04 PivotTables Solution.xlsx workbook that is open from the
previous exercise.
1. Select the Products worksheet. (This is a new worksheet that was added in the
“Create a PivotTable” exercise earlier in this lesson.)
2. In cell J5, type Gizmos – Midwest. In cell J6, type Widgets – South. In cell J8, type
Total – Northeast. These are labels that will identify the GETPIVOTDATA function
results in the following steps. Widen column J to it the data.
3. Click cell K5. Type = (equals sign), click cell C8 in the PivotTable, and then press
Ctrl+Enter. This is a shortcut for entering the GETPIVOTDATA function—notice the
function in the formula bar.
4. Click cell K6, type = (equals sign), click cell F11 and press Ctrl+Enter.
5. Click cell K8, type = (equals sign), click cell D13 and press Ctrl+Enter.
6. Apply the Comma format with 0 decimal places to the entries in cells K5, K6, and
K8.
7. Select cell K5 and compare your results with Figure 4-11 (refer to the function in the
formula bar). The function result in K5 displays the units sold, based on data from
the PivotTable that starts in cell A3, with Region = Midwest, and Product = Gizmos.

Figure 4-11: Using the GETPIVOTDATA function to reference data stored in a


PivotTable

6 de 7 14/04/2021, 14:34
OneNote https://euc-onenote.officeapps.live.com/o/onenoteframe.aspx?ui=pt-PT&...

8. Cell B1 currently shows (All). Click the Filter drop-down arrow, choose Isabel
Martins, and then click OK. Now, the function results in column K reflect only the
units sold by Isabel (though the actual GETPIVOTDATA functions have not changed).
9. Click the Filter drop-down arrow again and choose (All). Click OK.
10. SAVE the 04 PivotTables Solution.xlsx workbook and then CLOSE the workbook.
PAUSE. LEAVE Excel open for the next exercise.

7 de 7 14/04/2021, 14:34

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy