HomeGoogle DocsSpreadsheetHow to Highlight Cells Based on Multiple Conditions in Google Sheets

How to Highlight Cells Based on Multiple Conditions in Google Sheets

Published on

I know the title is a bit confusing for you. So let me first explain what I meant by saying highlight cells based on multiple conditions in Google Sheets. Here I meant to say two aspects of Google Sheets Conditional Formatting.

  1. Highlight a column;
    1. Based on multiple conditions in the same column.
    2. Based on multiple conditions in the same column as well as in different columns.

I will explain the above points below. So let’s go to the tutorial part.

Conditional Format Cells Based on Multiple Conditions in Google Sheets

Highlight a Column Based on Multiple Conditions in the Same Column

Suppose, you want to highlight cells in a single column based on any of the given conditions. Here you can either depend on a custom formula or simply add multiple conditional formatting rules in Google Sheets.

For example, I have names of a few popular authors in a column, where I want to highlight particular authors. I’ll tell you how to perform such conditional formatting with or without a formula.

Sample Data:

Highlight Cells Based on Multiple Conditions in Google Sheets - Sample Data

Here in this set of data, column A contains the names of a few of the famous Authors. Here I want to just highlight the names of two authors. For example, here I’m highlighting “Agatha Christie” and “Sir Arthur Conan Doyle”. How to do that?

As I have mentioned, there are two methods – formulas based and without using formula.

Custom Formula to Conditional Format Cells (Multiple Criteria)

Here you can depend on a custom formula that performs an OR logical test. You can tailor the formula in two ways. Any of the below formulas can do this type of conditional formatting.

Formula 1:

=(A1="AGATHA CHRISTIE")+(A1="SIR ARTHUR CONAN DOYLE")

Formula 2:

=OR(A1="AGATHA CHRISTIE",A1="SIR ARTHUR CONAN DOYLE")

To apply this custom conditional formatting rules in Google Sheets, first select the range A1:A10 or whatever the range. Then go to the menu Format and select Conditional Formatting.

Custom formula for single column multiple condition highlight

Here apply any of the above formulas and choose the color to fill the cells.

This way you can highlight cells based on multiple conditions in Google Sheets. If you want to include more than two conditions, you can simply code the formula as follows.

=(A1="AGATHA CHRISTIE")+(A1="SIR ARTHUR CONAN DOYLE")+(A1="LEO TOLSTOY")

Conditional Format Cells with Built-in Rules (Multiple Criteria)

Same column, multiple criteria conditional formatting is possible without a formula in Google Sheets. In this case, you just need to apply multiple rules as below.

Here I’m highlighting Author’s name in Column A that are matching to “Helen Keller” or “Leo Tolstoy”.

Multiple criteria formatting using format rules

Steps:

  1. Select the range
  2. Go to the Format menu and select Conditional Formatting.
  3. Set the first rule as per the above image.
  4. Click “Add another rule” and add another author’s name.

Highlight a Column Based on Multiple Conditions in Different Columns

The built-in rules are not going to help you here. So you must depend on a custom formula.

For example, here in one column, I have the title of a few books. I want to highlight particular books in that column based on publication date in another column.

Here is my sample data.

Multi column dependent highlighting in google sheets

The content of this data is not accurate. I just filled the names of some random books and fictional publication dates for our example purpose.

I want to conditional format particular book titles in Column B of which the publication date must be on 15/10/2010. The books are “The Open Door” and “Anna Karenina”. See the publication dates in Column C.

Steps:

  1. Select the column range B2:B16. This’s important. No need to select column C.
  2. You can use the custom below custom formula. It’s AND, OR logical test.
=AND(OR(B2="ANNA KARENINA",B2="THE OPEN DOOR"),C2=DATE(2010,10,15))

This way you can highlight cells based on multiple conditions in Google Sheets. Hope you have enjoyed these tips.

Related Reading:

  1. How to Conditional Format Duplicates Across Sheet Tabs in Google Sheets.
  2. Highlight Duplicates in Single, Multiple Columns, All Cells in Google Sheets.
  3. Multiple OR in Conditional Formatting Using Regex in Google Sheets.
  4. Date Related Conditional Formatting Rules in Google Sheets.
  5. AND, OR, or NOT in Conditional Formatting in Google Sheets.
Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

SUMPRODUCT Differences: Excel vs. Google Sheets

The core purpose of the SUMPRODUCT function remains consistent across both Excel and Google...

Sum Values by Month and Category in Excel

With the help of EOMONTH, UNIQUE, and SUMIFS functions in Excel, you can efficiently...

Sum Values by Categories in Excel

In Excel, the easiest way to sum values in a range by categories is...

Filter Data from the Previous Month Using a Formula in Excel

Filtering data from the previous month may be useful for comparative analysis, generating reports,...

More like this

Interactive Random Task Assigner in Google Sheets

You have multiple tasks and multiple people. Here's a fun way to randomly assign...

Google Sheets Bar and Column Chart with Target Coloring

To color each data point in the column or bar chart according to the...

Analyzing Column A Between Non-Adjacent Values in Column B: Google Sheets

This tutorial addresses a common scenario encountered in Google Sheets: how to sum, average,...

51 COMMENTS

  1. Hi Prashanth,

    Thank you for taking a look.

    Here’s an example sheet – I have made it editable. So feel free to play around with it.

    – URL removed by Admin –

    Currently, the conditional formatting is ok for the green and light pink, but it’s the magenta/darker pink I’m trying to edit.

    It’s currently just set to highlight duplicates in col E, but I want to add a condition so that it only highlights the row with the duplicate value in col E and also has a row with a W in col H.

    If it’s not doable, then please don’t hesitate to say!

    Thanks again!

  2. Hi Prashanth,

    Cheers for the post, it’s informative, but I’m still a bit stuck.

    Is it possible to add a single formula to look at duplicates in a column, and if there’s a duplicate, highlight the entire row based on whether or not there’s a “W” in Col H?

    Happy to make an example if needed.

    Cheers.

  3. Hi,

    I have a range of data (A1:D4) containing random numbers.

    There is another range in A10:D14, which has another random numbers section.

    Question: how can I highlight cells in A1:D4 if numbers match any from A10:D14?

  4. Hi Prashanth,

    Thank you for the great tutorial.

    What I am trying to do is if the value of cell A1 is “Promo” and F1 is “Cancelled,” I want the background of A1 to be blue.

    I would appreciate it if you have any insight into how I could do this.

  5. Hi Prashanth,

    I am a trader in equities.

    I am using google sheets in my day-to-day use to track stocks. I stuck up at one point.

    My format is something like this below :

    Stock — Sector / Industry — Updated date & Time — Mkt. Price — Last Closing — Open — High — Low

    I want to highlight the name of the stock, which rises by (let’s say ) 2 % up or down from its open price.

    How can I reset my Google sheet to achieve the same?

    Regards,

  6. Hi Prashanth,

    I need help. I’m creating a tracker, and it’s a non-numerical value.

    Status 1:- My first condition is =$I2="Take Home Assessment" the entire row will be highlighted yellow (this one worked).

    But I have another condition. If the candidate failed the Take Home Assessment-

    Status 2: =$L2="Unsuccessful" the entire row should turn from yellow to grey.

    How can I overwrite the color/highlight of Status 1?

    • Hi, Maria Maria,

      As you may know, you require to add both the rules. The order of them must be as follows.

      Rule 1: =$L2="Unsuccessful"
      Rule 2: =$I2="Take Home Assessment"

      Note:- You can drag and drop the rules to change their order.

      • Hi Prashanth,

        Glad to hear from you.

        Rule 1: =$L2="Unsuccessful" (Grey) – this conditional format works if $I2 is empty.

        But if =$I2="Take Home Assessment" is applied, Rule 1 doesn’t work. I can select “Unsuccessful,” but it doesn’t turn the row to Grey 🙁

  7. Hi Prashanth, thank you so much for your great article!

    I’m trying to get column ‘E’ to highlight if columns AC/AE/AG/AG all contain ‘X’ but am struggling, what is the best way to address this? And/OR? IF?

      • Thanks for the reply Prashanth,

        I tried inputting that in my google sheets conditional formatting for column ‘E’ as a custom formula and it seems to be highlighting at random and everything but the lines that contain all 4 X in AC/AE/AG/AJ.

        • Hi, Amy Smith,

          Apply to range: E2:E, not (entire column E)

          I haven’t considered column AJ. So, here is the modified formula.

          =AC2&AE2&AG2&AJ2="xxxx"

          If the above doesn’t help, please share a sample Sheet via comment which won’t be published.

  8. I am wondering if you can help. I want to do something similar to this. From A1:B26, I have a list of criteria. Let’s say in Column A, I have a name, and in column B, I have a color, which can change based on other criteria and formulas I have set up.

    From A27:B, I have a list of data points. Let’s say I only want to highlight the data points that match A1 with the color listed in B2.

    • Hi, Davida,

      Formula rule for the range A27:Z

      =$B27=vlookup("Red",{$B$1:$B$26,$A$1:$A$26},2,0)

      Lookup criterion “Red” in B1:B26 and return the name from A1:A26. If that name matches in B27:B, it highlights.

      If this doesn’t help, you may share a sample of your sheet.

  9. Hi, Prashanth,

    I tried your formula above for more than 2 criteria. But it doesn’t seem to work. Don’t know where is my mistake. The formula is;
    =AND(OR(H3>8.01,H3 and <12.00 highlight RED. If C1=OUT, Value in H3:AM100 <17.3 highlight RED

    • Hi, Desmond,

      Thanks for sharing your example sheet. I accessed it and added the below two multiple criteria highlight rules.

      RED: If the drop-down in cell C1 has the value “IN”:

      =and(H3>8.01,H3<12,$C$1="IN")

      ORANGE: If the drop-down in cell C1 has the value "OUT".

      =and(len(H3),H3<17.3,$C$1="OUT")

      When you change "IN" to "OUT", you may be required to wait a few seconds for the cells to highlight as your sheet is slow responsive due to heavy formulas.

  10. Hello,

    I have been trying to put my scenario into sample formulas shown above and cannot figure it out.

    I have two columns that contain checkboxes – columns E & H. The text is Red at the beginning for any data entry, and there is a conditional formula coloring a row based on Column C (Last Name).

    So, when Column E is checked, I would like it to remove the row coloring. Then, when Column H is checked, I want it to change the text to Black.

    So, I can get EITHER of these rules individually but not both at the same time. Can anyone help?

  11. Hey there,

    I’m messing around with a Google Sheet’s conditional formatting and checkboxes. I’m wanting to change the color of a row based on what checkbox is checked (aka ‘cell’=TRUE).

    My range is A2:Y1503. I have my entire first row as a header. I’m using a custom formula and here it is:

    =$I2=TRUE

    I have columns I:N strictly for checkboxes. I want a row to change to another color if I2 and J2 are checked or only J2 is checked.

    What’s the correct formatting for the AND/OR?

  12. Hello, I was wondering if it would be possible to highlight a row based on two cells in the row when one of the cells let’s say G hits the same or less quantity as J as a reorder point?

  13. Hi,

    I have been looking for days to solve a problem with shading and filtering.

    I have a large spreadsheet with all sorts of data in it and I have added a help column to allow me to shade alternate group of rows based on a column’s data using the formula =MOD(IF(ROW()=2,0,IF(D2=D1,J1, J1+1)), 2)

    The problem is a need to filter the data all the time losing the alternate shading since the formula still counts hidden rows giving me same shade if the group in between is hidden.

    Please help to keep alternate shading grouped by column data regardless of filtering.

    I prepared a simplified copy of the spreadsheet in the link below.

    Note: Link copied then removed by admin.

    Thanks in advance!!

  14. Hi,

    Hoping for some help with conditional formatting of checkboxes.

    Column B is a checkbox for Priority tasks and will highlight the column C task if it is checked. Column D is a Completed checkbox that I am attempting to “strikethrough” column C task if it is checked.

    Basically, two different formulas in two different columns affecting a single third column.

    I can get them to work independently but if I have one of the checkboxes in column B checked (which causes column corresponding task in column C to be highlighted), then click on the checkbox in column D to indicate that the task is completed, it won’t produce the strikethrough that I need.

    Help, please!

    • Hi, Leah,

      I guess I have correctly interpreted your query.

      You have tick boxes in B2:B and D2:D, and the tasks to highlight are in C2:C, right?

      You want to highlight the tasks in C2:C in two ways (using tick boxes in two columns).

      Conditional Format Rule 1 for the Range C2:C.

      =AND(B2=TRUE,D2=TRUE)

      Formatting Style: Fill Color & Strike-through.

      Conditional Format Rule 2 for the Range C2:C.

      =B2=TRUE

      Formatting Style: Fill Color.

      Please make sure that the highlighting rules are positioned as per my order above. If not it won’t work.

  15. Can you please help me with my issue?

    I trying to do an alternate color formatting. I’ve added a new column (Column D) with values of 1 and 0 (0 change to the grey background while 1 retains a white background).

    So far that works, but I need another formatting conditions wherein if Column C is Yes, the entire row will be bolded and change to blue color?

    How can I achieve that? Is there a way I can send you screenshot/snapshot so you can better see the issue.

    Thanks.

  16. Ok. Scenario – I have a Spreadsheet in Google Drive that I have the conditional format in to change the entire row Blue if it contains a 1 in the Column K. (=$K2="1") – Range is A2:CJ3077 if it matters.

    I want to add another layer that says if the number in Column CJ is above 90 then change the color to Red.

    Is this possible?

    • Hi, Tasha,

      I could understand that the data range is A2:CJ. Follow the below formatting rules.

      Red Color (it must the the first rule):

      First select this range. In the conditional formatting use the custom formula =and($K2=1,$CJ2>=90). I guess that column A contains the number 1, not the string “1”. If it’s string change the formula as =and($K2="1",$CJ2>=90)

      Blue Color (second rule):

      Then add one more rule. In that, you can use another custom formula =$K2=1 or =$K2="1"

      Best,

    • Hi Denise,

      A Custom formula like the one below will highlight all the cells in column A if the values in B=25 and C=30.

      =and(B1:B=25,C1:C=30)

      You can play around with this formula.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.