Pivot Table Issues

How to Apply Conditional Formatting to Expanding Pivot Tables

Huma Ashraf ChHuma Ashraf Ch Nov 11, 2026 870 views

Question details

The user wants to apply a conditional formatting rule to a pivot table to highlight specific values (e.g., On Hand + On Order < Remaining To Ship) that dynamically adjusts as the pivot table size changes.

How to Apply Conditional Formatting to Expanding Pivot Tables
Product
Spreadsheet
Device & OS
not provided
Scenario
Managing inventory data in a pivot table that updates and expands over time, requiring dynamic cell highlighting.
Observed behavior
The user needs the formatting rules to remain accurate and automatically cover all relevant cells even when new rows or columns are added to the pivot table.
Before you start

Ensure your pivot table is fully set up with the required fields (such as On Hand, On Order, and Remaining To Ship) and take note of the starting cell references for your data columns.

Solution 1Recommended

Apply a Relative Formula Rule to the Pivot Table

Create a custom conditional formatting formula using relative references so the highlighting adapts automatically to new rows in the pivot table.

When applying conditional formatting to dynamic ranges like pivot tables, using a formula with mixed references (locking the column but leaving the row relative) ensures the logic holds true as the table expands.

1
Select the pivot table data

Highlight the first value cell or the entire value area of your pivot table where you want the formatting to appear.

2
Open Conditional Formatting

Navigate to the Home tab on the ribbon, click on 'Conditional Formatting', and select 'New Rule'.

3
Choose the formula option

In the dialog box, select 'Use a formula to determine which cells to format'.

4
Enter the relative formula

Type your logical formula using relative row references and absolute column references. For example, enter `=AND($B5+$C5<$D5)` assuming column B is On Hand, C is On Order, and D is Remaining To Ship.

5
Apply formatting to the pivot table structure

Click 'Format' to choose your highlight color and click 'OK'. Next to the formatted cell, click the formatting options icon that appears and select 'All cells showing [Field] values' to lock the rule to the pivot table structure.

Apply a Relative Formula Rule to the Pivot Table
Dynamic Expansion: Applying the rule to the specific pivot table field rather than a static cell range guarantees the formatting will automatically apply when the pivot table is refreshed and expands.
Easily Manage Pivot Tables in WPS

Use WPS Spreadsheet for Advanced Pivot Table Formatting

WPS Spreadsheet provides powerful pivot table tools and robust conditional formatting options, allowing you to easily analyze dynamic datasets and highlight critical metrics without complex workarounds.

  1. 1. Open your dataset: Launch WPS Spreadsheet and open the file containing your raw data.
  2. 2. Insert a Pivot Table: Select your data range, go to the Insert tab, and click 'PivotTable'.
  3. 3. Configure your fields: Drag and drop your required fields into the Rows, Columns, and Values areas to build your report.
  4. 4. Create a new formatting rule: Select the data values, go to Home > Conditional Formatting > New Rule, and choose the formula method.
  5. 5. Apply and analyze: Enter your relative formula, set the format color, and apply the rule to the pivot table fields for dynamic tracking.
Easily apply dynamic conditional formatting to expanding data ranges.Fully compatible with Microsoft Excel (.xlsx) formats and pivot tables.Lightweight, fast, and free to use for everyday data analysis.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my conditional formatting disappear when I refresh the pivot table?

This usually happens if the formatting is applied to fixed cell ranges (e.g., A1:D10) instead of the pivot table's internal structure. When creating the rule, make sure to select the option to apply it to 'All cells showing [Value] values' so it anchors to the data field itself.

Can I use data bars or color scales on a pivot table?

Yes, you can apply data bars, color scales, and icon sets to pivot tables. After applying the preset rule to a single cell, click the Formatting Options icon that appears next to it and choose to apply the rule to all cells showing that specific value field.

How do I reference pivot table grand totals in a conditional formatting rule?

Grand totals and subtotals are treated separately from regular row data in pivot tables. You generally need to create a dedicated conditional formatting rule specifically for the Subtotal or Grand Total rows, or exclude them from your main rule to prevent incorrect highlighting.