Create a PivotTable to analyze worksheet data

Create a PivotTable to analyze worksheet data

Being able to quickly analyze data can help you make better business decisions. But sometimes it’s hard to know where to start, especially when you have a lot of data. PivotTables are a great way to summarize, analyze, explore, and present your data, and you can create them with just a few clicks. PivotTables are highly flexible and can be quickly adjusted depending on how you need to display your results. You can also create PivotCharts based on PivotTables that will automatically update when your PivotTables do.
For example, here’s a simple list of household expenses, and a PivotTable based on it:
Household expense data Corresponding PivotTable
Sample household expense data to create a PivotTable with Months, Categories and Amounts

Sample PivotTable with Categories in the Rows section and Months in the columns section

Next, here’s a PivotChart:

Example of an Excel PivotChart

Before you get started:

  • Your data should be organized in a tabular format, and not have any blank rows or columns. Ideally, you can use an Excel table like in our example above.
  • Tables are a great PivotTable data source, because rows added to a table are automatically included in the PivotTable when you refresh the data, and any new columns will be included in the PivotTable Fields List. Otherwise, you need to either manually update the data source range, or use a dynamic named range formula.
  • Data types in columns should be the same. For example, you shouldn’t mix dates and text in the same column.
  • PivotTables work on a snapshot of your data, called the cache, so your actual data doesn’t get altered in any way.

Create a PivotTable

If you have limited experience with PivotTables, or are not sure how to get started, a Recommended PivotTable is a good choice. When you use this feature, Excel determines a meaningful layout by matching the data with the most suitable areas in the PivotTable. This helps give you a starting point for additional experimentation. After a recommended PivotTable is created, you can explore different orientations and rearrange fields to achieve your specific results. The Recommended PivotTables feature was added in Excel 2013, so if you have an earlier version, follow the instructions below for how to manually create a PivotTable instead.

You can also download our interactive Make your first PivotTable tutorial.

Recommended PivotTable Manually create a PivotTable
  1. Click a cell in the source data or table range.
  2. Go to Insert > Tables > Recommended PivotTable.

  3. Excel analyzes your data and presents you with several options, like in this example using the household expense data.

    Excel Recommended PivotTables dialog

  4. Select the PivotTable that looks best to you and press OK. Excel will create a PivotTable on a new sheet, and display the PivotTable Fields List.
  1. Click a cell in the source data or table range.
  2. Go to Insert > Tables > PivotTable.

  3. Excel will display the Create PivotTable dialog with your range or table name selected. In this case, we’re using a table called “tbl_HouseholdExpenses”.

    Excel Create PivotTable dialog

  4. In the Choose where you want the PivotTable report to be placed section, select New Worksheet, or Existing Worksheet. For Existing Worksheet, you’ll need to select both the worksheet and the cell where you want the PivotTable placed.
  5. If you want to include multiple tables or data sources in your PivotTable, click the Add this data to the Data Model check box.
  6. Click OK, and Excel will create a blank PivotTable, and display the PivotTable Fields list.

Working with the PivotTable Fields list

In the Field Name area at the top, select the check box for any field you want to add to your PivotTable. By default, non-numeric fields are added to the Row area, date and time fields are added to the Column area, and numeric fields are added to the Values area. You can also manually drag-and-drop any available item into any of the PivotTable fields, or if you no longer want an item in your PivotTable, simply drag it out of the Fields list or uncheck it. Being able to rearrange Field items is one of the PivotTable features that makes it so easy to quickly change its appearance.

PivotTable Fields list Corresponding fields in a PivotTable
Example of the Excel PivotTable Fields list dialog

Example of a PivotTable and how the Fields correlate to the Fields list.

PivotTable Values

  • Summarize Values By

    By default, PivotTable fields that are placed in the Values area will be displayed as a SUM. If Excel interprets your data as text, it will be displayed as a COUNT. This is why it’s so important to make sure you don’t mix data types for value fields. You can change the default calculation by first clicking on the arrow to the right of the field name, then select the Value Field Settings option.

    Excel Value Field Settings dialogNext, change the calculation in the Summarize Values By section. Note that when you change the calculation method, Excel will automatically append it in the Custom Name section, like “Sum of FieldName”, but you can change it. If you click the Number Format button, you can change the number format for the entire field.

    Excel Value Field Settings dialog for Summarize Values By options

    Tip: Since the changing the calculation in the Summarize Values By section will change the PivotTable field name, it’s best not to rename your PivotTable fields until you’re done setting up your PivotTable. One trick is to use Find & Replace (Ctrl+H) >Find what > “Sum of“, then Replace with > leave blank to replace everything at once instead of manually retyping.

  • Show Values As

    Instead of using a calculation to summarize the data, you can also display it as a percentage of a field. In the following example, we changed our household expense amounts to display as a % of Grand Totalinstead of the sum of the values.

    PivotTable example with Values displayed as a percentage of the Grand TotalOnce you’ve opened the Value Field Setting dialog, you can make your selections from the Show Values As tab.

  • Display a value as both a calculation and percentage.

    Simply drag the item into the Values section twice, then set the Summarize Values By and Show Values As options for each one.

Refreshing PivotTables

If you add new data to your PivotTable data source, any PivotTables that were built on that data source need to be refreshed. To refresh just one PivotTable you can right-click anywhere in the PivotTable range, then select Refresh. If you have multiple PivotTables, first select any cell in any PivotTable, then on the Ribbon go to PivotTable Tools > Analyze > Data > click the arrow under the Refresh button and select Refresh All.

Deleting a PivotTable

If you created a PivotTable and decide you no longer want it, you can simply select the entire PivotTable range, then press Delete. It won’t have any affect on other data or PivotTables or charts around it. If your PivotTable is on a separate sheet that has no other data you want to keep, deleting that sheet is a fast way to remove the PivotTable.

To see the source of this article click here

    • Related Articles

    • Setting up an Excel ODBC (32bit) System DSN

      Issue You would like to connect to Excel files to use as data in your Intelligence Reports Resolution You need to configure a 32bit System DSN on all workstations. Instructions as follows: Set up a System Data Source Name (DSN) using the Microsoft ...
    • The Power of Slicers

      Slicers provide buttons that you can click to filter table data, or PivotTable data. In addition to quick filtering, slicers also indicate the current filtering state, which makes it easy to understand what exactly is shown in a filtered ...
    • Reducing the size of Microsoft Excel file automatically

      Here is a quick tip on reducing the size of Microsoft Excel file quickly and easily. You may need to reduce it for any number of reasons, and this is a quick way to get that done. Launch Microsoft Excel or the Microsoft Workbook in question Go to ...
    • BI Generator / BI Tools missing in excel in a Terminal Server environment

      Products Sage 100 ERP Sage 300 ERP Sage ERP X3 Sage Intelligence Sage 500 ERP Description The BI Generator / BI Tools missing in excel in a Terminal Server environment. Even though it is licensed and installed. Not showing in both the Ribbon on excel ...
    • Modelling Data using the RESTful ODBC Driver

      To model the table's column-information in the desired way, you need to first generate the schema of your data source. Add the below connection parameter in the DSN Manager of your connection wizard:     Generating Schema Files Under the Connection ...