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 48. Total comments: 1726

  1. I have a similar problem that is not listed under your manual. I'm doing a sales analysis from period to period and I need to be able to tell when sales for a certian product either drop or go up by 15% all the sales figures are entered in percents as well.

    1. Hi Bradley,

      I am sorry, I can't make a proper formula without seeing your data. If possible, please send a sample workbook at support@ablebits.com and we'll try to help.

  2. I found the reason my conditional formatting formula didn't work is that I used a lower case letter for the row label rather than upper case.

  3. Can I ask a question – trying to format a pivot table and highlight the last column where the value is under the avg – eg 57709 is below para – please highlight the “4”

    Do you know any other way ? other than manually

    Mark

    57703 21 34 36 31 38 34 33 27 29 44 30 29 29 415
    57709 4 5 2 6 2 2 4 1 5 180 4 215 21.1 4 -17.1
    57712 25 20 21 23 28 32 25 17 30 17 27 24 28 317
    57715 9 8 16 7 15 16 7 11 13 9 113 12 20 256 19.66667 20 0.333333
    57901 1 1 1 2 3 1 3 2 2 1 1 5 2 25

    1. Hi Mark,

      I am sorry, I don't know a way to fulfill this task using conditional formatting formulas.

  4. Not sure if this can be done and I've tried a bunch of different ways to create a rule and keep coming up short. On my X axis I am using names. I know which names need to be in different colors. I cant seem to come up with the proper formula or rule to make this happen.The y axis which relates to $ has nothing to do with what I need the x axis to do so writing a rule to that end wont work. Any suggestions?

    1. Hi Nique,

      Did you try selecting the entire table and creating a rule similar with the below formula?
      =A2="name" (where A2 is the left-most cell of the applied range)

      If this is not the result you are looking for, please send me a sample workbook at support@ablebits.com and include the result you want to get.

  5. Hi Svetlana,

    I am trying to set up conditional formatting rules to evaluate the following excel spreadsheet.

    Actual value column to a Budget column value. Based on the Actual value column if it is 10% or less from budget value color yellow, if greater than 10% color red and if monthly value is equal to budget color green. I have set up 3 rules with Use formula to determine which cell to format, but it not doing what I want it to do?

    Examples:
    Rule 1 B5=C5 format green
    Rule 2 B5>C5*.10 Format Red

    I have tried using $B5 or $B$5 same results,

    any suggestions in accomplishing this task so I can have the color's automatically filled in? Thank you!

    1. Hi Shannon,

      The rule with $B5 should work, assuming that row 5 is the first row in the applied range.

      If it still does not, please verify the following:

      - Make sure you entered the correct column names (B & C)
      - Probably, the Green rule shall be applied when a monthly value is equal or _less than_ a budget: =$B5<=$C5
      - In the Yellow & Red rules, you should multiply by 1.1, not by 0.1. (Red: =$B5>=$C5*1.1)
      - Check if your numbers are formatted as numbers and not as text (they should be aligned to the right, without a green triangle in the top-left corner of the cells)

      If none of the above suggestions work, please send me a sample workbook to support@ablebits.com and I will try to help.

  6. Hi
    I'm trying to setup a conditional formatting with the icon sets and I need some help!
    I've this situation:

    B C D E
    A1 Sell to 20 L
    A2 Buy From 25
    A3 Sell to 30 M
    A4 Buy From 5
    A5 Sell to 15 H
    A6 Buy From 2

    I've setup a conditional formatting check for A1B1 that says if there's an N,L,M,H change to appropriate color (easy!)
    However in the A2B1 (and in every other cells) there's a number that I'd like to have compared to the every other cells that refers to the rows "Buy From" using the icon sets (bars value)
    Is there a way to do this without manually select every other cells and apply the conditional check?
    Also, once I've created the conditional formatting(s) for the column B1, can I copy paste its properties to the other columns by dragging the source column in my worksheet.
    I hope I've explained my problem :-)

    1. Hi Antoine,

      Sure, you can apply your rule to other columns. Go to Conditional Formatting > Manage rules, and change the range in the box under "Applies to".

      As for the icon sets, it is difficult to understand what data you have in the columns without formatting. Please send us your sample workbook to support@ablebits.com and we will try to help.

  7. Hi

    I'm trying to create a conditional formatting rule, but nothing seems to be working, could you help.

    If cell Z3 is equal to or greater than 25 I want cell C3 to be green, if Z3 is between 15 and 24 inclusive I want cell C3 to be orange, if Z3 is equal to or less than 14 I want cell C3 to be red.

    I've managed to get simpler conditional formatting rules to work, but when I've gone to copy for the formula into other rows it wont work.

    Any suggestions please?

    1. Hello Emma,

      Most likely, the problem is in using proper absolute / relative cell references in the formulas. You can find more information about different cell references types in this article: Relative and absolute cell references in conditional formatting rules.

      If you need to compare values in each individual row, select all the rows you want to format and create 3 rules with the following formulas (assuming that row 3 is the first row where the formatting is applied):

      Green: =$Z3>25
      Orange: =AND($Z3>=15, $Z3<=24)
      Red: =$Z3<=14

      In case you want to format all the rows based on the value in cell Z3, use absolute cell references in the above formulas, i.e. $Z$3:
      Green: =$Z$3>25
      etc.

  8. Hi
    I am trying to highlight duplicate data in 1 column only if they data in the next column are also duplicated. How do I do that?
    Thanks

    1. Hi!

      You will need to insert a helper column. Suppose, the original columns are A and B, and column H is the helper column.

      - Type =A2&B2 into the cell H2 and copy the formula down column H.
      - Select columns A & B and create the conditional formatting rule to highlight duplicates with this formula:
      =COUNTIF($H$2:$H$100,$H2)>1

      As an alternative, you can also use our Duplicate Remover add-in (the Color duplicates option) to highlight duplicates. In this case, you won't need a helper column.

  9. Hi

    How to use the function INDEX and MATCH together.Is it better to use than Vlookup?

  10. Sir,
    I have entered in first column category such OPEN,OBC,SC,ST etc then OPEN for 450, OBC for 250, SC for 100 without type the number in infornt of other col. automatically. How it is possible

  11. I want a row to highlight if one cell in that row is not empty, I have chose the row and then in the formula typed =NOT(ISBLANK$I15) and it only highlights the A15 if I put something in I15. this works if I just want to highlight one cell in that row

    1. Hello Patsy,

      You can highlight the entire row if one or several cells in this row are blank using this formula:
      =5-COUNTBLANK($A1:$E1)=1

      Where 5 is the number of columns, and 1 is the min number of empty cells.

      You can also use this simplified formula, where 4 is the difference between the 2 above mentioned numbers:
      =COUNTBLANK($A1:$E1)=4

      1. Thank you Svetlana for answering. I did not make myself clear. Column "I" is blank until a deposit is made and then I put a date there. When I put a date there someone else has to add data to our finance data system so I want it to highlight the entire row when I add something too Column "I" in order for them to see it at a glance. At first I was only highlighting one cell with the formula =NOT(ISBLANK$I15)). The other users felt like it would be easier to following if the complete line was highlighted.

        1. Patsy,

          In this case, simply apply your existing rule to the entire table. Click Conditional Formatting > Manage rules, and change the range in the box under "Applies to".

          Also, make sure all brackets are in place in your real formula, one is missing in the formula you posted here : )

        2. Thanks everyone I found my answer after reading for two hours others problems, and I found someone that had a similar problem and I got it to work. Thanks

  12. Great just to confirm I have noumerous list like
    A B
    1 3
    1
    3 5
    4

    etc. I want conditional formatting as follows
    Format all cells in colum B if the respecting cell is NOT blank and if
    the cell in column B is greater than the cell in column A
    =AND(A1"",B1>A1). the question is how to applying to all the column using respective or absolute values

    1. Hi Stratis,

      You need absolute column references (since both columns are constant) and relative row references, like this:

      If a cell in column A is not empty and if the cell in column B is greater than in column A:

      =AND($A1<>"",$B1>$A1)

      If a cell in column B is not empty and if the cell in column B is greater than in column A:
      =AND($B1<>"",$B1>$A1)

      You can lean more about proper use of absolute and relative cell references in conditional formatting rules in this tutorial:

      https://www.ablebits.com/office-addins-blog/relative-absolute-cell-references-excel-conditional-formatting/

  13. I need a formula I could use that will help me calculate the average of a group cells in one column based on the condition of another column. For example, I want to find the average for data in column D based on data in column E, but the data in column E must only be >750 and <1001. HELP PLEASE!!!!

    1. Hello TJ
      For us to be able to assist you better, please send your sample workbook to alex@ablebits.com.

  14. Svetlana,

    Great blog.

    I would love to find a simple answer to my question and would appreciate your help.

    Two columns A & B

    Column A has a numbers in it such as

    1000-50-50-5060-508150-000000-000-522500- Total
    6000-40-40-4030-409555-000000-998-522500- Total
    6000-40-40-4040-401220-000000-999-522500- Total
    6100-41-41-4110-411001-000000-004-522500- Total
    6300-80-51-8070-807010-000000-000-522500- Total

    Column B has a list of starting numbers such as
    1000-
    2300-
    2600-
    2702-
    2750-
    4001-
    4022-
    6000-
    6067-
    6100-
    6161-
    6200-
    6261-
    6300-
    7100-

    What i would like is for Column B and the cell "1000-" (and other numbers) to be red if there are numbers in column A that start with "1000-" and the other numbers. I only need color in Column B. It seems simple enough but I cannot find a way to do it. I hope that you can give me the solution.

    Thanks.

      1. Hi Ma'am, what is the formula if the quantity of columnA is equal columnB then it highlights the rows if they are equal. ex. 10 rows, 1 row had equal quantity this rows must be fill in color. Thanks

      2. That was exactly what I was looking for. Thank you so much. This will help so much.

  15. Thanks Svetlana, but the questioned I originally asked seems to have been cut short, so I am listing again what I'm trying to achieve.

    I need to have the cells in a specific column colour code according to the rules below:

    - where return date is current date 'red' and lastly
    - when a date is entered in the 'actual return date' cell (different cell)'blue'.

    So assuming the 'return date' cell is B2 and the 'actual return date' cell is F2, can you please advise what the formulas would be for each rule listed above. Additionally, would I need to select 'use a formula to determine which cells to format'?

    Many thanks, Kevin

    1. Again my comment above has been cut short the rules I need to create formulas for, so I will list them again below:

      - where return date is current date 'red' and lastly
      - when a date is entered in the 'actual return date' cell (different cell) 'blue'.

      1. The list of rules keeps getting cut short in each post, so listing them again below:

        1. where return date is current date 'red' 4. when a date is entered in the 'actual return date' cell (different cell) 'blue'.

        1. The comments in my post keep getting cut short and altered. Is there an email address I can send my list of rules I need to create formulas for?

          1. Kevin,

            Please email at alex@ablebits.com. If possible, please include a sample workbook with your data.

            I will try to reply as soon as possible.

  16. Hi
    I have list of weeks like Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday. And have created a dropdown list for selecting any one. Have tried conditional formating to colour the selected week using lookup formula. But the same is not working even though the formula is correct.
    Weeks are listed A1:A7 and dropdown list at B1, formula I used for conditional formating was =LOOKUP($B$1,$A$1:$A$7)=$B$1
    Kindly help me with correct solution

    1. Hi Mahabaleshwara,

      Do I understand it right that you want to format a cell in the range A1:A7 that contains the same day of the week that is currently selected in the drop-down list in cell B1? If so, then simply select cells A1:A7 and create a rule with this formula:
      =$A1=$B$1

      As I explained in the article, in conditional formatting you write a formula for the top-left cell only and it gets applied to the entire range you've selected when creating a rule.

      If you are looking for something different, please clarify.

  17. I am trying to find a way to incorporate conditional formatting into my behavior system in my school. Every time a student goes a week without having any behavior "marks" they get to move up a level. Is there a way to enter in the number of "marks" a student receives and anytime a zero is entered it changes colors. The hard part is that the second time they have a zero, I would like it to change a different color, as well as the third, fourth, fifth, and sixth time each different colors as well. Keeping in mind that the student may have zero marks one week, and then 4 marks the second week. Any assistance would be greatly appreciated! Thank you in advance for your time.

    1. Hello Alisa,

      Please specify whether you want the color to change for consecutive zeroes only, or they can be mixed with other numbers, e.g. 0, 0, 2, 0, 0.

      If the latter, you can use the following formula:
      =COUNTIF($B2:$F2,"0")=5

      Where $B2:$F2 are the columns where you enter marks during the week, "=5" is the number of zero marks for a certain color.

      1. THANK YOU! This was exactly what I wanted!

        1. One other question for you. I applied this to the first row, but I have 100 students on this spreadsheet. How do I apply this to each row separately?

          Thanks again!

          1. Thank you!

          2. Hi Alisa,

            When creating a rule, just select all the rows to which the rule shall be applied. Then you write the formula for the first row, and Excel will automatically "recalculate" it for other rows.
            You can change the existing rule by clicking Conditional Formatting > Manage Rules > "Applies to" field.

  18. I should specify, I am using the conditional icon sets Green, Yellow and Red.
    Thank you!

  19. Hi,
    I regularly use conditional formatting, but for whatever reason the correct icon colours won't show right away for only a couple of cells.

    But..as soon as I copy and paste the exact same values over itself, it works.

    Or if I open the conditional formatting rules and go to edit it, and click in one of the "value" boxes (not changing any values) and click "Ok" and "Apply" it works.

    Or if I highlight everything and unhide rows (even though no rows are hidden), it works.

    I have checked the parameters a hundred times, and it all appears correct, but it's not showing the right icons until I do either of these three things.

    Help?

    1. Jeremy,

      It is hard to say what can cause the problem without seeing your data. If possible, please send your workbook at support@ablebits.com and we will try to help.

      1. Hi

        What was the problem with this spreadsheet? I am having the same issue. The colour doesn't appear straight away but when i minimise the window and open it back up it appears okay.

        Thanks
        Kirsten

  20. Hi Svetlana,

    I'm a novice at conditional formatting and need your help to create conditional formatting rules to change font colours of a date value in a specific cell dependant on that dates relation to the current date, for a equipment rental tracking spreadsheet. I need to create the following rules: where return date is current day 'red' and lastly when a date is entered actual return date cell (different cell) 'blue'.

    1. Hi Kevin,

      You can use the following formulas to create conditional formatting rules:

      Red: =AND($F2="",$B2>=today())
      Blue: =$F2<>""

      Where $F2 is the first cell in the column "Actual return date"; and $B2 is the first cell in the column "Return date", not including the column headers.
      You can apply the above rules to one or more columns or to the entire table. In the latter case, the whole rows will be highlighted.

  21. In one of my Columns I need to ensure that only 10 numbers are input. I would like the cell to turn yellow if any more or less characters are input. This will help to alleviate me having to track people down for corrections if they know immediately that they have input this number combination with to many or to few characters.

    1. Hello Geoff,

      I think you can create a rule with this formula
      =OR(len($G2)<10,len($G2)>10)

      Where G2 is the first cell in your column, not including headers.

  22. Is there a way to move a whole row to a new sheet based on the contents of one cell? I have a column titled "loan status" and it is either marked with a "C" (closed) or "O" (open). I would like all the closed loans to be moved to Sheet2 once I change the "loan status" to a "C". Thanks.

  23. hi
    I hope you can help with what must be very simple, but I can't get to work and no one else seems to have asked the question anywhere(perhaps because it is so simple LOL)
    I am keeping a record of electricity consumption by month. If for example the figure in B1(Jan 2014)is less than the figure in A1 (Jan 2013) I can conditionally format B1 to go green, but I can't for the life of me get B1 to remain clear if there is no figure in it. I'm guessing that a blank cell is less than any figure in A1? Is there a way to do it?
    Many thanks
    Steve

    1. Hi Steve,

      You are right, the solution is simple, though not obvious at first sight : ) You can achieve the desired result in 2 ways:

      1. Use the following formula for column B:
      =AND($B1<>"",$B1<$A1) The expression $B1<>"" checks whether a cell is not empty, and the AND formula applies the rule only if both conditions are met. 2. In addition to your current rule, create one more rule of the "Format only cells that contain" type > Cell value > Blanks for column B. Alternatively, you can create a rule based on this formula =$B1="", which also applies to blank cells only. Do not set any format for this rule. Finally, make sure this rule is the first in the list, and select the option "Stop if true" next to it.

      1. Brilliant! thank you; option 1 worked perfectly. Thank you so much.
        Steve

  24. Hello-

    So I am using Excel 2010 to keep a list of my exchange servers and all of the DBs at my company. I get a report mailed each morning and I take the values from those reports and import them into excel. From that data I create a bar graph using conditional formatting, but for some reasons the rules will not affect TWO CELLS. Only two. I have the rules setup to affect a range of cells from H6-H37. H10, and H20 simply do not respond to the rules I have configured. I have tried everything...re-writing the rules, I even specifically set the range as those cells individually and the rule still wouldn't affect them. Any ideas?

    Thanks in advance for the help.

    1. Hello,

      Most likely the problem is with the format of those 2 cells. You can try to copy the formal of some other cell where the rules are applied correctly using Excel's Format Painter. Did it help?

      Also you can check the list of rules in the Manage Rules dialog to make sure there are no other rules set for those 2 cells that override your new rules.

    2. Where is this pulling my picture from? That is creepy...

      1. Hello,

        The picture is automatically pulled from gravatar.com (Globally Recognized Avatar).

  25. Thank you. It's for a fantasy football draft, so the 3 data columns are Player Name, Position, and Team.

    I want to base the formatting on Position. So, if Position = QB it shades all 3 cells yellow. If Position = RB it shades them green... and so on.

    1. Thanks for the details, now the task is crystal clear : ) You can achieve the desired result in this way:

      - Select all the rows with data in those 3 columns, not including the column headers.
      - Create conditional formatting rules with the below formulas, assuming that column B is the "Position" column and row 2 is the first row with data:

      Yellow: =$B2="QB"
      Green: =$B2="RB"

  26. Hi,

    I'm trying to format 3 columns of data. Each row of these columns needs to be formatted based on 1 cell in that row. I am trying to format each row given 5 variables for that 1 cell. Is there a way I can do this?

    Thank you.

    1. Hi RW,

      I believe this is possible. However, to be able to suggest a formula, I need to know a bit more about your data. If you can provide an example of what exactly values you have in each of the 3 columns and what condition you want to base the formatting on, I think I will be able to help better.

  27. Hi.. I have conditionally formatted a row of data to highlight the highest cost and lowest cost for a product (each cost in a different column - b,c,d,e).
    How do I copy this format down to 1457 individual rows, without having to paste the format to each row individually?

    1. Hi Jocelyn,

      In conditional formatting rules, cell references are relative to the top-left most cell in the applied range.

      So, simply select all 1457 rows, and create 2 rules with the below formulas (assuming that B2 is the top left-cell in the applied range):
      =MAX($B2:$E2)=B2
      =MIN($B2:$E2)=B2

  28. Hello I am working on a retirement planning spreadsheet. I have keyed in a started working age, and a retirement age of 67. I need help in creating a formula that stops the series at age 67. For example, If I key in age 26, in my table, my series goes to age 71 bc I orginally formatted the table to have a basic start age of 22. I would like to be able to create formula that stops the series at age 67 regardless of the age you start working.

    1. Hi James,

      Try nesting your current formula inside the IF function in this way:
      =IF(A2<=67, YOURFORMULA, "")

      Where A is the collumn with the current age, e.g. 22. Then А46 will have "68" and at this point the formula stops the series.

      If the above approach does not work, please send us your sample workbook with the existing formula at support@ablebits.com, and we will try to figure this out.

  29. Hi
    I have a case.If i type a text "IN" in cell A1, the next cell B1 should be blank.No other values could not be typed in that cell.in same way if a description is already in cell B1 and if I type text "IN" in cell A1 it should get automatically deleted.Pls help me out.

    1. Hi David,

      If column B already has any values, I think conditional formatting won't work. This task requires a macro and you can try to find an example on some Excel-targeted forums like mrexcel.com or excelforum.com. I am sorry for not being able to help you.

  30. Hi Iam trying to enter a formula that returns the following

    In cells in Column J I will be entering employee names against locations in Column K, I then need Column M to return programmed and the whole row to be highlighted in Green,

    However if Column J returns RBS I need column M to return programmed but the row to be highlighted blue

    1. Hi Simon,

      I am sorry, I do not understand what "to return programmed" means and what RBS is. Can you please clarify?

      1. Hi

        What I would like to achieve is:-

        I have 15 employees who work in different teams, I would like to set up a formula that when I type the employees name (ie C Reed) into cell K2 cell N2 is populated with the word Programmed and the entire row is highlighted in green, but if I typed RBS into cell K2 Cell N2 is still popultaed with Programmed but the row is highlighted in blue.

        Thanks for helping

        1. Hi Simon,

          Thanks for the clarifications. Then you can try creating 2 rules with the following formulas:

          Blue: =AND($K2="RBS",$N2="Programmed") This rule should be the first in the list, with the option "Stop if true" checked.

          Green: =AND($K2<>"",$N2="Programmed")

          1. Hi Sorry

            I dont think I made it clear that if I typed RBS or my employees name in to cell K2 I would like the word Programmed to automaticaly appear in Cel N2 and the row to either highlight Blue if Cell K2 contained RBS or Green if an employees name is typed into cell K2

            Thanks for your help

            1. Hi Simon,

              Just enter the below formula to cell N2, and then copy it across the entire column:
              =if(K2<>"","Programmed","")

              This formula will enter the word "Programmed" in column N once you type an employee name in column K in the same row.

              And then, you can create the conditional formatting rules with the formulas I suggested earlier to color the cells in the way you want.

  31. I tried using this formula but then after it satisfies the first input value it will not do numeric series when inputing the next value

    =IF(ROW(A1)<=$D$7, ROW(A1), "")

    1. Hello!

      And what values do you have in other cells of column D and why do you compare with A1? If you can send us a sample workbook at support@ablebits.com, it would be much easier for us to suggest a proper formula.

  32. Hello, I want to create a numeric series starting with 1 based on the value entered in a column.
    For example:

    In column d, row 7, the value entered is 3, then column e, will automatically enter number 1, 2, 3 to rows 7-9.

    Then if I enter another value on column d, row 10 say for example 2, then column e will automatically enter 1 and to to rows 10 and 11.

    Please help

  33. I am creating a scheduling template for a staff of hundreds of employees. I need to make sure I do not schedule an employee wore than 5 days in a given week. How can I highlight cells if a specific name occurs in a block of cells, say b7 - h15, more than 5 times?

    1. =COUNTIF($B$7:$H$15,B7) >5

      figured it out.

      1. OK, here is a step further. Is there a way to highlight cells based off the same block of cells over multiple tabs. I tried "=COUNTIF('Batch Review:Rotary Opener'!$B$9:$H$28,B9)=1" and received and error saying that I could not use this reference in conditional formatting.

        1. Hi Brian,

          Conditional formatting rules require a more traditional formula format : ) Try out this one:
          =(COUNTIF('Batch Review'!$B$9:$H$28,B9) + COUNTIF('Another sheet'!$B$9:$H$28,B9) + COUNTIF('Rotary Opener'!$B$9:$H$28,B9) ) = 1

    2. Hi Brian,

      Try creating a rule with this formula:
      =COUNTIF($A$2:$A$20,A2)>5

      Where A is the column containing the employees names and A2 is the first cell in a block with a given name. Please pay attention to the use of absolute and relative cell references.

  34. Hi,

    Please help
    I have 2 sheets. I have a list of items on 1st sheet, it has item code (A1) next to it is description (B2) and so on.

    I am making sheet 2 with description only (populated from quickbooks). How do I make a formula to add the item code corresponding to its description on a cell next to it.

    Not all items are in the 2 sheet and they are in different order compared to the 1st sheet

    Thanks in advance

    1. Hello Eric,

      You can do this using a VLOOKUP formula similar to this:
      =VLOOKUP($A2,Sheet1!B2:C20,2)

      Where A is the column with descriptions in your Sheet2, B is the column with descriptions in Sheet1, and C is the item codes column in Sheet1. Please note that the VLOOKUP function cannot search on its left, therefore the Descriptions column (in Sheet1) should the the left-most column in your lookup range.

      Please see the following tutorial for more info:

      Excel VLOOKUP tutorial for beginners - syntax and formula examples

      Advanced VLOOKUP formula examples

  35. Hello,

    I have been working on a pivot table for receiving of parts for a specific product. Different parts for the product are received from different vendors. I am creating a file that will take raw data from sheet 2 and easily show and format the cells for each grouping of products when all the parts have been received.

    For example, product 1 is listed 10 times in column A because it has 10 parts to it before it can be built. Column C shows if the part for the product has been received. What I would like to have done is once the report I paste into sheet 2 shows that all parts have been received for product 1 in column C, to then highlight the name "Product 1" in column A in green. I would also like this to repeat automatically for every other product in column A when all parts in column C are showing received.

    Thanks for any help!

    1. Hi Josh,

      It looks like this can be done, but we need to see the structure of your data to be able to say with certainty and suggest a proper formula. If you send me your sample workbook at support@ablebits.com, we will try to help.

  36. Thank you, Svetlana.

    Very useful, although if you know a way I can run this without having to create an additional column that would be even more awesome! :)

    Pri

    1. Sorry Pri, I don't know such a way :( I can only suggest hiding that additional column.

  37. Hi Svetlana

    Hope you can help. Would you know how I can apply conditional formatting to a table where the row colours alternate as the column value (text) changes?

    For example: the column values are car, house, bird, table, anything else, and when the value changes, the row colour changes (2 colour choices). I can't apply a colour to each value as they are not all known. I just want two colours to alternate as the value changes so it's easy to spot the change.

    Thanks in advance.

    Pri

    1. I hope this is not a "too late" comment: you can apply a new rule to the same range. The only condition is that you do not apply the same format for different values. Now: if you do not know what are the values (as they will be appearing appear in your table) you can have a list of new values and mark in your table any new item (not contained in your list) with a special color or mark. You can use a formula from LOOKUP or similar do detect if your table has or not the "new value" in your master list...

  38. Hi,
    I have a workbook where I have work order numbers in column a and start dates in column f, in another sheet I have work order numbers in column d and start dates in column h. I need to be able to highlight a row if I have 2 different dates for the same work order number - Thank you so much

    1. Hi!

      Simply select the table where you want to highlight rows (without column headers), let's say in your sheet 1, and create a rule with this formula:
      =$F2<>Sheet2!$H2

      Where F2 is the top-left cell with dates in sheet 1, H2 - the top-left cell with dates in sheet 2, and Sheet2 - the 2nd sheet's name.

  39. Hi - this is a very useful site! I need to format cell C5 to say 'YES' if cell B5 is greater than 100, and for C5 to say 'NO' if it is less than 100. I am sure that this is very simple but I can't work it out! All conditional formatting seems to be to colour a cell or text, but not to put a work in a cell… Thank you :)

    1. Hi Lisa,

      You are right, this is simple, and conditional formatting is not needed :)

      Just enter the following formula into cell C5:
      =IF(B5>100,"YES","NO")

      1. Thank you so much! Now that makes sense! I have come across this before but must have completely forgot. Thanks again :)

  40. Hi
    I need to highlight any cells that contain an absolute value rather than a formula i.e. the formula has been overtyped with a value. Is this possible with conditional formatting?

    1. Hi Chris,

      If you use Excel 2013, you can create a conditional formatting rule with the below formula (where A2 is the top-left cell of your range):
      =ISFORMULA(A2)=FALSE

      If you use Excel 2010 or lower, you will have to add User Defined Function (VBA code) to your workbook because ISFORMULA was introduced in Excel 2013 only. Here is the function:

      Function IsFormula2010(ByVal cell As Range)
      IsFormula2010 = cell.HasFormula
      End Function

      If you do not have much experience with VBA, these step-by-step instructions will be helpful.
      After the above code is added, you can create a condition formatting rule with the same formula:
      =ISFORMULA(A2)=FALSE

  41. Hi Svetlana,

    I feel I'm really close to receiving an answer in this article. If you see "Compare 2 Columns for Duplicates", it doesn't have an explanation as to how I can have excel put these matching cells on the same row (your picture is a great example of my problem). I need them to be on the same row because I have data attached to the duplicates that changes monthly (however, the name remains the same). Do you know how I can have the rows match up?

    Thanks in advance for your assistance!

  42. Hi
    I have a roster schedule that uses conditional formatting for each day based on where the employee is (OT/ AL/ Work/ Off tour etc) What I would like to do is highlight the entire column of what day it is today.

    Ie column HE is today's date (29 July) I would like the entire column (which has other conditional formatting values and then blank cells) to be a certain colour so it is easier to navigate back to what day it is.

    I have the 'TODAY' date formula in cell A1.

    Have tried various ways and can get the single cell (HE) to highlight, but not the entire column.

    Thanks for any help

    1. Hi Sarah,

      I think you can handle it in this way:

      - Select the entire table without column headers and create a rule with either formula:
      =A$3=TODAY() or =A$3=$A$1

      Where A is the first (left-most) column of the table and 3 is the row with dates (table headers).

      Depending on what you are trying to achieve, this rule should be either the 1st or the last in the list of conditional formatting rules.

      If it is the 1st, the column will change the color but individual cells might get colored in different ways based on your other rules. If it is the last, the entire column will change the color overriding all other rules.

      1. OH THANK YOU Soooo much! First formula worked a treat.

  43. Afternoon

    I am trying to get a cell A2 to fill green if cell B2 says Approved or fill amber if cell B2 says Pending. Cell B2 will always start at Pending and then will be overtyped with Approved as and when, and would like cell A2 to update itself based on this change. I have tried a number of ways, but can only seem to get the formatting to change for one or the other not both. I'm sure I have used conditional formatting for something like this before. Is there anything you can suggest?

    Thanks :-)

    1. Hi Alison,

      You simply have to create 2 rules with different colors for column A:
      Green: =$B2=”Approved”
      Amber: =$B2=”Pending”

      Did it work?

  44. DEAR SIR/MEM

    WHEN I SELECT ROW AND COLUMN ITS NOW SHOWING IN NORMAL BLUE COLOR

    ..I WANT TOSAY THAT WHEN I DRAG A CELL ITS NOW SHOWING THAT I M SELECTING

    HOW CAN I SOLVE IT PLZ REPLAY WITH ANS..

    UR FAITH FULLY USER
    CHANDRESH VAVADIYA

    1. Hello CHANDRESH,

      I am very sorry, but I do not understand your question. Anyway, I believe the issue does not relate to Excel conditional formatting.

  45. I have a problem in excel format date is in one sheet and my condition
    =if(mid(sheet!y6,11,5)='F316L','XXXXXXXX',YYYYYYY)
    THIS IS WORKING OK WHEN THE DATA IS F316L BUT WHEN DATA IS ' 12 '
    VSD

    Reply

    1. Hi SHARADA,

      Sorry, I am not sure I understand your formula. Why are 'XXXXXXXX' encapsulated in apostrophes while YYYYYYY aren't? And what is '12' VSD? I think it will be easier for me to understand if you can provide a sample of your data.

  46. Hello,

    I tried to send my sample workbook but I keep getting an error!

    It says: "The error that the other server returned was:
    550 5.1.1 : Recipient address rejected: User unknown in virtual alias table"

    Please help!

    Thanks!

    1. Sorry, Carl, this is my fault - there was a misprint in the address. Don't know how that could happen, I typed it hundreds of times... Here is the correct one (double checked : ) - support@ablebits.com

  47. Hi, first thanks for your great blog!
    I am trying to get the cells on column A to change to green when F, G and H contains "Done" or "N/A". I has tried a couple of different formulas but no luck.
    It should be something like:
    =AND((OR($F$3="Done");($F$3="N/A"));(OR($G$3="Done");($G$3="N/A"));(OR($H$3="Done");($H$3="N/A")))
    If you find some time, can you guide me to the right solution please?

    1. I found a working solution :)

      =AND(OR($F3="Done";$F3="N/A");OR($G3="Done";$G3="N/A");OR($H3="Done";$H3="N/A"))

      1. Excellent! Sorry for not being able to respond earlier, this is because we do not monitor comments on weekends :)

  48. Hello,

    I have conditional formatting on my dates and they turn color based on 30, 60 90 days past due date. What i need next is to change my status column to match the date colors. I have status' of Open and Closed. If they are open they should match the color of the date, red, orange or green if over certain days, if it is closed it can remain black. Any help is appreciated.

    1. I forgot to mention I was using this formula with no luck - just turns everything red for open =IF($K2>30,$C2="open","")

      1. Hi Michelle,

        I'm not sure I completely understand the task, so let me check. You have a status column C that contains words "Open" or "Closed", this is absolutely clear. You have another column K with what kind of entries - numbers or dates?

        If numbers, you can change the color of your Status column by creating 3 conditional formatting rules with a simple formula like this:
        =AND(C2="open",K2>30)

        If dates, then please provide more details on how you determine the past due date. If you can send me your sample workbook at support@ablebits.com, this will be a faster way : )

        1. Hello,

          they are dates. They turn color based on 30, 60 and 90 days past the due date. I need the status column to do the same if they are Open and Closed so that we can monitor what is not done on time. Maybe there is another way?

  49. Hello,

    If I have a set of numbers is there a way I can use conditional formatting to highlight the number in that set that is closest to zero?

    1. Hello Jessica,

      Thank you for your interesting question!

      If your data set consists of positive numbers only, you can use this simple way:
      - Select your data set.
      - Click Conditional formatting > New Rule... > Format only top or bottom ranked values.
      - Under "Format values that rank" section, select "Bottom" from the drop-down list and put 1 in the box next to it.

      If your data consists of both positive and negative values, then a solution is a bit more complex. I've added a couple of examples to the post because this is really a very interesting question and other users may find the examples helpful. Please see How to highlight the nearest value in a data set for full details.

  50. Hi,

    I have conditional formatting set so that the fill turns green if it equals a certain number. There are 5 numbers that meet that criteria in a row, 4 of them turn green and the 5th one does not. They all have the same formats and formulas. Do you know why it is leaving out that one number?

    Thanks!

    1. Hi Mike,

      The most obvious reason that comes to mind is that the format of the problematic number is different from all others. You can try to copy the format from some other cell where the rule works well to that problematic cell using Excel's Format Painter. Also, make sure your formatting rule applies to the entire rows. If neither is the case, you can send us your workbook at support@ablebits.com and we'll try to figure it out.

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