Creating and Managing Pivottables
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.
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.
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&...
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.
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.
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.
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