How to work with conditional formatting in Google Sheets

Learn how to use conditional formatting in Google Sheets. This guide covers everything from setting basic formatting rules based on numbers, text, dates, and other cell values, to using custom formulas for cases like deadlines or specific values. By setting up format rules tailored to your unique needs, you’ll save time, reduce errors, and make the most important details stand out.

What is Google Sheets conditional formatting?

Highlighting specific data with color is a great way to emphasize key information — many of us do this all the time.

But if you have data that changes frequently, like values that rise or fall above a certain number, or cells containing particular keywords, manually formatting each cell can be time-consuming and prone to errors.

Wouldn't it be great if such changes to formatting occurred automatically?

Conditional formatting in Google Sheets does just that. It automatically updates cell colors based on rules you set so that important cells stand out immediately.

Let’s explore some examples so you see how easily Google Sheets can apply and adjust formats based on data in real-time.

How to add a conditional formatting rule

Whatever conditional formatting rule you'd like to add in Google Sheets, it all starts the same — with a few clicks:

  1. Select the cells you want to apply the rule to.
  2. Go to Format > Conditional formatting in the Google Sheets menu: Where to find the option in the spreadsheet menu.
  3. A panel will appear on the right side of the screen where you’ll set the details of the rule:
    • edit the range to apply the rule to if needed
    • set up the condition that best fits your needs
    • choose how you want the cells to look like when the rule is met: set a background color or/and font color; make the text bold, italic, underlined or strikethrough.
    All settings you'll need to adjust to do conditional formatting in Google Sheets.
  4. Once everything's set, click Done to save the rule.

You can add more rules by clicking Add another rule on the same pane. And you can easily modify or remove existing rules anytime: Manage formatting rules from one pane.

With this general setup, you’re ready to create specific formatting rules for various use cases. Let’s jump right in 🙂

Set up simple formatting rule for numbers

Conditional formatting in Google Sheets is a fantastic way to visually highlight numerical data based on specific values. So let's suppose you want to color orders greater than $200 in total sales (column F):

  1. Select column F (a column with your numbers).
  2. Go to Format > Conditional formatting.
  3. Choose a condition from the dropdown menu: Greater than or equal to, and enter 200 in the provided field: Pick numeric criterion.
  4. Set the formatting style you prefer. For instance, use bold red text on a yellow fill color to make the cells stand out: How to do conditional formatting by numbers in Google Sheets.

The style will be immediately applied to all cells meeting your condition: they all change colors accordingly.

As an alternative, for a more nuanced visualization, you can use a color scale:

  1. In the Conditional format rules sidebar, switch to the Color scale tab.
  2. Pick one of the existing sets of colors.
  3. Or customize colors for the minimum, maximum and (optionally) midpoint values. For example, set light green for the smallest numbers and dark green for the largest so that cells gradually darken as values increase: Use color scales to format numbers in Google Sheets.

These are simple yet effective ways to draw attention to numerical patterns in your data 🙂

Format cells in Google Sheets by multiple conditions

In some cases, you may want to apply different formats based on different conditions to the cells in the same column. Let's say you need to color orders over $200 in green and orders under $100 in red to draw attention to these specific amounts.

If color scale is not your best bet, you can try creating several formatting rules, each specific to one criterion:

  • Greater than or equal to 200.
  • Less than or equal to 100.
Google Sheets applies conditional formatting by multiple conditions.

All your rules will be applied at the same time. Thus, multiple rules let you create a more tailored view of your data, spot key patterns and take action accordingly.

Google Sheets conditional formatting with custom formulas

While Google Sheets offers standard options to format cells, they may sometimes fall short of covering specific or complex cases where a custom approach is needed. That’s why there's this option to use custom formulas as conditions.

Custom formulas let you build your own rules using standard functions and operators. You'll be able to specify whether a cell meets a particular condition. The result of the formula should be either TRUE or FALSE — if TRUE, the formatting will be applied.

To get started, choose Custom formula is from the drop-down menu in the Conditional format sidebar: Google Sheets lets you create conditional formatting rules using custom formulas.

Let me cover some useful examples so you see how this can work, from highlighting the highest values to marking minimum values while excluding zeros.

Custom formula to highlight max value

To color only the max number in a range, use this custom formula in conditional formatting in Google Sheets:

=F2=MAX($F$2:$F$50)

It checks if each cell in the range is equal to the maximum value and applies formatting accordingly: Conditional formatting for max value in Google Sheets.

Color top N values

If you want to color the top three (or other N) values in a range, create as many formatting rules as you need values, with the following custom formulas for each position:

=F2=LARGE($F$2:$F$50, 2)

you will need to replace 1 with 2, 3, etc. for each next value you'd like to color: Format top 3 values in Google Sheets.

Highlight the lowest value

To highlight the lowest number in a range, use the MIN function in your custom formula:

=F2=MIN($F$2:$F$50) Custom formula to highlight min value.

Exclude zeros for minimum value

If you prefer don't count on zeros as lowest values, use MIN along with FILTER to exclude zeros and color the actual minimum value:

=F2=MIN(FILTER($F$2:$F$50, $F$2:$F$50>0)) Conditional formatting for min value except for zeros.

Color bottom N values

For cases where you need to highlight N lowest numbers, use the SMALL function indicating the position of the number (1st or 2nd small, etc):

=F2=SMALL($F$2:$F$50, 1) Format bottom 3 values in Google Sheets using custom formulas.

As you can see, custom formulas add flexibility to conditional formatting in Google Sheets. I’ll return to them often throughout this article to solve other specific formatting cases!

Conditional formatting if cell contains text

To conditionally format cells with text in Google Sheets, use the related rule: Text contains Conditional formatting rule if cell contains text in Google Sheets.

In addition to just entering the word itself, you can incorporate wildcard characters to enable broader pattern matching for the search:

  • Asterisk (*) matches any number of characters. Thus, d* pattern will find dark chocolates.
  • Question mark (?) matches exactly one character. Thus, d??? pattern will find dark chocolates.
Use wildcards in Google Sheets conditional formatting to see if cell contains text.

Tip. To find the actual asterisks and question marks in your cells, add a tilde (~) right before them. For example, Dark~? will look for cell that actualy contain string Dark?

Custom formulas with REGEXMATCH will also be a good fit here for highly specific searches:

=REGEXMATCH(D2:D50,"Dark") Use custom formulas in conditional formatting to see if Google Sheets cells contain text.

Google Sheets conditional formatting with dates

Managing deadlines or tracking orders is yet another task you can cover with conditional formatting. Google Sheets lets you set up custom rules to highlight dates within specific time frames or to signal when deadlines have passed.

Example 1. Google Sheets conditional formatting if date is within 7 days

Let's highlight those arrival dates that are expected to happen within the next 7 days.

The arrival dates are in column G. If you break down the logic, you will need to check that the date in column G is either today or within the next 7 days. This custom formula will do the trick:

=AND(G2>=TODAY(), G2<=TODAY()+7) Google Sheets conditional formatting for dates within 7 days.

If the starting date is not today though, simply replace TODAY with the DATE function specifying the date of interest:

=AND(G2>=DATE(2024,11,25), G2<=DATE(2024,11,25)+7) Specify the date with the DATE function.

As a result, all dates within the upcoming week from the intended dates will be instantly spotted providing a quick view of the closest order arrivals.

Example 2: Highlight past due dates

Identifying overdue dates is useful for tracking deadlines or incomplete tasks.

To create such a rule, you need a formula that will check for any date that is before the expected end date. Additionally, there may be cells without the actual end dates (blanks) meaning they've never been completed.

Both these criteria fit nicely into one custom formula for your format rule:

=OR(H2>G2,H2="") Format rule for past due dates.

Tip. If the end date is not in the table, do the same as in the example above and specify it using the DATE function:

=OR(H2>DATE(2024,10,26),H2="")

How to format blank cells

Highlighting cells based on text or numbers is helpful, but what about blank cells? Formatting based on blanks can be useful for tracking data completion or signaling about cells that still need attention.

If you only need to check whether a cell is blank, simply select Is empty or Is not empty in the conditional formatting rules.

But if you want to combine this with another condition, you'll need a custom formula. Here are 2 basic formulas for your conditional formatting in Google Sheets:

  • To format blank cells: =""
  • To format non-blank cells: <>""

Let's suppose you have an order status in column G and corresponding details in column H. If the status is Ready to Complete but the details are missing, you want to color that blank cell in column H blue to remind you to fill in the necessary information. 

Here's a custom formula for this:

=AND(G2="Ready to Complete",H2="") Format cells if blank and if other cells contain required text.

This formula checks if the status is Ready to Complete and if column H is empty. When both conditions are met, the formatting will apply.

Use this approach with empty/non-empty cells in other parts of your sheet to highlight missing values or track completion status.

Conditional formatting based on checkboxes in Google Sheets

Checkboxes can help you dynamically change formatting when checked (TRUE) or unchecked (FALSE). This is particularly useful for tracking tasks, to-do lists, and other datasets that rely on a checked/uncheked status.

You'll need custom formulas for this task:

  • To format cells where a checkbox is checked, use a formula with TRUE:

    =G2=TRUE

    make sure to apply it to a column with checkboxes Google Sheets checkboxes formatted by conditional formatting.

  • To format cells where a checkbox is unchecked, use a formula with FALSE:

    =G2=FALSE Conditional formatting rules for empty checkboxes in Google Sheets.

How to use Google Sheets conditional formatting to highlight entire row

Conditional formatting in Google Sheets can also format entire rows in your table. Let's see how it works by the example of checkboxes. I'll highlight all related data in a row whenever a checkbox is checked.

  1. Select the range you want to format. This should be your entire table (except for header) if you want to color the entire row: A2:G50
  2. In your custom formula, you’ll want to create an absolute reference to the column containing the checkbox (e.g., $G) so the formatting rule always refers to this one column. As for the row, let it remain flexible (2) so the rule is applied to each row individually:

    =$G2=TRUE

Google Sheets conditional formatting to highlight whole rows.

This automatically formats entire rows whenever the checkbox in column G is checked.

Note. So remember, 3 things are key for formatting an entire row instead of a single cell:

  • apply the format to the entire table
  • use an absolute reference for the column ($G)
  • and a relative reference for the row (2)

Google Sheets conditional formatting based on another cell

Did you know that you can format certain cells based on values in different cells? This lets you easily change the condition itself (in a cell) without updating the conditional formatting rule directly.

Suppose you want to color rows where Qty per order is less than 50 or more than 100:

  1. Start by entering those values in helper cells (for example, in column I next to your table): Create helper cells that will contain your criteria for conditional formatting.
  2. Open Conditional format rules and set up your whole table (but its header) as a range to format: A2:G50
  3. Then goes the formula for your first rule — the one that will highlight orders with quantities over 100:

    =$E2>=$I$3

    Note. Use absolute references ($) when referencing cells outside the table: $I$3. They will make sure that whatever you do with the table, the formula will still refer to this cell.

    Create conditional formatting in Google Sheets based on another cell value.
  4. Add a second rule to color order with fewer than 50 items. Click Add another rule at the bottom and change your custom formula to:

    =$E2<=$I$2

    Multiple rules for conditional formatting based on multiple other cells in Google Sheets.

This two-rule approach will highlight largest and the smallest orders based on different conditions, allowing quick updates just by changing values in column I.

Conditional formatting based on another sheet

Placing condition cells like I2 and I3 on a separate sheet can help keep the main sheet tidy. However, Google Sheets doesn’t support direct references to other sheets in conditional formatting rules. Named ranges also won't help here. To solve this riddle, use the INDIRECT function to reference cells across sheets.

Here’s how you set up conditional formatting based on another sheet:

  1. Move your condition cells (with the min and max order Qty.) to another sheet. Let’s say they’re now in Sheet2 in cells C2 and C3: Place criteria to another Google sheet.
  2. In your rule settings, select your original table on Sheet1 as a range to format: A2:G50
  3. As for the custom formula, use INDIRECT to reference C2 in Sheet2:

    =$E2<=INDIRECT("Sheet2!C2")

    The INDIRECT function will convert your text string "Sheet2!C2" into a cell reference that your formatting rule can read: Use the INDIRECT function to refer to cells in another sheet.

  4. Similarly, for the upper limit, add another rule:

    =$E2>=INDIRECT("Sheet2!C3") How conditional formatting looks when your criteria cells are on another Google sheet.

With these formulas, you can update conditions on Sheet2, and the conditional formatting on your main sheet will adjust automatically. And no clutter on your main sheet 😉

How to remove conditional formatting in Google Sheets

Removing conditional formatting from your table is just as easy as adding it:

  1. Select any cell within the range where you’ve applied conditional formatting.
  2. Go to Format > Conditional formatting.
  3. On the sidebar that appears, you'll see all the rules applied to the range.
  4. Hover over the rule you want to remove and click the trash icon.
How to remove conditional formatting in Google Sheets.

This will delete that specific rule without affecting other rules or formats.

With all these tips in mind, Google Sheets conditional formatting will play a key role in managing your data. From highlighting values, dates, and text patterns to setting up adaptable rules with custom formulas, you will bring clarity to your data. Now you’re ready to bring your data to life in Google Sheets! 😊

Table of contents

156 comments

  1. Okay I have a weird thing going on: Anytime I type the word "Lenten" or "Lent" in a cell, it turns green. There are no conditional formatting active on the entire spreadsheet. Any ideas?

    • You're searching for "lent", so when you type it into a cell it is showing up green because it's highlighting the search term. Everyone does this at some point. Some of us do it more than once. :)

  2. Hi,
    Thanks for the great help to various questions. I have created a simple "To do" list for my office tasks. As soon as a task row is completed, I have set conditional formatting to strike how that task and mark status and percentage in status and progress columns.
    This works for the tasks that are of one time like "Defining Scope of the project". However, in case of recurring tasks like "Send the weekly Status reports", what I am looking for is - as soon as one row for the task "Weekly Status Reports" is Striked out as completed, another normal row of the same content is inserted below it (by same content I mean the content which was there before being striked out, the percentage set to blank and status also set to blank) (by normal I mean which is not striked out). I want to do this since this will be a recurring task.
    Please can you help me on this?

  3. Dear Sir,
    Please Suggest me how i can apply Conditional formatting as per below given data:
    A B C D
    RE-ORDER LEVEL MIN STOCK LEVEL Max Stock Level NEED COLOR CODING BY
    CONDITIONAL FORMATTING FOR
    A,B,C

    Regards
    Trivedi Singh

  4. hi, in excel there is a function that help us to find values replicated, but in drive i cant find this options... help please

    • Hi, Daniel,

      Most of the functions that work in Excel work in Google Sheets as well.
      You can try building the formulas described in this blog post to find replicated data in your spreadsheet.

      Alternatively, we have a special add-on designed to look for duplicate and unique values in Google Sheets. It's called Remove Duplicates. You can evaluate the tool for 30 days for free and see if it works for you.

      Hope you'll find these tips useful.

  5. Is it possible yet to highlight just text within a cell, not the whole cell in Google sheets?

    • Thank you for your question, Patricia.

      Conditional formatting in Google Sheets lets you change not only the background color of cells but also font color.
      When you set the rule, simply pick the color you need using the Text color tool (the icon with "A") and make sure the Fill color is set to None.

      Hope this helps.

  6. need help please with following

    column A Column B Column C
    1 Monday Site 1 employee 1
    2 Monday Site 2 employee 2
    3 Monday Site 3 employee 2
    4 Tuesday Site 1 employee 1
    5 Tuesday Site 2 employee 2
    6 Tuesday Site 3 employee 3
    7 Wednesday Site 1 employee 3
    8 Wednesday Site 2 employee 1
    9 Wednesday Site 3 employee 2

    how do i make c3 change colour in google sheets because it matches as employee cant be assigned to two sites in one day

  7. Hi,

    Great post. Any chance when you do your formatting to sort the value by colors. In other word get for exemple all your green values at the top and the rest following.. thanks a lot!

  8. Hello! Hoping you can help.
    I am trying to organize a large event (reunion). I have everyone's name typed in to a spreadsheet and a google form linking to their responses of coming or not coming. As they fill out this form, is there a way to have their name turn green on the master list of names, so that I can easily see who has not answered the google form? Rather than having to go through each name and manually check it off the master list? Thanks!

  9. Can you use "AND" statements in Custom Formulas for conditional formatting.

    I am trying to conditional format based on two conditions, e.g.
    If (A2 = "text") AND (B2>indirect("sheet1!A2))

    I tried the following:
    =AND(F2="Lower", E2>Indirect("Summary!H$2)) But seems to give an error?

    Any thoughts would be greatly appreciated.

    Thanks

    • Hello, Damien,

      AND can be used in conditional formatting, and the formula you use looks fine.

      I kindly ask you to share your sample spreadsheet with us (gapps.ablebits@gmail.com) where your custom formula doesn't work.

      We'll look into the file and do our best to advice you.

  10. Hey,

    Currently, I am using conditional formatting to color a cell based on the number from a different cell. I need to do a total of 4 colors for 4 set of range so I am using custom conditional formatting for each range. For some reason, only 3 of my 4 conditions are working. how can I fix this problem and also, is there a simpler way of doing such a format?

  11. I was able to do a conditional formatting for an entire row by doing =$E1="Speech" however this is only highlighting rows where the cell equals "speech" and I would like to do it for all that CONTAIN "speech" is this possible?

    • Hello, Joanna,

      Please try to use the following formula in the Custom Formula field instead of the one you mentioned:
      =COUNTIF($E1,"*speech*")>0

      Hope this helps!

  12. How to apply conditional formatting in colums for duplicate text with different color (same as color scale, but for text)

  13. I have a code that timestamps when i make a change to a cell, i now want to doa conditional format that an hour after that timestamp it turns red so it stands out for me to follow up.

    also when i am creating conditional formats when i delete a row it mess's up which cells it does on "apply to range"

  14. Hello,

    I have a list of student in columns B and C (last name in B, first name in C).
    I have checkboxes in column A. I want the students names to turn red when the checkbox is not checked (ie, it has a value of "FALSE).
    I have set the range in the conditional formatting as B3:C58, becuase that's where the list is, then I select "text contains", and type =A3:A="FALSE".
    However, nothing is happening when I do this, even though there are many unchecked (ie, "FALSE) checkboxes in column A.
    Please advise!

    • Menachem:
      Are each of the checkboxes linked to another cell?
      If not, link the cells to another cell and format that cell based on it's True or False condition. If that works, you should be able to change the color of the cells containing the names based on the value of the cells that contain True or False.

  15. Hi,

    I am trying to create a traffic light system that transfers a Green from master page 1 to Green on page 2 and 3.

    I am using formula =IF("Page 1!D5"="Green",1,0) and format green works great for single cell.

    When I try =IF("Page 1!D5:D10"="Green",1,0) I get no formatting even if all cells are Green. Is there a way to make this work.

    I have 3 conditional formats so Amber and Red also

    KR

    Derek

    • the section above on INDIRECT has the answer you seek. I do this sort of thing all the time. Try This:
      =IF(INDIRECT("'Page 1'!D5:D10")="Green",1,0)

  16. Hi there,

    I use conditional formatting on a row (ex. E4:T4) -> I need this format on every single row until E1000:T1000. If I copy and paste special (format only) i get the conditional formatting to cover the range of E4:T1000 insted of:

    E4:T4
    E5:T5
    E6:T6
    etc..
    E1000:T1000

    Is there a short cut to make the conditional formatting for every single row instead?

    Hope for help.

    BR Martin

  17. How can I create a formula so that the cell that is the greatest, second greatest and third greatest will be highlighted, each in a different color?

    For example: my list of numbers is 12, 24, 19, 10, 3, 5, 30. I want it to highlight 30 (the greatest number) in red, 24 (the second greatest) in hot pink, and 19 (the third greatest) in baby pink.

    What formula would I use/how would I do that?

    Thank you!

    • Hello,

      If I understand your task correctly, you can make use of conditional formatting in Google Sheets described above.

      Conditional formatting allows coloring cells depending on the values they contain. However, you will need to use some formulas there to find if the number (use IF function) is the greatest, the 2nd greatest, etc. (MAX and LARGE functions).

      Hope this helps!

  18. I am trying to create a formula that will transfer a cell with all formatting saved.. IE: I have a list of names in several cells... all names are different colored, some are lined through and some cells have different background colors.... If I use ='PLAYER'!A1 the name copies over but all formatting is lost.... What formula would I use to carry all formatting to the cell I am coping into??

  19. I have a question. is there a formula or way, where a cell changes its value when you change the value of the the other. like for example. if on cell contains 5 and the other cell with change to 0 since may desired formula is "put 0 if the value is less than or equal to 5 if not put 5"?

    thanks

  20. Hi, Alexander! Your description is excellent (clear&detailed). Thanks.
    I have only one question which is not covered above. How can I refer to a named range (i. e. cell or range)? It doesn't work for me.
    Thanks in advance for your response.
    Best regards, Gábor (Budapest, Hungary)

    • Hello,

      I'm afraid it's impossible to use named ranges directly in conditional formatting. You need to use INDIRECT function with the named range in double quotes.

      Hope this helps!

Post a comment



Thank you for your comment!
When posting a question, please be very clear and concise. This will help us provide a quick and relevant solution to
your query. We cannot guarantee that we will answer every question, but we'll do our best :)