Conditional Formatting In Pivot Table In Google Sheets

What Is Conditional Formatting In Pivot Table In Google Sheets?

Conditional Formatting in Pivot Table in Google Sheets highlights the required data in the generated Pivot Table and is a very useful feature when projecting reports or important data.

  • The Conditional Formatting in Google Sheets is a feature that helps users highlight desired cells or rows based on the rule set or the entered formula.
  • The Pivot table is a data table generated using an existing dataset with automatic data filters for easy display of desired data.

For example, we will generate a Pivot Table for the given data, as shown below.

Pivot Table Example

Let us apply Conditional formatting by defining some rules, here, if the value is less than 2, then we will get the output shown below.

Conditional formatting In Pivot Table - Examples
Key Takeaways
  • Conditional Formatting in Pivot Table in Google Sheets helps us set single or multiple rules to project the desired data in a generated Pivot table. 
  • Ensure to refresh the Pivot Table when data modification is done because the Conditional Formatting may not work as it is set for a fixed dataset.
  • We have another alternate way to apply the β€œConditional formatting” as follows:

First, select the dataset πŸ‘ͺ right-click on the selected dataset πŸ‘ͺ scroll to the end of the list and click the β€œView more cell actions” right arrow πŸ‘ͺ select the β€œConditional formatting” option, as shown below.

Conditional formatting alternate way

Easy Steps To Apply Conditional Formatting In Pivot Table In Google Sheets

The steps to understand How to Format Pivot Tables in Google Sheets are as follows:

  1. First, we must ensure to have the raw data and its generated Pivot table.
  2. Next, select the Pivot table data with the headings, but excluding the totals, select the β€œFormat” tab and click the β€œConditional formatting” option, as shown below.
Apply Conditional Formatting In Pivot Table In Google Sheets
  1. The β€œConditional format rules” pane appears on the right side. Here, click the β€œAdd another rule” option, as shown below.
Conditional format rules - Add another rule
  1. We will see β€œSingle Color” and β€œColor scale” tabs. Here, click the β€œSingle color” tab to view multiple options to choose for the required conditions or rules, as shown below.
Conditional format rules - Single color
  1. Finally, once we choose the required conditions, click the β€œDone” option. Then, we will have the Google Sheets Pivot Table Conditional Formatting output.

Examples

We will consider a couple of examples to understand Conditional Formatting Pivot Tables in Google Sheets.

Example #1

The data below shows the respective sales of three employees for the three consecutive days.

Conditional Formatting Pivot Tables in Google Sheets Example 1

The steps to apply Conditional Formatting are as follows:

Step 1: First, let us generate a Pivot table. So, choose the cells A1:D10 πŸ‘ͺ select the β€œInsert” tab πŸ‘ͺ click the β€œPivot table” option, as shown below.

Example 1 - Step 2 -Create pivot table

Step 2: A β€œCreate pivot table” window appears. Here, choose the β€œNew sheet” option and click the β€œCreate” button, as shown below.

Example 1 - Step 2 -Create pivot table

Step 3: The Pivot Table gets generated in the new worksheet without any data, as shown below. However, the β€œPivot table editor” pane opens at the right side of the window.

Example 1 - Step 3 - Pivot table editor

Step 4: Let us add the data as follows:

  • Click on the β€œRows” options β€œAdd” button and select the β€œDate” values.
  • Click on the β€œColumns” options β€œAdd” button, select the β€œName” values and uncheck the β€œShow totals” option.
  • Click on the β€œValues” options β€œAdd” button and select the β€œSales” values, as shown below.
Example 1 - Step 4 - Add Rows

The added values are shown in the below images.

Example 1 - Step 4 - Add Rows  and columns - Date
Example 1 - Step 4 - Add Rows  and columns - Sales

The final Pivot table will be as shown below.

Conditional Formatting Example 1 - Final Pivot Table

Step 5: Let us now apply β€œConditional formatting”, as follows:

Choose the data range A2:D6, select the β€œFormat” tab πŸ‘ͺ click the β€œConditional formatting” option. When the β€œConditional format rule” pane opens on the right, click the β€œAdd another rule” option, as shown below.

Example 1 - Step 5 -Conditional format rule

Step 6: Now, select the β€œSingle color” tab and under the β€œFormat rules” section,

  • First, click the β€œformat if…” drop-down, select the β€œgreater than” option and enter 75000 in the β€œValue” field that appears as soon as we select one of the options from the drop-down.
  • Next, in the β€œFormatting style” options select the color β€œYellow” from the β€œFill color” option.
  • Finally, click the β€œDone” button, as shown below.
Conditional Formatting Example 1 - Step 6 - Formatting rule and style

The final output is shown below, where the totals greater than 75000 are highlighted in yellow color.

Conditional Formatting Example 1 - final output

Example #2

We will consider the results of five students and apply multiple Conditional Formatting rules in the Pivot Table, as shown in the below data.

You can download this Conditional Formatting in Pivot Table Google Sheets template here – Conditional Formatting in Pivot Table Google Sheets template.

Conditional Formatting rules in the Pivot Table -Example 2

The steps to apply multiple Conditional formatting rules are as follows:

Step 1: First, let us generate a Pivot table.

  • Choose the cells A1:B6 πŸ‘ͺ select the β€œInsert” tab πŸ‘ͺ click the β€œPivot table” option.
  • A β€œCreate pivot table” window appears. Here, choose the β€œNew sheet” option and click the β€œCreate” button, as shown below.
Example 2 - Step 1 - Create pivot table

Step 2: The Pivot Table gets generated in the new worksheet without any data, as shown below. However, the β€œPivot table editor” pane opens at the right side of the window.

Example 2 - Step 2 - Pivot table editor

Step 3: Let us add the data as follows:

  • Click on the β€œRows” options β€œAdd” button and select the β€œNames” values.
  • Click on the β€œValues” options β€œAdd” button and select the β€œPercentage” values, as shown below.
Example 2 - Step 3 - Pivot table editor - Add Data

The final Pivot table will be as shown below.

Example 2 - Step 3 - Pivot Table

Step 4: Let us now apply β€œConditional formatting” as follows:

Choose the data range A1:B6, select the β€œFormat” tab πŸ‘ͺ click the β€œConditional formatting” option. When the β€œConditional format rule” pane opens on the right, click the β€œAdd another rule” option, as shown below.

Example 2 - Step 1 - Conditional formatting

Step 5: Now, select the β€œSingle color” tab and under the β€œFormat rules” section,

  • First, click the β€œformat if…” drop-down, select the β€œis between” option and enter 65% and 70% in the fields that appears as soon as we select one of the options from the drop-down.
  • Next, in the β€œFormatting style” options select the color β€œYellow” from the β€œFill color” option.
  • Finally, click the β€œDone” button, as shown below.
Conditional formatting - Example 2 - Step 5 - Rule 1

We get the output shown below.

Conditional formatting  - Example 2 - Step 5 - Rule 1 output

Step 6: Let us set another rule. Therefore, click the β€œAdd another rule” in the β€œConditional format rules” pane just below the first set rule. Then, select the β€œSingle color” tab and under the β€œFormat rules” section,

  • First, click the β€œformat if…” drop-down, select the β€œis between” option and enter 75% and 80% in the fields that appears as soon as we select one of the options from the drop-down.
  • Next, in the β€œFormatting style” options select the color β€œmagenta” from the β€œFill color” option.
  • Finally, click the β€œDone” button, as shown below.
Example 2 - Step 6 - Add another rule

The final output is shown below, where the values in-between 65% and 70% are marked in yellow, in-between 75% and 80% are marked in magenta, as shown below.

Conditional Formatting Example 2 - final output

Rules For Conditional Formatting In Pivot Table

There are various rules for Conditional Formatting as follows:

  • Format Cells based on their values.
  • Format cells that only contain specific data.
  • Format only the high and low ranked values.
  • Format only values that are greater than or less than the average.
  • Use a formula to determine which cells to format.

Important Things To Note

  • Ensure to click the β€œDone” option after every rule set, otherwise, all the changes or atleast a few changes will not be saved.
  • Even though we select a cell range and apply Conditional Formatting, the formatting gets applied to the specific cells that fulfil the criteria.

Frequently Asked Questions (FAQs)

1. Can we generate a Pivot Table in the existing sheet?

β€’ Yes, we can generate a Pivot Table in the existing Sheet itself. We must follow the steps shown below.
β€’ Choose the dataset or a cell range πŸ‘ͺ select the β€œInsert” tab πŸ‘ͺ click the β€œPivot table” option.
β€’ A β€œCreate pivot table” window appears. Choose the β€œExisting sheet” option,Β 
β€’ Once we choose the β€œExisting sheet” option, a field to enter the destination location or cell to generate the Pivot Table appears. Select a cell close to the dataset and click the β€œCreate” button, as shown below.generate a Pivot Table in the existing sheet

2. How to generate or create a Pivot Table in Google Sheets?

We can create a Pivot Table using the following path,
First, choose the dataset πŸ‘ͺ select the β€œInsert” tab πŸ‘ͺ click the β€œPivot table” option, as shown below.
Create a Pivot Table in Google Sheets

3. Why is the Formatting Pivot Tables in Google Sheets not working?

The Conditional Formatting in Pivot Table may not work for the following reasons, namely:
a. The dataset of the generated Pivot Table has been modified or updated and is not refreshed to display the updated data.
b. We have not set the conditional formatting rules or the set rules are deleted.
c. Also, since Google Sheets are online, it might not work due to network issues.

Download Template

This article must help understand Conditional Formatting in Pivot Table in Google Sheets with its formulas and examples. You can download the template here to use it instantly.

Guide to What is Conditional Formatting in Pivot Table in Google Sheets. We learn to apply formatting with stepwise examples and its rules. You can learn more from the following articles –

Reader Interactions

Leave a Reply

Your email address will not be published. Required fields are marked *