Excel Pivot Tables

If your work involves the analysis of large amounts of data, you will almost certainly benefit from using Excel pivot tables, to help you to interpret and make sense of the data.

Imagine you have the simple spreadsheet below, containing details of individual sales for 2015. The columns of the spreadsheet have the headings "Invoice No.", "Date", "Item Details" and "Price".

1Invoice No.DateItem DetailsPrice
3BX0000201/01/2015Laptop Computer$549
4BX0000301/01/2015Digital TV$1,099

You could produce a simple pivot table from the above data, that shows the peak months for sales. You could also show how the peak sales vary, by month, for different item types.

Note that the example below applies to current versions of Excel (2007 and later). If you are using an earlier version of Excel, you may prefer to view the page on how to create a pivot table in Excel 2003.

Create a Simple Excel Pivot Table

The following steps guide you through the process of creating a simple pivot table using the above sales spreadsheet.

Steps to create an Excel 2007, 2010 or 2013 Pivot Table
  • Click on the Pivot Table button, which is located in the 'Tables' group, on the 'Insert' tab of the Excel ribbon.
  • You will be presented with the 'Create Pivot Table' dialog box. Make sure the option 'Select a table or range' is selected and make sure the range that Excel has automatically entered relates to the range that you want to use for your pivot table.
  • Select where you want to place your pivot table (if you are not sure, keep the default setting of 'New Worksheet'), then click OK.

You will notice that the pivot table is now populated with the dates in the left hand column and the count of each date (i.e. the number of entries for each date) in the second column of the table, as shown below (left).

Pivot Table in Excel 2010

However, we want the data to be grouped by month.

To do this, use the mouse to right-click on the left hand column (the dates column) of the pivot table and select the option Group ... from the right-click menu.

This causes the 'Grouping' dialog box to be displayed. From within this dialog box, select 'Months' and click OK.

Pivot Table Dialog Box for Grouping Dates and Times
Pivot Table in Excel 2010

The grouping of the months results in the pivot table shown aboveon the right. From this we can clearly see that the peak months, in terms of the numbers of sales in 2011 were March and July, each of which had 442 sales.

Further details of grouping pivot tables is provided in the pivot table tutorial (part 3).

Note: In the above example, for simplicity, we have used the pivot table to show number of sales per month. However, you might prefer to show the total value of sales per month.

To do this, instead of dragging the date field into the '∑ Values' Area of the 'Pivot Table Field List' task pane, drag the 'Price Total' field into this box. Because this field is a numeric value, by default, Excel displays the sum of the entries in the 'Price Total' field, rather than the count.

For an example of this, see the pivot table tutorial (part 2).

Create a 2-Dimensional Pivot Table in Excel

If you now want to discover if the peak month varies for each sales item, you can do this by creating a 2-dimensional pivot table.

Starting with the 1-dimensional monthly pivot table shown above, we now return to the 'Pivot Table Field List' task pane. If this is no longer visible, simply click anywhere on the pivot table and it should reappear at the right hand side of your spreadsheet.

Pivot Table Field List in Excel 2007, 2010 or 2013

Drag the 'Item Details' field into the 'Column Labels' (or 'Columns') area of the task pane. You will notice that the Item Details are immediately inserted across the top of your pivot table, resulting in the final pivot table shown below.

2-Dimensional Pivot Table in Excel 2010

From the final pivot table, it is now easy to see the monthly number of sales for each individual item type.

'Recommended Pivot Tables' in Excel 2013

If you are using one of the latest versions of Excel (Excel 2013 or later), your insert tab will also have the option to produce 'Recommended Pivot Tables'. This option presents you with suggested pivot table formats, based on your data. An example of this is available on the Microsoft Office website.