Comments on: Excel conditional formatting formulas based on another cell

This tutorial explains how to use Excel formulas to format cells and entire rows based on the values you specify or based on another cell's value, and provides a handful of formula examples. Continue reading

Comments page 40. Total comments: 1726

  1. Helpful information. Lucky me I discovered your website accidentally, and I'm stunned why this twist of fate did not came about earlier! I bookmarked it.

  2. Hi,

    Good day!

    Need help here please. I have data that needs conditional formatting as follows:

    If Person 1 achieves 1 to 5 points it will show result "POOR"
    But if the Person 1 achieves 6 to 10 points it will show result "GOOD"
    But if the Person 1 achieves 11 to 15 points it will show result "VERY GOOD"
    But if the Person 1 achieves 16 to 20 points it will show result "EXCELLENT"

    Can anyone help me to have the right formula for this? Thanks in Advance guys!

  3. A B C D E F
    start end est. work time|work days|days complete|days remaining
    2/4/2015 3/18/2015 30 30 10 15
    3/5/2015 3/19/2015 10 10 16
    2/23/2015 4/3/2015 29 29 27

    I NEED COLUMN F TO AUTOMATICALLY CHANGE TO RED OR GREEN. I NEED IT BASED OF COLUMN C.
    if F is more than C then I need it to turn green, and if F is less then C I need it turned red......
    Please help

    1. I have the same issue. I noticed all her examples are based on ROWS but i need columns.... I need my Column L to be wither RED OR GREEN according to cell Q1 which is a formula for TODAY "=TODAY()" I tried everything it seems to only apply ONE rule but it does not want to apply multiple. have you figured this out?

  4. Thank you, this tutorial was very helpful to me!

  5. I'm trying to apply a conditional format to a cell based on the value of another cell. Here's what I'm trying to do:

    if the value in Cell G10 is 0 (based on this formula (f11-g9), then cellH11 will be green. HOWEVER, because cell G10 contains a formula, I can't make it work. If G10 is hardcoded with "0", then it will work. Any ideas?

  6. Hello,

    I am trying to use the conditional formatting tool. I have 2 columns quantity ordered, quantity shipped, and the percent difference. I would like the percent difference to be colored red if it is +/-10% and yellow if it is +/-5%. Can you please help?

  7. If some one wants expert view concerning blogging and site-building then i suggest him/her to go to see this blog, Keep up the good work.

  8. I have been exploring for a little for any high quality articles or blog posts on this kind of space . Exploring in Yahoo I at last stumbled upon this web site. Studying this information So i'm happy to convey that I've a very good uncanny feeling I came upon just what I needed. I such a lot for sure will make sure to don?t fail to remember this website and provides it a glance regularly.

  9. I wander if it is possible to conditionaly format the cells in a table where in a top row is writen which cell in a coresponding column (below) will be highlighted (the values in that column are not in direct relation with values in a heading row.
    Here is fragment of such table, where i want highlight 1st, 8th and 9th value (which coresponds to the first column (bins) - althogh that column is redundant)

    1 8 9
    bins A B C
    1 70 0 0
    2 53 16 0
    3 36 20 1
    4 32 20 6
    5 28 24 7
    6 25 27 10
    7 16 26 18
    8 17 25 21
    9 9 25 14
    10 7 16 20

    thanks a lot for your help.

  10. I was just wondering if it is possible to format a cell (or a whole row in a table ideally) based on an other cell's color? For instance I have a budget sheet with two tables. In my table where I add expenses, I created a Macro to add a new row, and pick a random color for that row. In that row, I have a cell indicating the day of the month that expense is due. I would like it if in my other table, the cell (or row) that corresponds to that date can automatically use the same background color excel formulas: https://www.youtube.com/watch?v=ayVH-Y9-0M4.

    I hope I am not being too confusing haha. If so, I would just like to know if I could say: If this cell is that color, then this cell is also that color.

  11. I have a conditional formatting challenge I'm hoping to get some direction on.

    I have two columns.
    -First column is forecasting a "due" date (this date is auto filled based on a previous start date)
    -Second column is requesting the "actual" date

    I'd like to conditionally format the second "actual" column/cell to go red in the event that it is blank and that the current date is equal to or passed the "due" column date. Once there is a date in the "actual" column and is no longer blank no color will apply.

    Thanks for your help.

  12. I'm hoping to get some help with a conditional formatting problem I'm having.

    I have two columns
    -First is a forecasting due date.
    Two

  13. Thank you for this very detailed tutorial!

    I was just wondering if it is possible to format a cell (or a whole row in a table ideally) based on an other cell's color? For instance I have a budget sheet with two tables. In my table where I add expenses, I created a Macro to add a new row, and pick a random color for that row. In that row, I have a cell indicating the day of the month that expense is due. I would like it if in my other table, the cell (or row) that corresponds to that date can automatically use the same background color.

    I hope I am not being too confusing haha. If so, I would just like to know if I could say: If this cell is that color, then this cell is also that color.

    Thanks!

  14. Hi, I want to conditional formating rows based off of what is in two different columns

    Column1 Column2
    1 NG
    2 NG
    1 OK
    3 NG
    2 NG
    4 OK

    I have it set up right now that if its OK it hightlights the row gray and if NG it shows orange. I want to make it that if another entry is entered and it is OK but the first time it is NG it will change the row to gray. So for the example the first row 1 is orange because of NG but when you add in the second 1 with OK it will change the first row 1 to gray also.

    Thanks for the help!!

  15. Hi there! I could have sworn I've been to this blog before but after browsing through some of the post I realized it's new to me. Nonetheless, I'm definitely delighted I found it and I'll be book-marking and checking back often!

  16. Hi Svetlana,

    I have a table in excel. The cells in the table contain formula. When I click on one cell(say cell B2) how can I get those cells in the table highlighted where the values are greater than equal to {59/(clicked cell value)}.
    I am trying to use conditional formatting but can't implement both cell reference and condition function.
    Please help.
    Thank you...

  17. Hi!

    I have a problem with conditional formatting. I have columns A and B.
    Row; Column A ; Column B
    1; -0,87 ; -0,96
    2; -0,57 ; -0,23
    3; -0,66 ; -0,65
    4; -0,74 ; -0,76
    ...
    300; -0,78 ; -0,87

    I have altogether 300 rows and two columns with changing values. I would like to highlight the values in Column B in green or red whether the value is greater than or less the value in Column A at same row that the value of Column B is. I know it is possible to manually create the rule for each cell separately, but I have 300 (!!!) rows. Can the rule be copied to other cells so that the reference changes like the rows change (Column B3 refers to value in Column A3 and B5 to A5 etc.)? So I don't have to create the rule for each cell separately.

    Thanks in advance!

  18. Hi there I need solution for
    If cell A10 = any value
    Then cell A11 = 345 (fixed value)
    Any 1 can help?

  19. Can someone help me with this conditional formatting problem?
    I have a spreadsheet as follows:
    Col A Col B
    10 74%
    9 72%
    8 70%
    7 68%
    6 66%
    5 64%
    4 62%
    3 60%
    2 57%
    1 54%

    Raw Score 57%
    Rating 2

    In general, how can I highlight the specific cell in Column B where it corresponds to the Rating of 2 (in Column A and reported in cell B13)?

    In this example I want to highlight the cell containing 57% in Column B since it corresponds with the Rating of 2 in Column A (and reported in cell B13).

    Thanks.

    1. Hello Alan,

      Select the range from B2 till B11 and create a conditional formatting rule using this formula:
      =$A2=$B$13

  20. Hi,

    In Cell M4 I need to calculate whether a particular price (which is in another tab called pricing matrix)should be shown dependent on the figures in cell range C3:I52 (if these cells are zero value then the price in M4 is zero.
    However if there is a Y in any cell within the range K5:K52 then the price in M4 should be shown. I have inputted the below formula which sort of works however the cell M4 has lost the formatting for currency and decimal places. I have tried conditional formatting (I am no pro!) to no avail.
    CONCATENATE(IF(SUM(C3:I52)>0,'Pricing Matrix'!D26,0)&IF(K5="Y",'Pricing Matrix'!$D$26,0))

    Please help!

    Many thanks

    Catherine

  21. Hi
    I am trying to show icons for what I would think would be a simple task but I can't seem to make it work.
    In column "N" I have a current rate percentage. In column "O" I have a target rate percentage. I want to use the icons to show a green check if the target has been met, a yellow exclamation point if the target has not been met, and a red stop light if the current rate is 50% or more below the target rate. Basically just showing which rates have been met, are almost there, and are in danger of not being met.
    Can anyone help with this?
    Thanks,
    Heather

    1. Hi Heather,
      If you're content with just using color indicators instead of icons, the following should help:
      ***Please note, I'm using Office 2007, so this answer may vary depending upon which version you're using.***
      Assuming your data starts on row 2 (N2 & O2 in the example you describe; perhaps because you have a column header title), you should be able to get the appropriate colors to show by entering the following formulas into the Conditional Formatting -> "Use a formula to determine which cells to format" in this order:
      1) =$N2 Fill -> Background Color to RED)
      2) =$N2 Fill -> Background Color to YELLOW)
      3) =$O2 Fill -> Background Color to GREEN)
      Unfortunately, it'll take me a bit more time to figure out the solution using the icons you requested. I'm actually at work right now, was on this blog searching for an answer to a question of my own, ran across your question & figured I may be of service within a reasonable amount of time.

      I hope that helps.

      Best regards,

      Randy

      1. Hi again Heather,
        I see that the equations I typed got messed up (not sure why), so I'm going to attempt to type these again, this time with spaces between items. Please note that the other info remains the same.
        1) = $N2 < $O2 / 2
        2) = $N2 < $O2
        3) = $O2 <= $N2

        Best regards,

        Randy

        1. Thank you Randy! I will give that a try. My boss had her heart set on using the specific icons instead of colors, however I think I have convinced her that it just doesn't seem possible. :)
          Sorry for the delayed response, been in training.

          Heather

  22. I am wanting to conditionally format case sensitive values. For example, I want upper case "F" to be in green text and lower case "f" to be in blue text. I am using Excel 2010 and so far have not been able to google-cure my problem. Can you help?

    1. Hello Sarah,

      Please use the Exact function and create two rules using these formulas:
      Green: =EXACT(H8, "F")
      Blue: =EXACT(H8, "f")

      1. Alexander, thank you for the help. I discovered that my problem was not related to the formula (as I had tried the one you gave above) but that in place of the cell number I was putting in the full array of cells i wanted the formula applied to. I should have left it as exactly the formula you have above and then applied that formula to the array of cells, not actually include the array of cell names in the formula.... if you get what i mean.

        Thanks for your help!!!

  23. I have two columns, column A has various dates entered, column B has a formula =A1+30 meaning I want to see a date that is 30 days past the date in column A. I would like to add a conditional format to highlight the cells in column B when they have reached that 30 day mark. How do I do that?

    1. Hello Betty,

      Select column B and create a rule using the formula below to mark only today's date:
      =B1=today()

      If you need to mark today and past dates, then please use this formula:
      =B1<=today()

  24. Hi Svetlana,

    A very happy new year to you!!

    Please can you help on below query.

    Date From Organisation Details/Requirements Sent to Report Status
    10/02/2015 Pending
    14/02/2015

    A is a date column that records the email receive date and F shows the status pending.

    Now i want F to turn "pending" word in red if it crosses 5 days from date in A column. Please can you advise if i can conditional format it and how.

    Thanks,
    Rachana

    1. Hello Rachana,

      Please select your column F from F2 to the end and then create a conditional formatting rule using the following formula:
      =AND($F2="pending",$A2+5

  25. Hi Svetlana, Thanks for this article, it's very helpful. I just wanted to ask you how to highlight one empty cell in a column (say "B") when other cell(s) (one or more, say "A" & "C") in the same raw is filled with some values. And the highlight remains until the cell in "B" is filled with some values. Is that possible? your reply will be very helpful and is highly appreciated. Thanks in advance..

    1. Hello John,

      Select column B and create a rule using this formula:
      =AND($B2="",$C2<>"",$A2<>"")

      1. Hello Alexander,
        Thank you very much for the formula, this is the exact one which I've been looking for. It really works !!! Thank you once again for your time for helping me...

  26. Hi. This is a very helpful article. I am having difficulty solving this. I have a table where every cell is a formula. Some are straight references to cells, "=C2", and some are vlookups, "=VLOOKUP(C2,...)".

    I would like to highlight the cell only if the formula is a vlookup. Everything I see indicates that the conditions refer to the calculated values not the formulas themselves. I cannot use ISFORMULA() since all cells have formulas.

    I appreciate any help.

    1. Hello Curt,

      If you use Excel 2013, then you are lucky. To fulfill your task, just select the table and create a rule using this formula:
      =ISERROR(SEARCH("vlookup(",FORMULATEXT(A2)))=FALSE

      Where A2 is the top-left cell in the selection.

      If you have Excel 2010 or earlier, then you need to replace FORMULATEXT with VBA user-defined function (UDF)

      Function formulatext2(cellSrc As Range)
      formulatext2 = cellSrc.Formula
      End Function

      If you are not quite familiar with VBA, please see how to add a VBA macro (UDF) to your worksheet here:
      https://www.ablebits.com/office-addins-blog/add-run-vba-macro-excel/

      Replace FORMULATEXT with FORMULATEXT2 correspondingly:
      =ISERROR(SEARCH("vlookup(",FORMULATEXT2(A2)))=FALSE

      1. I appreciate the quick and helpful reply. I do have Excel 2013 and your solution worked perfectly. Unfortunately, my client uses Excel 2010 and will not allow vba in the workbook I am creating. So I am back to square one. If you have other suggestions I would be anxious to try them.

        Thanks.

        1. I am sorry, but I don’t have any other suggestions.

  27. So if i want color fill in other cells by follow the date that i am input, How can i setup the formatting formulas?

  28. Hi, I've setup a training spreadsheet and added conditional formatting so that the cell turns red if the expiry date has passed (but only if the cell contains a value.

    =IF((AND(K11<TODAY(),K11"")),TRUE,FALSE)

    Trying to setup an additional rule that turns it yellow if that expiry date comes within 2 months of the current date but not sure on the details of the formula. i thought something like this maybe but its not working.

    =IF((AND(K11<TODAY+60(),K11"")),TRUE,FALSE)

    Any help would be greatly appreciated.
    Thanks

    1. Hi Steven,

      The formula is correct except that parentheses should be after TODAY(), not after 60. Please try this one:

      =IF(AND(K11<TODAY()+60, K11<>""),TRUE,FALSE)

  29. I am trying to figure how to format the first cell in each row so that it will change to a color when all the cells are populated within that row (columns A-R). Some of the cells have text, some have numbers, and some have both. I am wanting to do this so that I know which rows are complete, without having to scroll back and forth and visualizing each one.
    Each month the number of rows I have varies, so it may be 90 one month, it may be 130 another. The first row is a title/header row. The first column is populated with names. Any ideas?
    Thanks!

    1. Hello Christine,

      Select the column A (from A2 till the end) and create a conditional formatting rule using this formula:
      =COUNTBLANK($B2:$R2)=0

  30. hi,

    i have this check list with a checkbox, and i need to know how i can make the question status cell to display a text(done, pending) while changing the cell color (red to green),when i select one of the checkbox answer.

    ex. do you have a list of traces on PCB? []yes []no []n/a [question status]

  31. I am using MS Excel 2010. I want to use conditional formatting for B8 to B21 ( Format only Top-Green and Bottom-Red ranked values ) excluding 0.

  32. Hi,
    Greetings.

    in condition formatting check the cell value, if it is true assigned zero in another cell how?
    Please kindly send the formula

    Thanks
    Ali Ahammad.

  33. please help me
    I have this problem ( I create a conditional formatting to cell $I$2 (((cell value - less than - =$H$2-$H$2*10% )))

    is there away to create a conditional formatting to all cell below depend on the right cell like this

    (((cell value - less than - =$H$3-$H$3*10% ))) to cell $I$3
    (((cell value - less than - =$H$4-$H$4*10% ))) to cell $I$4
    (((cell value - less than - =$H$5-$H$5*10% ))) to cell $I$5

  34. This is a great list of conditional formatting uses! I have one I would like to see if you can tackle. I would like to highlight a range of values (item numbers) for a list of specific item numbers that qualify. The list may be small or it may be quite large. Would I need to do an OR function for each of the items in the list or is there a simpler way to get this done? Thanks!

    1. GREAT columb. More insightful than the videos. Thanks.

  35. conditional formatting for cell B1- if cell A1=Optimize and B1 is greater than 0, red (or whatever)

    A1 B1
    Optimize 1

    1. Use this Formula

      =AND($B1>0, $A1="Optimize")
      Select B1 Column.

  36. sorry for the double post. it changed.

    Hi there..
    Been stuck with my project already.
    I have a value in column A.
    And i need to apply a 3-color scale on column B depending on the value of column A.
    Condition:
    If column A=<1 - column B turns red
    if column A=<the half of A - column B turns yellow
    if column A= the value of A - column B turns dirty white

    i think this is simple but im getting invalid formula.
    why's that? this is what i've been doing

    on column B3, i enter this
    =$A$3=$A$3

  37. Hi there..
    Been stuck with my project already.
    I have a value in column A.
    And i need to apply a 3-color scale on column B depending on the value of column A.
    Condition:
    If column A=<1 - column B turns red
    if column A= the value of A - column B turns dirty white

    i think this is simple but im getting invalid formula.
    why's that? this is what i've been doing

    on column B3, i enter this
    =$A$3=<1
    =$A$3=$A$3

  38. Hi,

    I am in desperate need of some help with something if possible.

    I am trying to conditionally format cells in a column (E, range 3-96) to:

    -turn black if the cell next to it in column D is blank and the cell in column E is also blank.
    -turn orange if the cell next to it in column D is blank but the cell in column E contains a time.

    Any ideas?

    Thanks in advance!

  39. I would like to change my text value in column E and F based on the text entered into any cell in column F.

    For example: If I enter in any cell in column F "BBL" I would like the "BBL" in column F to be red as well as any text I enter in column E but only in that specific row. I would like this formatting to work for the entire spreadsheet.

    1. Hi there..
      Been stuck with my project already.
      I have a value in column A.
      And i need to apply a 3-color scale on column B depending on the value of column A.
      Condition:
      If column A=<1 - column B turns red
      if column A=the value of column A - column B turns dirty white

      i think this is simple but im getting invalid formula.
      why's that? this is what i've been doing

      on column B3, i enter this
      =$A$3=<1
      =$A$3=$A$3

  40. Hi, I want to conditional formating rows based off of what is in two different columns

    Column1 Column2
    1 NG
    2 NG
    1 OK
    3 NG
    2 NG
    4 OK

    I have it set up right now that if its OK it hightlights the row gray and if NG it shows orange. I want to make it that if another entry is entered and it is OK but the first time it is NG it will change the row to gray. So for the example the first row 1 is orange because of NG but when you add in the second 1 with OK it will change the first row 1 to gray also.

    Thanks for the help!!

  41. I want to use the conditional formatting to color a column of cells based on "yes" or "no" in another cell. I tried walking through the steps above and got nothing. I also tried formatting it as a table and using the COUNTIF equation. I got it to work on a test cell but when I tried to duplicate it with the entire column I got nothing.

  42. Hi Svetlana, I'm having a problem trying to find if the numbers in a column are in a sequence or not.

    I want to highlight a cell whenever the it is not equal to the cell above it + 1.

    So:

    2
    3
    4
    2 <-- HIGHLIGHT
    5 <-- HIGHLIGHT
    6
    8 <-- HIGHLIGHT

    Thank you for your help

  43. hi
    tanx for your most useful tips
    I have a question
    I wanna write formula that says if you search a number in column b by Crtl+f
    and it finds it the near column (column a) type ok and it change the color of it automatically...
    is it possible anyway?

  44. Hello,

    I am trying to run down a large list full of one's and zero's. If it is zero, then the corresponding row, 2 rows to the left, value I do not care about. If it is a one, I then want to essentially add it to a mixing pot with all of the other values that have 1 corresponding with them, then find the max value of all of them. HELP!?

    1. Hi Will,

      I understand that you have a list of 0s and 1s but I'm not sure I understand the task. Can you please try to describe it in the following way:

      -if cell A1 is 0, then do what?
      - if Cell A1 is 1, then do what?

  45. Hello,
    I have a problem of replacing a cell value if th background color of the cell is Yellow: for example

    Column A B
    1 2
    1 2

    I would like in a new sheet to put in (column A) 1 or 2 depends on the Yellow color in A1 and B1,
    so if A1 is highlighted in Yellow then put in the new sheet A1 code 1 if not then put 2

    How I do that?

  46. Hello,

    I'm currently using 2 sheets to keep track of client information. sheet 1 (client info) has columns listed as A1-SSN, B1-Lastname, C1-Firstname, D1-Phone#, and E1-paid (which is blank since the service occurs before payment) and each column has about 100 entries of the information. Now in sheet 2 (payments) I have the same columns listed in the 1st row and a vlookup formula in all the cells so that when I enter the SSN number in A2, the rest of the 2 row fills in with the names, numbers, etc. My question is how do I make it that when I enter 'yes' under the payment column (E2), my sheet 1 with also fill in 'yes' in column E for the right client?

    Thank you for any help you can give

  47. Hello!

    Simple request. I have had trouble finding the proper way to do this. I want to be able to enter a name in a cell on Sheet 1 of the MS Excel Workbook (2010) and have that same name (or data) repeated in a corresponding cell on another Sheet in the same workbook as I enter it in the one place. Basically I need names of associates to appear in multiple places, but only want to enter it once. Any tips?

  48. Good day!
    Hope you can help, as I tried everything and nothing works:
    I have two columns (Sales in 2013 in one columns, and sales in 2014 in another column - this is made depending on customer). Now I have to figure out, from a glance, which customer bought more in 2014, which less

    Column A B C
    Sales in 2013 Sales in 2014

    Purchaser 1 2131442,93 1783657,38
    Purchaser 2 295638,22 2609,31
    Purchaser 3 1733348,19 865579,68
    Purchaser 4 1472991,01 418399,35
    Purchaser 5 1490602,99 120403,99
    Purchaser 6 2927921,82 2729046,74
    Purchaser 7 452169,39 392953,53
    THank you for your help.

  49. I would like to create a conditional formatting rule for the following:

    Cell C2: If cell C1=36 then the text in C2 would be 3x/8 weeks, 2x/6 weeks (36)

    Once that is completed, I'd like to create additional conditional formatting rules for the same cell.

    Is that possible?

    1. Hi Npratt,

      I'm not sure I exactly understand the condition. Assuming that you want to put the text 3x/8 weeks in cell C2 if C1 euqals 36, otherwise - 2x/6 weeks (36), here is the formula for cell C2:

      =IF(C1=36, "3x/8 weeks", "2x/6 weeks (36)")

  50. I am trying to highlight entire row based on a cell value

    Wxample: I want my formula to highlight entire row where cell value = MH000038, when I am giving the below formula excel is not considering the zeros it is removing

    Rule created = $C2=MH000038
    Excel converting it to =$C2=MH38 so no cells are highlighting

    any help will be appreciated.

    1. Hi Suma,

      Simply enclose the cell value in quotes so that Excel interprets it as a text string, like this:

      =$C2="MH000038"

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 :)