To pivot a report in Excel, you must first organize your raw data into a single table format with headers in the first row, then use the Insert PivotTable command to rearrange columns into rows and filterable categories. This process converts a flat list of transactions or entries into a dynamic summary view that can instantly answer questions like "What was our total revenue by region last quarter?" without writing a single formula.
What You'll Need
- A computer with Microsoft Excel installed (Excel 2010 or later is recommended for the best experience).
- A dataset containing at least two columns of data (one for categories and one for values). The first row must contain headers.
- A basic understanding of the data you are analyzing (e.g., knowing which column represents Sales, which represents Date, and which represents Region).
Step-by-Step
- Select your data. Click any single cell inside your dataset. Ensure your data is clean; there should be no blank rows or columns separating the data. Excel automatically detects the range if it is a contiguous block.
- Insert the PivotTable. Go to the Insert tab on the ribbon at the top of the screen. In the Tables group, click the PivotTable button. A dialog box will appear.
- Choose the destination. In the dialog box, select Existing Worksheet if you want your new report to appear in a specific location on the current sheet, or New Worksheet if you want Excel to create a fresh tab for the analysis. Click OK.
- Locate the Field List. Once created, a pane labeled PivotTable Fields will appear on the right side of the window. If it is not visible, you can toggle it by going to the PivotTable Analyze tab and clicking the Field List button.
- Add rows, columns, and values. In the Field List, you will see a list of all your column headers. To build your report, drag and drop these headers into the four areas at the bottom of the pane:
- Rows: Drag a text-based column here (e.g., Region, Product, or Date) to group your data by that category. The data will appear in the leftmost column of your report.
- Columns: Drag a second text-based column here (e.g., Year or Salesperson) to create sub-categories across the top of the report.
- Values: Drag a numerical column here (e.g., Sales, Quantity, or Cost) to perform a calculation. By default, Excel will sum these numbers.
- Filters: Drag a column here (e.g., Country or Year) to create a dropdown filter at the top of your report that applies to the entire dataset.
- Customize calculations. By default, the Values area will sum the data. To change this, click the dropdown arrow next to the field name in the Values area, select Value Field Settings, and choose a different summary type like Average, Count, Max, or Min.
- Apply formatting. Select the values in your PivotTable. Go to the Home tab and use the Number group to format them as Currency, Percentage, or Number with specific decimal places to make the report readable.
- Refresh the data. If you update the source data in your original table and want your PivotTable to reflect those changes, simply click the Refresh button in the PivotTable Analyze tab. This pulls in the new numbers without destroying your current layout.
Common Mistakes
The most common error when learning to pivot a report is starting with data that is not in "tabular format." If your source data has blank rows, merged cells, or headers that are not in the very first row, Excel will either fail to select the correct range or create an incomplete report. Always ensure your data looks like a database table before attempting to pivot it.
Another frequent mistake is dragging the same field into the Values area multiple times. Users often do this to calculate both the sum and the average of the same number. Instead of dragging the field again, use the Value Field Settings option to add a second calculation to the existing field in the Values area.
Tips
Use the Report Layout feature to switch between Compact Form (a single column of indented items) and Tabular Form (a standard grid with row labels on the left and column labels on top). Tabular Form is often easier to read and print, while Compact Form is useful when you have many sub-categories.
If you have a PivotTable that is too wide to fit on one screen, right-click any cell within the table and select Table Options. In the Layout & Format tab, check the box for Autofit column widths on update. This ensures that when you refresh the data, the columns will automatically resize to fit the content.
Troubleshooting
If your PivotTable shows all data instead of filtering correctly, check the Filter field at the top of the table. Click the dropdown arrow and ensure that "Select All" is unchecked and that the specific items you want to see are checked. If that does not work, click the Clear button in the PivotTable Analyze tab to remove the fields, then drag them back in one by one to identify which one is causing the issue.
If numbers appear as hashes (#######) or are not updating, it is usually a formatting issue. Click on the cells with the hashes, go to the Home tab, and change the format to General or Number. For updating issues, ensure that the PivotTable is connected to the correct source range by checking the Table/Range in the Create PivotTable dialog box.
Frequently Asked Questions
Can I pivot data from a CSV file?
Yes. You can open a CSV file in Excel, and as long as it is in a tabular format, the Insert PivotTable function will detect it automatically. You can also import a CSV directly into a new PivotTable by going to Insert > Get Data > From File > From CSV.
Why does my PivotTable not show all the rows?
This usually happens if the "Blank Rows" setting is enabled in your data model. Excel often skips blank rows when creating a table. To fix this, go to the Data tab and click Remove Duplicates, or manually delete the blank rows to ensure your data is contiguous.
Can I use a PivotTable on data that is not next to each other?
No, PivotTables require a contiguous block of data. If your data is scattered across the sheet, you must copy and paste it into a single contiguous range, or use the Get Data tool to combine multiple ranges into one table.
How do I export a PivotTable to PDF?
Go to File > Save As and select PDF as the file type. Alternatively, press Ctrl+P to open the print dialog. In the settings, select "Save as PDF" as the printer. Note that this will save the visible portion of the table, not the entire dataset behind the scenes.
What is the difference between a Table and a PivotTable?
A Table is a raw data format that organizes your information into rows and columns. A PivotTable is a tool built *on top* of that data to analyze it. You create a Table first to ensure your data is clean, and then create a PivotTable from that Table.
Can I edit the source data directly in the PivotTable?
No, editing the numbers in the PivotTable cells will not update your original source data. You must edit the cell in the original source range or use the Refresh button to pull in the corrected source data.