Sub topic 11
Layout, Subtotals and Number Formatting
This chapter assumes you can already insert a PivotTable, place fields in the Rows, Columns and Values areas, and choose a summary function. Here you control how the result looks and reads: the report layout, subtotals and grand totals, blank cells, and number formats that survive a refresh.
Why layout matters
A PivotTable's default layout is compact. It is quick to build but hard to copy into other sheets or to read when you have several row fields. Changing the layout does not change any numbers. It changes how labels and totals are arranged.
All layout settings live on the Design tab of the PivotTable Tools ribbon (called PivotTable Design in recent versions). Formatting of the value cells lives in Value Field Settings.
The examples use this source data, already placed in a sheet or Excel Table:
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,125Place Region and Product in Rows and Sum of Sales in Values. This gives two row fields, which is where the layout choices show their differences.
The three report layouts
Choose Design > Report Layout and pick one of these.
| Layout | Row fields | Typical use |
|---|---|---|
| Compact | All row fields share one column, indented | Default. Saves width, good for quick reading |
| Outline | One column per row field, subtotals above the items | Reading hierarchies, with labels clearly separated |
| Tabular | One column per row field, subtotals below the items | Copying the data elsewhere, or using it as a table |
In compact layout, the column header says "Row Labels" instead of the field names. This often confuses readers and breaks copy-and-paste into other tools. Switch to Outline or Tabular if you need real field names as column headings.
Repeating item labels
In Outline and Tabular layouts, an outer label such as "East" appears once and the cells below it are blank. Use Design > Report Layout > Repeat All Item Labels to fill every row. This is needed if you want to filter, sort or look up the copied results, because blank cells in a label column break those operations. Use Do Not Repeat Item Labels to return to the default.
Subtotals and grand totals
Subtotals appear for every field that has an inner field below it. Grand totals are the overall totals for rows and columns.
Subtotals
Use Design > Subtotals:
- Do Not Show Subtotals removes them all. Choose this for a flat Tabular layout.
- Show all Subtotals at Bottom of Group is the default for Tabular.
- Show all Subtotals at Top of Group is the default for Outline and Compact.
To change a single field, right-click an item in that field, open Field Settings, and use the Subtotals & Filters tab. Select None or Automatic, or choose Custom to show several functions, such as Sum and Average, for the same group.
Grand totals
Use Design > Grand Totals and choose one of four settings: off for rows and columns, on for rows and columns, on for rows only, or on for columns only. The wording is easy to misread. "On for Rows Only" shows the total column at the right of the table, which sums across each row.
Turn off a grand total if it is misleading. For example, a grand total of an Average field is the average of all records, not the sum of the displayed numbers, and some readers expect the latter.
Blank rows
Design > Blank Rows > Insert Blank Line after Each Item adds visual spacing between groups. Use it for printed reports only. The blank lines are not data, and they get in the way if you copy the table.
Handling empty and error cells
When a region and product combination has no records, the cell is empty. In the sample data, West has no sales in some months, and East and West differ by product.
Open PivotTable Analyze > Options (or right-click the PivotTable and choose PivotTable Options). On the Layout & Format tab:
- For error values show: replaces errors such as #DIV/0! with text of your choice.
- For empty cells show: puts a value such as 0 in cells that have no data.
If you type 0 in For empty cells show, the cell displays 0 but is still a display choice. Charts and formulas that read the cell see the displayed value, which can affect a PivotChart. Leave the box empty if you would rather have a gap than a zero.
Also on the Layout & Format tab, keep Autofit column widths on update and Preserve cell formatting on update in mind. They are the next section's main concern.
Number formatting that survives a refresh
The most common formatting mistake is selecting the value cells and applying a format from the Home tab. This can look correct, but a refresh or layout change may not keep it. Instead, set the format on the field itself.
- Click any cell in the value field, such as Sum of Sales.
- Open PivotTable Analyze > Field Settings (or right-click and choose Value Field Settings).
- Select Number Format.
- Choose a category such as Currency or Number, set the decimals, and click OK twice.
The format is now stored with the field. New items that appear after a refresh use it automatically.
Format the Date field the same way when it appears in Rows: open Field Settings, select Number Format and choose a date format. If a date field shows numbers like 45662, the PivotTable is showing the underlying serial number and the field needs a date format.
Renaming fields and items
Value fields get names such as "Sum of Sales". Click the header cell and type a new name, for example "Total Sales". Two restrictions apply:
- The new name cannot be identical to a source column name. Add a trailing space ("Sales ") or choose a different word.
- You can rename an item by typing over it, such as changing "East" to "Eastern". The label changes in the PivotTable only, not in the source.
Keeping the formatting steady
The Layout & Format tab holds these two settings:
- Autofit column widths on update resizes columns after every refresh. Clear it if you set column widths manually.
- Preserve cell formatting on update keeps fill colours and fonts that you applied to cells. Leave it selected.
Apply a PivotTable Style from Design > PivotTable Styles for banding and header colours. Styles apply to the PivotTable structure, so they follow new rows after a refresh. Select Banded Rows or Banded Columns under PivotTable Style Options to switch the banding on.
Worked example
The goal is a report that can be pasted into another workbook as plain rows.
- Create a PivotTable with Region and Product in Rows and Sum of Sales in Values.
- Select Design > Report Layout > Show in Tabular Form.
- Select Design > Report Layout > Repeat All Item Labels.
- Select Design > Subtotals > Do Not Show Subtotals.
- Select Design > Grand Totals > Off for Rows and Columns.
- Open Value Field Settings, select Number Format, choose Currency with 0 decimals, and rename the field to "Total Sales".
The result has one row per Region and Product, with the field names as column headers, every label filled in, and currency values. You can copy it and use it like any other table.
Common errors
- Headers read "Row Labels". The report is in Compact layout. Switch to Outline or Tabular.
- Blank cells in the label column after copying. Turn on Repeat All Item Labels.
- Formatting is lost after refresh. The format was applied to cells, not to the field. Use Value Field Settings.
- Cannot rename a field to "Sales". The name matches a source column. Add a trailing space or use another name.
- Column widths keep changing. Clear Autofit column widths on update.
Exercise
A colleague copies a PivotTable into another workbook and finds that the Region column is blank for every row except the first row of each group, and the header above the labels says "Row Labels". Which two Design tab settings fix this, and what does each change?
Show answer
Set Report Layout to Tabular Form (or Outline Form), which gives each row field its own column headed by the field name instead of "Row Labels". Then choose Report Layout > Repeat All Item Labels, which fills the Region label into every row so no label cells are blank.
Exercise
You format the Sum of Sales cells as Currency from the Home tab. After the source data changes and you refresh, new rows show plain numbers. What is the correct way to format them, and why does it work?
Show answer
Open Value Field Settings for Sum of Sales, choose Number Format, and select Currency. The format is then stored with the field itself, not with individual cells, so every cell the field produces after a refresh uses it.