Sub topic 6
Choosing row and column fields
This chapter assumes you can insert a PivotTable and open the PivotTable Fields pane. You should also know that a PivotTable summarises a flat table of records. Here you decide which fields go in the Rows and Columns areas, because that choice sets the shape of the report.
What the two areas do
A field in the Rows area lists its unique values down the left side. A field in the Columns area lists its unique values across the top. Each cell where a row item meets a column item holds the Values calculation for the records that match both.
Use this sample data for the examples in this chapter:
Date,Region,Product,Units,Sales
2025-01-05,East,Widget,10,250
2025-01-12,West,Gadget,4,180
2025-02-03,East,Gadget,7,315
2025-02-14,West,Widget,12,300
2025-03-09,East,Widget,5,125Use this field layout:
Rows: Region
Columns: Product
Values: Sum of SalesIt produces the grid below.
| Sum of Sales | Gadget | Widget | Grand Total |
|---|---|---|---|
| East | 315 | 375 | 690 |
| West | 180 | 300 | 480 |
| Grand Total | 495 | 675 | 1170 |
East Widget is 375 because two records match: 250 on 5 January and 125 on 9 March. Each total row and column sums the same underlying records, not the numbers shown in the grid.
Adding fields to the areas
You can place a field in an area in three ways:
- Drag the field name from the field list into the area box.
- Tick the check box next to the field name. Excel puts text fields in Rows and numeric fields in Values.
- Right-click the field name and choose Add to Row Labels or Add to Column Labels. The exact wording differs between Excel versions.
Ticking boxes is quick but guesses. If a numeric field such as Units is meant to be a category, tick it and then drag it to Rows yourself.
To move a field, drag it between area boxes or use the field's drop-down menu in the pane and choose Move to Rows or Move to Columns. To remove it, drag it out of the pane or clear its check box.
Choosing which field goes where
The grid is symmetrical in meaning, so you pick the orientation for readability. Use these rules.
- Put the field with many items in Rows. A sheet has 1,048,576 rows but only 16,384 columns, and people scroll down more comfortably than across.
- Put the field with few items in Columns. Two to six items usually fit on screen and are easy to compare.
- Put time in Rows if there are many periods, or in Columns if there are only a few, such as four quarters.
- Put the field you want to compare closely in Columns. Comparing numbers side by side in one row is easier than comparing numbers far apart in one column.
Swapping fields never changes the data. It only changes which grid is easier to read. A quick way to swap everything is PivotTable Analyze, then Design, or right-clicking an item and using Move.
Stacking several fields on one axis
You can put more than one field in the same area. The order of the fields in the area box sets the nesting, from outside to inside.
With Region above Product in Rows, and nothing in Columns, the layout is:
Rows: Region, then Product
Columns: (none)
Values: Sum of Sales
East
Gadget 315
Widget 375
West
Gadget 180
Widget 300Reversing the order to Product, then Region groups the rows by product instead. The same four numbers appear, but the outer field now carries the subtotal. Choose the outer field by asking which total you want to see first.
To reorder, drag a field up or down in its area box, or use its drop-down and choose Move Up or Move Down.
Adding a date field
A date field placed in Rows or Columns behaves differently from text. In Excel 2016 and later, dragging a field that contains true dates often groups them automatically, typically into Months, and sometimes Quarters and Years when the data spans more than one year. Excel then adds extra fields such as Months to the list. With the sample data above, you would see January, February and March as row items.
This helps for a monthly report, but it can surprise you if you wanted individual days. The next chapters on grouping explain how to control it. If the dates are stored as text, no grouping occurs and each distinct string becomes its own item.
Items, blanks and ordering
Excel builds the list of items from the distinct values it finds in the source field. A few behaviours matter:
- Items sort alphabetically or numerically by default. A custom list, such as Mon, Tue, Wed, sorts in that list's order instead.
- A blank value in a field appears as an item called (blank). Fill the source blanks or filter that item out.
- Spelling differences make separate items. "East" and "East " (with a trailing space) appear as two rows.
- A cell in the grid is empty when no record matches that row and column pair. That is correct, not an error. If you need a zero, use the PivotTable Options setting For empty cells show.
Moving fields to the Filters area
If a field has many items you do not need to see at once, such as Date or Customer, put it in Filters instead of Rows or Columns. It then selects which records feed the grid. This keeps the grid small and lets you switch between views without rebuilding it. Filtering gets its own chapter, so here you only need to know that it exists as a third place a field can go.
Common mistakes
| Symptom | Likely cause | Fix |
|---|---|---|
| Hundreds of narrow columns | A field with many items is in Columns | Move it to Rows |
| Duplicate-looking items | Trailing spaces or inconsistent spelling in the source | Clean the source, then refresh |
| A numeric field shows one row per value | A number was dragged to Rows instead of Values | Move it to Values, or group the numbers |
| Totals appear above or below in an unexpected place | Layout and subtotal settings | Adjust them under Design, then Subtotals |
| Empty cells in the middle of the grid | No records for that pair | Set For empty cells show to 0 if you need it |
Summary
- Rows list a field's items down the left side. Columns list them across the top.
- Cells show the Values calculation for records matching both items.
- Put many-item fields in Rows and few-item fields in Columns.
- The order of fields within an area sets the nesting.
- Date fields may group automatically in recent Excel versions.
- Clean spelling and blanks in the source before blaming the PivotTable.
Exercise
Using the sample data, you want to show Sum of Sales by Product as rows, with Region split across the top. Which fields go in Rows and Columns, and what is the East Gadget value?
Show answer
Place Product in Rows and Region in Columns, with Sum of Sales in Values. East Gadget is 315, from the single record dated 2025-02-03. Gadget's Grand Total is 495 (315 for East plus 180 for West).
Exercise
A PivotTable shows "North" and "North " as two separate row items. Why does this happen, and how do you fix it?
Show answer
Excel treats the two values as different because the second has a trailing space. Remove the space in the source data, for example with the TRIM function, then refresh the PivotTable so the two items merge into one.