In this article:

Conditional Formatting Google Sheets: The Ultimate 2024 Guide

May 8, 2024

In this article you will learn how to use the conditional formatting feature in Google Sheets. You will learn what conditional formatting is, when you should use one, how to use one, and see it in action through examples. You will also get some FAQs about conditional formatting answered.

What is conditional formatting in Google Sheets?

Conditional formatting in Google Sheets allows you to set changes to the format of cells depending on their values. These changes usually include changing the fill color of the cells but may also include changing the text color or the text format of the stored values in the cell. They are all used to highlight the values that fulfill a certain set condition. 

Should you use conditional formatting in Google Sheets?

You will find conditional formatting useful when you need to scan the hard numbers and highlight those that are relevant for your analysis. Some of the examples include the following:

  • Sales: highlight sales that exceeded the expected range
  • Marketing: highlight users that completed the conversion funnel from awareness to sales
  • Project management: highlight items that are already completed

In designing dashboards in Google Sheets, you still need to include tables of most important data for a given purpose. You should add conditional formatting to these tables so that you will be quickly alerted to values that break the pattern, as they will be quickly highlighted whenever the table is refreshed. 

How to use conditional formatting in Google Sheets?

To use conditional formatting in your Google Sheets, you need to access the conditional formatting sidebar, select the range, and then apply the formatting you want to be applied when a condition or a set of conditions is met. There are two ways of loading the conditional formatting sidebar and selecting the range:

Method 1: Load conditional formatting sidebar then select the range

This method works best when you are applying conditional formatting to a large range that is difficult to manually select.

Step 1: Click Format.

Step 2: Select Conditional formatting.

Google Sheets Format, conditional formatting

The Conditional formatting sidebar will appear on the right side.

Google Sheets Conditional format rules

Screencap:

Load conditional format rules sidebar in Google Sheets

Step 3: Click the small box icon on the right side of the textbox.

Conditional formatting sidebar, select range

Step 4: The pop-up box Select a data range will appear. Select the cells or type the range inside the box, then click OK.

Conditional formatting, Select a data range pop-up box

Screencap:

Load sidebar then select range in Google Sheets

Method 2: Select the range then load the sidebar

This method works best when the range fits in your screen.

Step 1: Select the range of cells where you want to apply conditional formatting.

Google Sheets Select range first

Step 2: Click Format, then select Conditional formatting.

Google Sheets Format, select conditional formatting

Screencap:

Select range then load sidebar in Google Sheets

We will use both of these methods in the examples below. 

When to Use Color Scale Conditional Formatting

Google Sheets offers single color and color scale for conditional formatting. Single color conditional formatting is selected by default. You can, however, select color scale by clicking the Color scale tab:

Conditional formatting options, single color and color scale, Google Sheets

Color scale conditional formatting is used when you want to highlight the values as part of a range. It works by setting a color scale and assigning values to it depending on the range of values in the selected cells:

Conditional formatting color scale example in Google Sheets

You can choose the color scale from a preset list or customize your own:

Conditional formatting color scale options in Google Sheets

We will learn how to use color scale conditional formatting in Example 2 below.

How to Conditional Format in Google Sheets – Examples

To get a grasp of the wide variety of uses for conditional formatting that you can get from Google Sheets, check the examples below. Note that these start with the Conditional format rules sidebar already loaded and the range selected, using one of the two methods highlighted in the previous section.

Example 1: Highlight Scores less than 35

Step 1: Click the dropdown box below Format rules label.

Step 2: Select Less than.

Conditional formatting rules less than

Step 3: A textbox below it will appear. Type 35. 

Conditional formatting rule less than 35

Step 4: Click the bar below Formatting style label.

Step 5: Select the preset red shading. 

Conditional formatting color selected

Step 6: Click Done.

Screencap:

Conditional formatting less than rule in Google Sheets

Example 2: Create a Heatmap Using the Scores

Google Sheets has its own color scale feature that automatically creates a color scale depending on the values in the range. Here are the steps:

Step 1: In the Conditional format rules sidebar, select Color scale tab.

Conditional formatting select color scale

Step 2: Select data range.

Select data range

Step 3: Click the colored box under Format rules.

Step 4: A selection of preset color scales will appear. Select what fits your purpose best.

Conditional formatting color scale options in Google Sheets

Step 5: Click Done.

Screencap:

Conditional formatting color scale in Google Sheets

Example 3: Google Sheets Custom Formula Conditional Formatting to Highlight All Instances of Duplicate Data Points

Step 1: Click the dropdown box below Format rules.

Step 2: Select Custom formula is. A textbox will appear below it.

Conditional formatting custom formula in Google Sheets

Step 3: Insert the following formula:

=COUNTIF(range,firstcell)>1

Where

range is the range you select

firstcell is the reference to the first cell you select

Conditional formatting custom formula added in Google Sheets

If you are fine with the default color, you can click Done. Else, here are the next steps in replacing the colors:

Step 5: Click the color bar below Formatting style.

Step 6: Select another color from the preset or click Custom format.

Conditional formatting change color in Google Sheets

Step 7: Click Done. 

Screencap:

Conditional formatting highlight duplicates in Google Sheets

Example 4: Highlight Alternate Rows (creating Zebra Lines)

Step 1: Click the dropdown box below Format rules.

Step 2: Select Custom formula is. A textbox will appear below it.

Conditional formatting custom formula in Google Sheets

Step 3: Add the following formula:

=MOD(ROW(),2)=1

Conditional formatting custom formula added in Google Sheets

Step 4: Click Done.

Conditional formatting shade alternate rows in Google Sheets

Example 5: Highlight Blank Cells

Step 1: Click the dropdown box below Format rules.

Step 2: Select Is empty.

Conditional formatting is empty option in Google Sheets

Step 3: Click the color bar below Formatting style.

Step 4: Select the preset red box.

Step 5: Click Done.

Screencap:

Conditional formatting blank cells Google Sheets

Example 6: Highlight Errors

Step 1: Click the dropdown box below Format rules.

Step 2: Select Custom formula is.  A textbox will appear below it. 

Step 3: Enter the following formula:

=ISERROR(firstcell)

Where firstcell is the reference to the first cell in the column.

Conditional formatting custom formula finding error Google Sheets

Step 4: Change the color shade by clicking the color bar below Formatting style.

Step 5: Select either yellow or red preset.

Conditional formatting change color Google Sheets

Step 6: Click Done.

Screencap:

Conditional formatting shade errors Google Sheets

Example 7: Conditional Formatting Sheets to Highlight Cells That Contain the Searched String

Step 1: Click the dropdown box below Format rules.

Step 2: Select Custom formula is.  A textbox will appear below it. 

Step 3: Enter the following formula:

=AND(NOT(ISBLANK(search_key)),ISNUMBER(SEARCH(search_key,firstcell)))

Where

search_key is the cell where you want to enter the search key

firstcell is the reference to the first cell in the column

Google Sheets search formula added

Step 4: Click Done.

Screencap: 

Google Sheets search engine shade cells with search string demonstration

You can see the mini search engine in action:

Google Sheets search engine shade cells with search string demonstration

Example 8: Conditional Formatting to Highlight Rows That Contain the Searched String

You can improve Example 7 to highlight the entire row instead when the search string appears in the sheet. Make sure to select the entire range, then follow the steps:

Step 1: Click the dropdown box below Format rules.

Step 2: Select Custom formula is.  A textbox will appear below it. 

Step 3: Enter the following formula:

=AND(NOT(ISBLANK(search_key)),ISNUMBER(SEARCH(search_key,firstcell)))

Where

search_key is the cell where you want to enter the search key

firstcell is the reference to the first cell in the column. It should be formatted like:

$A2

Where the dollar sign is placed before the reference. 

Step 4: Click Done.

Conditional formatting search string formula Google Sheets

Screencap:

Conditional formatting shade row search string Google Sheets

Sample of the improved search engine in action:

Google Sheets search engine shade row demonstration

Example 9: Conditional Formatting Google Sheets Entire Row

There are two ways of doing this:

Method 1: Highlight the row before loading the sidebar

Method 2: Setting the range to include the selected row. The format goes as:

3:3

You can see it in action below:

Conditional formatting single row Google Sheets

FAQs about Google Sheets Conditional Formatting

Can I customize Google Sheets conditional formatting?

Absolutely. Just click the icons below the color band below Formatting style.

Conditional formatting style

Each icon does the following, from left to right:

  • Bold
  • Italics
  • Underline
  • Strikethrough
  • Text color
  • Fill color

Through some testing, it is possible to do the following:

  1. Set the fill color to white, boldface the text and add strikethrough;
Conditional formatting text boldfaced with strikethrough
  1. Hide the values with black fill;
Conditional formatting row shaded
  1. Set a different color scheme:
Conditional formatting gray shade

Can I customize the color scale format?

Yes! You can customize the color for the minpoint, the midpoint, and the maxpoint. 

Conditional formatting color scale format rules

By default, minpoint is fixed for the minimum value of the range while the maxpoint is fixed for the maximum value of the range. Click the fill color icon and select the color you want:

Conditional formatting color scale customized colors

Additionally, midpoint is not enabled by default. Enabling it will allow you to set three color grade scheme:

Conditional formatting three-tier color scale

How can I set specific values for the color range format?

Step 1: Click the dropdown box below the value you want to set.

Step 2: Select Number.

Step 3: The textbox on the right will be available for input. Just input the value for each point.

Conditional formatting color range specific numbers

Step 4: Click Done.

Can I add two or more conditional formatting rules in the same range?

Yes. Just make sure that the rules do not clash with each other when at least two of them are fulfilled by the value stored in a cell. 

How can I check existing conditional formatting rules in a sheet?

Step 1: Click Format in the main toolbar.

Step 2: Select Conditional formatting.

Step 3: Click any cell that has conditional formatting. 

Conditional formatting several rules in same range

If you enjoyed this article, you might also like our article on how to import in Google Sheets the Binance API or our article on how to set up Google Sheets conditional formatting based on another cell. 

If you want a copy of our Google Sheets email template, we also suggest checking out our detailed guide. 

Get Google Sheets productivity and automation tips delivered straight to your inbox
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
We'll email you 1-3 times a week — and never share your information.
Get your copy of our free Google Sheets automation guide!
  • 27 pages of Google Sheets tips and tricks to save time
  • Covers pivot tables and other advanced topics
  • 100% free

Work less, automate more!

Use Lido to connect your spreadsheets to email, Slack, calendars, and more to automate data transfers and eliminate manual copying and pasting. View all use cases ->