In this chapter, you'll modify the insurance data pivot table you created in Chapter 2 by adding and removing fields and by filtering the pivot table so only specific data is summarized. You'll see what happens when the data in the source table changes, and you'll learn how to view a different type of summary for the values. You'll use a built-in formatting feature to change the appearance of the pivot table, and you'll see how to delete a pivot table if you no longer need it.
By the end of this chapter, I'll have covered the basic of creating and modifying a pivot table. In the remaining chapters, you'll explore the pivot table features in depth so that you fully understand all that a pivot table can do.
To work with the examples in this chapter, you can open the InsurancePolicies03.xlsx
file you saved at the end of Chapter 2, or you can download and open the sample file InsurancePolicies03.xlsx
.
Sometimes you will create a pivot table and leave it in the same layout for many months without changing the fields. Weekly or monthly, you'll update the data, and you'll either review the results or distribute a report based on the pivot table summary.
Other pivot tables will change frequently because you use them to create ad hoc reports, answering the business questions of the day, as you did in Chapter 2 when you analyzed the insurance policy data by region and then by construction type and location. In this chapter, you'll use the same data and pivot table to create more ad hoc reports by using different fields to summarize the data.
There is a threat of flooding in the Midwest region, and you have been asked to report on the insured values in each region for policies with and without flood coverage. You'll clear the contents of the pivot table, and then you'll create a new layout to produce the requested report.
Note You can also remove the existing fields individually by clearing the check boxes in the PivotTable Field List pane.
Figure 3-1. Clear the pivot table layout.
In Chapter 2, when you created the pivot table, you checked the fields in the field list, and Excel automatically placed them in the Areas section and in the pivot table layout on the worksheet. Later, you moved a field if you wanted it in a different area.
Instead of accepting the automatic field placement, you can control where the fields are placed. For your flood coverage report, you want regions listed in the Row Labels area and flood coverage listed in the Column Labels area, showing the total insured value for each region and coverage type:
Figure 3-2. Drag a field to the Column Labels area.
With the numbers formatted, you can see that more than $3 million of the insured value is for properties with flood coverage, compared to just $1 million for properties without flood coverage. In the Midwest region, about half of the insured value is for properties with flood coverage.
You've reported on the overall totals for each region, but the claims manager wants more information. Each policy is for a specific type of business, and your next report should show the total insured value for the manufacturing businesses only. To limit what is included in the summarized data, you'll add a filter to the pivot table by using the BusType field, which stores the business type data.
Figure 3-3. Drag a field to the Report Filter area.
Figure 3-4. The BusType field added to the Report Filter area
Figure 3-5. Select an item in the Report Filter list.
The values in the pivot table change and now show only the total insured values for policies sold to manufacturing businesses. Of the total insured values in the Midwest region, only $25 million is for manufacturing businesses with flood coverage (see Figure 3-6).
In cell B1 on the worksheet, the drop-down arrow has changed to a filter symbol with a small blue arrow. In the PivotTable Field List pane, there is a filter icon beside BusType in the field list to show that it has a filter applied to that field.
Figure 3-6. A report filter has been applied.
With this filter applied, you can also see that for the manufacturing businesses, all the policies sold in the Central region have flood coverage, but no policies sold in the Northeast region have flood coverage.
Now that you have reported on the totals for manufacturing, you're asked to report on the retail businesses in the Midwest. To see the results for a different business type, you can choose a different item from the report filter list.
The pivot table now shows a summary for the retail business type, and of the total insured values in the Midwest region, only $5.7 million is for retail businesses with flood coverage. After reporting on this business type, you can show all the data again.
The pivot table shows the insured values for all business types.
The next report that the claims manager wants is for office buildings and apartments in the Midwest. These are similar types of business, and your report should show a combined total for these. You'll apply a filter to see both Apartment and Office Bldg policies.
Figure 3-7. You can select multiple items in the Report Filter list.
Note Unless at least one item is selected, the OK button will not be available.
The BusType report filter now shows (Multiple Items), indicating that two or more items have been selected (see Figure 3-8). The pivot table shows the summarized values for the apartment and office building policies, and you can report that most of the insured value is for policies with flood coverage.
Figure 3-8. Multiple items are selected in the Report Filter list.
If you no longer need a report filter, you can remove it from the pivot table. For now, you're finished analyzing the policies by business type, so you'll remove the report filter:
The report filter is removed from the pivot table, and the values are a summary of all the records in the source data.
When you remove a filtered field from the pivot table layout, its last setting is remembered. Before removing the BusType field from the pivot table layout, you selected the Apartment and Office Bldg items to filter the pivot table. In the PivotTable Field List pane, the BusType field still shows a filter icon, indicating that the field has a filter applied. Because the field is not in the pivot table layout, the filter currently has no effect on the displayed data.
To see the retained filter, you can examine the BusType field in the PivotTable Field List pane. You will also be able to change the filter settings for the field.
Figure 3-9. Filter icon and arrow in the PivotTable Field List pane
Figure 3-10. Filter and sort list
After you create a pivot table, it remains connected to the source data. If you make changes to the source data, add new records, or delete records, you can update the pivot table to reflect those changes. In the following sections, you'll make some changes to your source data, and then you'll see the effect of the changes in the pivot table.
You have learned that there is an error in the insured value of one of the policies in the source data, and you have to correct the amount. Also, another policy has been sold, and you must add that information to the source data. You'll go to the Excel table that contains the source data and make the changes:
Figure 3-11. Select a name in the Name box.
Note If policy 100208 is not in row 10, you can sort the policies by the policy number in Column A.
Figure 3-12. Double-click the bottom border of the active cell.
Tip To move down a column using the keyboard, tap the End key and then the down arrow key. This will take you to the bottom of the table if there are no blank cells in the active column. Otherwise, it will stop at the cell above the first blank cell.
Tip If there is no other data on the worksheet, you can press Ctrl+End to go to the last cell in the table.
Tip To copy a value from the cell above, hold the Ctrl key, and type an apostrophe.
![]()
Figure 3-13. New record in the insurance table
Now that you've completed the changes to your source data, you'll return to the pivot table and update it so you can see the revised summary of the insurance data. You corrected an InsuredValue amount in the East region and added a new policy for the Midwest, so the totals for those regions should increase, as should the grand total.
Figure 3-14. The Refresh command in the Data group on the Ribbon
Figure 3-15. The refreshed pivot table shows new totals.
Tip To quickly refresh the pivot table, right-click a cell in the pivot table, and in the context menu, click Refresh.
Currently, the pivot table shows a Sum of InsuredValue item for each region. Instead of seeing a dollar value, you'd like to know how many policies have been sold in each region for those with flood coverage and for those without. You'll change a setting in the pivot table so you can see a different summary for the InsuredValue field:
Figure 3-16. Select a different function to summarize the data.
Figure 3-17. The Count of InsuredValue cell
Now that you have set up the summary information the way you want it, you can spend a bit of time on the appearance of the pivot table. Changing the appearance may make the data easier to read, and you may want a color scheme that fits with other documents you're producing.
When you created the pivot table, Excel automatically applied formatting. To quickly change the appearance of the pivot table, you can apply one of the built-in pivot table styles. This may affect the color and font formatting and may add borders and row or column shading.
Figure 3-18. Pivot table styles
Tip If you change your mind and don't want to apply a style, press Esc on the keyboard, or click outside the Style gallery, and it will close without applying a style.
Note The first style, at the top left of the Light styles, is named None. If you click this style or click the Clear button at the bottom left of the PivotTable Style gallery, your pivot table will not have a style. When no style is applied, the preview function won't work when you point to a different style in the gallery.
A workbook can contain one or more pivot tables, all based on the same data or based on different data. In later chapters, you'll create workbooks with multiple pivot tables and will learn how they interact. Although you can have many pivot tables in the workbook, occasionally you may want to remove a pivot table completely. To practice this technique, you'll delete the pivot table from this workbook:
To delete the pivot table, you'll select the entire pivot table, and then delete it.
Tip To immediately restore the pivot table, you can press Ctrl+Z or click the Undo button on the Quick Access Toolbar (QAT), which is located above the Ribbon, beside the Microsoft Office Button.
In some cases, you may want to remove both the pivot table and the worksheet that was inserted when the pivot table was created. If so, you can right-click the worksheet tab, and click Delete in the context menu. When the confirmation message appears, click Delete to permanently remove the worksheet and the pivot table.
Caution You cannot undo the deletion of a worksheet.
In this chapter, you expanded on your basic pivot table skills. You learned how to clear a pivot table and how to add fields to a specific area of the pivot table.
You added a report filter and used it to view summarized data for a specific business type. You changed the report filter and showed data from multiple items from the filter list. When it was no longer needed, you removed the report filter.
Next, you changed data in the source table and added new data, and then you refreshed the pivot table to update its summarized data. You changed the summary function used in the InsuredValue field to use Count instead of Sum.
You applied a pivot table style to make the data in the pivot table easier to read.
Finally, you learned how to delete the entire pivot table from the workbook if required.
I have now covered the basics of creating a pivot table and modifying it. In the remaining chapters, you'll dig deeper into the pivot table features, and you'll see how you can create more sophisticated pivot table reports.
3.145.186.204