A double pivot table in Excel is achieved by adding more than one field to the Rows or Columns area of a PivotTable, creating a nested, multi-dimensional summary. This allows you to break down a primary category into sub-categories (e.g., breaking down "Year" into "Quarter" and then "Month"), providing a deeper level of granularity without needing multiple separate reports. To do this, you simply drag a second field into the same area as your first field in the PivotTable Fields pane.
What You'll Need
- Microsoft Excel (Desktop version recommended for full functionality).
- A structured dataset where data is organized in a tabular format (columns have headers, and there are no completely empty rows or columns within the data range).
- A dataset containing at least two categorical variables (e.g., Region and Salesperson) and one numerical variable (e.g., Revenue).
Step-by-Step
- Prepare Your Data: Ensure your source data is clean. Every column must have a unique header. Remove any merged cells, as these will cause errors when creating a PivotTable. It is highly recommended to convert your data range into an official Excel Table by selecting your data and pressing Ctrl + T. This ensures that if you add new rows to your data later, the PivotTable will include them upon refreshing.
- Insert the PivotTable: Click any cell within your data table. Go to the Insert tab on the top ribbon and select PivotTable. In the dialog box that appears, ensure the Table/Range is correct and select whether you want the PivotTable to be placed in a New Worksheet or an Existing Worksheet. Click OK.
- Define the Primary Dimension: On the right side of the screen, you will see the PivotTable Fields pane. Find the field you want as your primary category (e.g., "Region") and drag it into the Rows area. You will now see a basic list of regions in your spreadsheet.
- Create the Double Pivot (The Nested Level): To create the "double" effect, find your secondary category (e.g., "Salesperson") and drag it into the Rows area, placing it directly below the first field. Excel will now nest the salespersons under their respective regions. This creates a hierarchical view where you can see the total for the region and the individual contributions of each person within that region.
- Add the Values: Locate the numerical field you wish to analyze (e.g., "Total Sales") and drag it into the Values area. By default, Excel will sum these values. You now have a double pivot showing sales by region and then by salesperson.
- Cross-Tabulate (Optional): If you want a true matrix view, you can move one of your categorical fields to the Columns area instead of the Rows area. For example, if you keep "Region" in Rows and move "Product Category" to Columns, you have a double pivot that analyzes performance across two different dimensions simultaneously (who sold what in which region).
- Refine the Layout: To make the double pivot easier to read, go to the Design tab (which appears when you click inside the PivotTable). Click Report Layout and select Show in Tabular Form. This moves the nested fields into separate columns rather than stacking them in one column, which is often preferred for professional reporting.
- Manage Subtotals: By default, Excel adds subtotals for every nested level. If the table looks too cluttered, go to the Design tab, click Subtotals, and choose Do Not Show Subtotals or Show all Subtotals at Bottom of Group.
Common Mistakes
One of the most frequent errors is attempting to create a double pivot from a dataset that contains merged cells. Excel cannot interpret the boundaries of merged cells correctly, often resulting in "blank" labels in your pivot table or a failure to import the data range entirely. Always unmerge cells before starting.
Another common mistake is confusing the "Rows" area with the "Values" area. Users often drag a categorical field (like "Employee Name") into the Values area. Because it is text, Excel will perform a "Count" instead of a "Sum." While counting is useful, it is not the same as analyzing a dimension. Ensure your categories stay in Rows/Columns and your numbers stay in Values.
Many users also forget to refresh their data. A PivotTable is a snapshot of your data at the moment of creation. If you change a number in your source table, the double pivot will not update automatically. You must right-click anywhere in the PivotTable and select Refresh to pull in the latest changes.
Finally, placing too many fields in the Rows area can lead to "data overload." While you can technically create a triple or quadruple pivot, the table becomes difficult to read and loses its utility as a summary tool. If you find yourself adding four or more levels, consider using Slicers to filter the data instead of nesting it.
Tips
To make your double pivot more interactive, use Slicers. Go to the PivotTable Analyze tab and select Insert Slicer. Choose a field that isn't already in your Rows or Columns (like "Year" or "Store Location"). This adds a floating button menu that allows you to filter the entire double pivot with one click, making the report feel like a professional dashboard.
Use the "Expand/Collapse" buttons (the small plus and minus signs next to the row labels) to manage the level of detail. You can right-click a field in the PivotTable and select Expand/Collapse > Collapse Entire Field to see only the high-level totals, then expand specific items as needed for a deep dive.
For better visual clarity, use Conditional Formatting on the Values area. Select your data cells, go to the Home tab, and choose Conditional Formatting > Color Scales. This will highlight the highest and lowest values in your double pivot, allowing you to spot outliers across your nested categories instantly.
If you are working with dates, Excel often automatically groups them into Years, Quarters, and Months. This effectively creates a double or triple pivot for you. If you don't want this, right-click the date field in the PivotTable and select Ungroup to return to the original date format.
Troubleshooting
If the PivotTable shows "Blank" in the rows: This usually happens because there are empty cells in your source data. Go back to your source table and fill in the missing values, or filter out the blanks using the drop-down arrow on the Row Labels in the PivotTable.
If the data is not summing correctly: Check the data type of your source column. If numbers are stored as text, Excel will count them instead of summing them. To fix this, select the column in your source data, go to the Data tab, select Text to Columns, and click Finish. This forces Excel to re-evaluate the cells as numbers. Then, refresh the PivotTable.
If the "Insert PivotTable" option is greyed out: Ensure you are not currently editing a cell (cursor blinking inside a cell). Press Enter or Esc to exit the cell edit mode, then try again. Also, ensure the workbook is not protected; if the sheet is locked, you cannot create new PivotTables.
If the layout looks messy or "stacked": This is the default "Compact Form." To fix this, go to Design > Report Layout > Show in Tabular Form. Then, go to Design > Report Layout > Repeat All Item Labels. This turns the nested list into a clean, database-style table.
Frequently Asked Questions
Can I have a double pivot in both rows and columns?
Yes. You can drag two fields into the Rows area and two fields into the Columns area. This creates a complex matrix that allows you to compare two categories against two other categories simultaneously.
How do I change "Sum" to "Average" in a double pivot?
In the PivotTable Fields pane, click the drop-down arrow next to the field in the Values area. Select Value Field Settings and choose Average from the list, then click OK.
Will a double pivot work with data from two different sheets?
Standard PivotTables require a single contiguous range. To use data from two sheets, you must first use the Data Model. When creating the PivotTable, check the box Add this data to the Data Model, which allows you to create relationships between different tables.
Can I sort the nested levels independently?
Yes. You can right-click a value in the secondary (nested) level and select Sort > Sort Largest to Smallest. Excel will sort the items within their parent group without rearranging the parent groups themselves.
What is the difference between a double pivot and a regular pivot?
A regular pivot typically analyzes one dimension (e.g., Total Sales by Region). A double pivot analyzes two or more dimensions (e.g., Total Sales by Region, and then further broken down by Salesperson), providing a hierarchical view of the data.