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

  1. Hello,
    I inherited a spreadsheet worth of 10+ years of data, but someone got into it and messed with it, so now the condition not working properly any more. I'm a newbie to conditional formatting, I need help to fix it, please!
    It's a big file, contains thousands of row and dozens of column. And here is what I need:

    if any cell in column K contain a specific text "WAT", then in that same row, cell B, C, G, and K will be fill with color. How do I format this? thank you in advance!!

  2. Hi ,

    Is there any formula for this question below :

    cell 1 will have month of feb 2016 entered

    cell 2 will have month march 2016 entered

    cell 3 will have month dec 2015 entered

    is it able to cross check within 3 cells whether the date in each cells is consecutively 3 months based on the dates if not need to appear the cells in red colour .

  3. Need to cover a row with hash marks to blank it out when wrong part number is listed. Problem is the following formula works when X is added in one cell but not the other.
    Row A37:F37 is covered by blue hashes if X is in A7 and C12 = TT60000678-
    Part number in C12 is entered by formula when X is put in A7
    To change part number in C12 requires an X in D22 or E22. Formula for this is in C12 .
    =IF(AND(OR(D22="X",E22="X"),A7="X"), "TT60003571-",IF(AND(A7="X",(E4=293,E4=701,E4=601,E4=731),"TT60002639-", ""))))))

    Conditional Formatting Formula for adding blue hash marks in A37:F37 works fine when X is put in E22.
    It does not work when X is put in D22

    I am using excel 2010. Have had this problem in the past with other formulas/configurations. W
    Have used similar formulas in earlier versions of Excel and did not have this problem.

  4. Hi, Can you help me with this?

    I am preparing a system so staff members can build part numbers based on certain questions which I have embedded into "drop down lists".

    My issue is that I have two questions which require a different drop down list to appear based on the answer of the previous question.

    Example question 1, please chose C or SS.

    Question 2
    Please choose size.

    If they chose "SS" on question 1, I want to offer a drop down list with values from 2-10 on question 2
    If they chose "C" on question 1, I want to offer a different drop down list offering values 11-20

    So if Cell C5 = C I want drop down list A
    If cell C5 = SS I want drop down list B

    Is this possible?

    Many thanks,

    Kyle

  5. Hello Svetlana, I have a worksheet there are many columns like column A, B,C,D etc. Column A have Product ID, Column B have Product Description C got 1 date of month D got 2 date of month as on and last column got closing stock. i got values from some columns in this worksheet from another worksheet using formula. but the problem is that on a specific date it got values for that dates columns and rest all columns got 0 value. I want when a column got values from formula is got paste special at a specific time (11 am) automatically, so that on next day when the current day's value updated on respective column last days value did not change.

    could you help me on this.

    Thanks

  6. I am trying to apply conditional formatting based on the value in other cell. Condition is if column J has specific text (from the list) row to be highlighted yellow. If columns K, L, M, N have any text, then row should have not color. I am able to format this based on the numbers in columns K, L, M, N not the text. Please help.

  7. I have two columns, F and H. I put a 1 in F if the application is approved and the H column equals the number of times an application has been submitted by someone. in column H, i want the cell to highlight green when the application is approved on the first attempt (f=1 and h=1). When applying the conditional formatting, I can get it to work if I set it up for a single cell ie =and(h5=1, f5=1) and applies to $h$5 but I want to apply this formatting to the entire H Column. If I change the formulat to =and(h:h=1, F;F=1) and apply it to =$h$h, no cells are highlighted. Can you help me tweak my formula to do this?

  8. Hi i want to know when i want a cell to be yellow when another cell has no data but then if i add data to that cell then the yellow should then go back to no fill.

    How do i do that

  9. How to highlight calendar cells

    based on start,estimated & actual date in excel

    I tried using the below formula but it doesnt work

    If =(F$4<$B5), no format (or white fill), Stop If True
    If =AND(F$4<=$C5, F$4<=$D5), fill blue
    If =AND(F$4$D5), fill green
    If =AND(F$4>$C5, F$4<=$D5), fill red

  10. Hi, any help is greatly appreciated:

    I am trying to use conditional formatting to apply to individual cells across a row based on each of their values, relative to one value in another (Absolute) cell. Data is corresponding in 2-row sets...

    Specific example:
    A1=10
    B2=12, C2=11, D2=9
    A3= 20
    B4=21, C4=20, D4=19

    I want to create a conditional formatting formula that is something like this:
    Format IF: =$A1>B$2.
    I want B2, C2, D2, etc. to be evaluated compared to $A$1, and be highlighted individually (not row 2, just the individual cell), and ONLY if A1 is greater than the value in the cell. I want B4,c4,d4... to ref $A3, and so on down the sheet. (Note: it's ok if b3 references a2 in between, because all Even numbered cells in column A = 0; a2=0,a4=0, etc, therefore b3,c3,d3...which are all positive, would not get formatted, which is good.)

    In the above example, I would want this result:
    D2 and D4 are highlighted/formatted (because they are less than A1 and A3 respectively), and nothing else is formatted.

    I am having trouble figuring out the absolute reference. I also don't want to have to apply it individually to each row - maybe I need to create the formula once and drag it down? (Copy conditional formatting?) because I have hundreds of rows similar to what is shown above.

    (I'm more familiar with google sheets, and this seems much easier to accomplish in gsheets...)

    Thanks again for any help!

  11. Hi there I am trying to use conditional formatting where I want the cell to appear yellow based on a true result. If user selects "Y" from the drop down list in cell A1; B1 is prompted the user to enter name of authority; C1 cell should go yellow to indicate this needs filling. Is C1 that I want to be formatting based on on the result of B1 being true. Can you advise?

    Regards

    Abs

  12. hi

    I have some values in b5:b14 currency format, the same way C5:c14 date format. I need recently increased amount, which is increased and which date.
    so please suggest which formula I can use for the scenarios.
    Example 1 :
    amount date
    100 01/01/16
    50 02/02/16
    100 03/02/16
    100 04/01/16

    here increased value is 100 with date 03/02/16, this values I need in C4 and c5.

    amount date
    100 01/01/16
    100 02/02/16
    100 03/02/16
    100 04/01/16

    here there is no any changes in amount so it should be 100 with 01/01/16 in C4 and c5.

  13. Hi friends,
    Myself Mahesh, currently I am working as a hr. Can anybody tell me the usage of "format cells that rank in the top" and "format cells that rank in the bottom" in conditional formatting in excel 2010.

    Regards
    Mahesh

  14. I'm working on a spreadsheet for forecasting staffing. There is an "open headcount" row in several portions of the spreadsheet, and I want to create a formula that will highlight only the cells in the "open headcount" rows where a number > zero has been entered. I know I could manually apply that condition to each one of those rows, but I want to be able to apply to the entire spreadsheet at once.

    Appreciate any help!

  15. You have already assisted someone with this question, but I'm unable to get the formula offered to work.

    Example: When I type "At Home" into cell B4, I need I4 to show "Adnan".
    Formula used: AND=($B4="At Home", $I4="Adnan")

    Can you help?

  16. I'm attempting to color cells that are dates only. if an alpha based word or statement appears I want it to ignore those. Is there a way to have it look for numbers only? i.e-. 07/12/2016 (shaded), Tom (Not shaded).

    But without creating a rule for EVERY word I want excluded from the shading rule?

    I guess what I'm looking for is a symbol or code phrase that tells it to look for "all text" or "all number".

  17. i wish to format a row based on the condition that the cell in the row on total probability is less than 20 and the total consequences is less than 23

  18. Hi there.

    I have a probably not too tricky question, but I am not so familiar with conditional formatting.
    I want to format my dataset (22x12 values) with the 3 color rule, but based on the values of another dataset. So that the color can be used as additional information. Can you help me with that?

    Thanks a lot for your help!

  19. I have 5 week calendars and the first week show the previous month dates and the first line have merge 5 cell when I have the days for 7 days start Sunday and the second line I have 10 cell/box where i have different information. I need to do a month calendar and transfer all the week information star the the first on the month.

    Do you know How I can automatic transfer the information? (Formula)

  20. Hi,
    I have a tab with hundreds of rows, and there is a column with job title and the next column is a salary (tab 1). Those jobs are linked from another tab with salary (tab 2) this is my source tab. I would like that when I change the job title on tab 1, that the salary (next column) also changes (it would get its data from tab 2). Tab 2 is static, but tab 1 is dynamic. Not certain how to write a formula or would I need something else, a macro ? Thanks

  21. Hi ,

    Can you help me know how to highlight particular cell using conditional formating or any other method for functions
    I just want to highlight particular column cell with reference to previous column cell.

    for eg :
    A B C
    1 3,000 3,500 3,200
    2 3,200 3,300 3,400
    So here B1>A1.so B1.i.e 3500 should be highlighted.
    similarly B2>A1, so B2 should be highlighted.
    Similarly C2.
    So the formula should be applied to entire sheet

  22. Dear sir,

    I list down a simplified data table for reference for my question as follow:

    A B C D E
    S.no Name Profession Groupings Days of report
    1 AAA Specialist 5

    I want to highlight Name cell(AAA) by conditional formatting if Profession =Specialist, Day of report >=5.

    However, it does not work. May I know what is the problem. Your advice please.

    Regards.
    Michael

    The formula I use: AND($B2="Specialist;$E2>=5)

  23. Hi,

    I'm trying to set up conditional formatting that will put a number in a different cell depending on the colour (contents of another cell).

    For instance, if % are below 33% then the cell goes red, between 33% and 66% it goes orange, and above 66% it goes green. What I want from this is that it will fill in the next cell with a letter based upon those percentages. Is that possible?

    Thanks in advance.

  24. I am trying to format dispatch time against actual time. example: Column $AD$6 has Target Dispatch time of 15:45, column $AE$6 will have actual dispatch time of 22:08. If actual dispatch time is greater than Target Dispatch time, I would like to fill with red.

  25. Hello,

    I am sorry if this has been asked earlier, but i could not find it, neither here nor on google. is there a way to compare cells in column A to their respective cells in column B, and color the cell green if the numbers are the same, and red of they are not? SO, if A1 reads 3, and B1 reads 3, i want B1 to color green. and the same for A2 and B2, A3 and B3, and so on. i could just do it cell by cell, but that would take days, and i cannot find a quicker way to do it. even with a macro, doing it cell by cell would take ages i think.... I am using Excel 2013.

    Thanks a lot in advance!

    1. Hi RengerD,

      Please try to do the following:

      1. Select a range in column B. For example B1:B4.
      2. Click Conditional Formatting -> New Rule.
      3. Select the "Use a formula to determine which cells to format".
      4. In the Formula field type "B1=A1".
      5. Click the Format button to set the format you need.
      6. Click OK.

  26. Excel 2010 conditional formatting.

    I cannot copy my conditional formatting down the rows, I need my row reference to change i.e. A1 to A2, A3 etc. but it retains at absolute reference A1 when I copy it down the rows. When I try to remove the dollar sign in edit rule, it automatically adds the dollar sign back. The rule I am using is:
    Format only cells that contain.
    Cell value not between:
    =$A$1 and =$A$2, (Have test reference number here)
    When I copy this down, the rows $A$1 and $A$2 remain absolute where I need them to change to reflect the row numbers I have copied to, removing the dollar sign has no effect as it just defaults back to dollar within the rule.

    Thanks in anticipation.

    1. Hi Dave F,

      I've tried on my Virtual PC with Excel 2010 and everything works as expected.
      To be able to assist you better please describe your task in more detail.

  27. Good Afternoon,

    Would you be able to assist with this situation ?

    I have two columns..

    The first column has bill id. The second has line id.

    What I need to do is find replicating or non consecutive line id only if the bill id is the same.

    For example IF THE left column has the same value, it should start at one and end at the last same number. 5555 should be 1 2 3 and it should start over at 5556 at 1, 2, 3…..

    5555 1 TRUE
    5555 2 TRUE
    5555 2 FALSE
    5556 1 TRUE
    5556 2 TRUE
    5556 3 TRUE
    55111 1 TRUE
    55111 1 FALSE
    55222 2 FALSE
    55333 1 TRUE
    55333 5 FALSE

    THANK YOU FOR YOUR HELP

  28. Hi i am new to Excel sheets and having trouble in creating dependent dropdown list for columns

  29. Hi,
    I'm trying to use conditional formatting to format cells that go over 6 months and 12 months.
    All cells have different dates and it's not based on today's date. It's based on a meeting date?

    1. Hi Catherine,

      Please try to do the following:

      1. Select a range in column A. For example A1:A10.
      2. Click Conditional Formatting -> New Rule.
      3. Select the "Use a formula to determine which cells to format".
      4. In the Formula field type the following formula:
      =OR($A1 > DATE(YEAR($B$1), MONTH($B$1)+6, DAY($B$1+$A$1)), $A1 < DATE(YEAR($B$1), MONTH($B$1)-6, DAY($B$1)))
      5. Click the Format button to set the format you need.
      6. Click OK.

      The date values in A1:A10. The meeting date is in B1.

  30. I want my D column to highlight red under conditional formatting if it is more than 14 days after/later than column c.

    Can this be done on conditional formatting? and if so what would the answer be?

    Thank you.

    1. Hi Lauren Dicker,

      Please try to do the following:

      1. Select a range in column D. For example D1:D10.
      2. Click Conditional Formatting -> New Rule.
      3. Select the "Use a formula to determine which cells to format".
      4. In the Formula field type the following formula:
      =ABS(DAYS(D1,C1))>14
      5. Click the Format button to set the format you need.
      6. Click OK.

  31. Is it possible to change a cell to 0 (with a strikethrough) if a cell is less than or equal to 0 using conditional formatting? Thanks in advance for any help!

    1. Hi Brad,

      Please try to do the following:

      1. Select a range with your data.
      2. Click Conditional Formatting -> New Rule.
      3. Select the "Format only cells that contain".
      4. Select the "less than or equal to" option = 0.
      5. Click the Format button.
      6. Select the Number tab and Custom format.
      7. Fill "-;-" value in the Type field.
      8. Click OK. Click OK.

  32. sorry if this has been listed but I cannot find it.
    I need to fill a cell with RED and Bold Black text stating "PLEASE SPECIFY DETAILS".

    But only if another cell has a particular selection made from a validation list.

    So B40 is blank. if B38 = "Other (specify)" (seleceted from a validation drop down list) then B40 turns red with black bold text stating "PLEASE SPECIFY DETAILS".

    I really would appreciate any help with this. Conditional formatting is not one of my best areas of knowledge

    Thank You

    1. Hi Ben,
      Please try to do the following:

      1. Enter the following formula for cell B40:
      = IF($B$38="Other (specify)", "PLEASE SPECIFY DETAILS", "")
      2. Select cell B40.
      3. Click Conditional Formatting -> New Rule.
      4. Select the "Use a formula to determine which cells to format".
      5. In the Formula field type the following formula:
      =$B$38="Other (specify)"
      6. Click the Format button to set the format you need.
      7. Click OK.

  33. I need to figure out a way to say "In the case of 1, use vlookup for Chart A. In the case of 2, use vlookup for Chart B...etc" through at least 4 (and maybe more with different files), all without using the IF function.
    This is because the model number affects the code that is used to define the material. So Model 1 may use "15" for "concrete block," but Model 2 may use "15" for "metal," etc.
    Thank you!

  34. I would like to format one cell (fill yellow) if another cell contains one of roughly 80 different text values. I've tried formatting cell C2 with =OR($W$2=“I63.00”, $W$2=“I63.011”, $W$2=“I63.012”, $W$2=“I63.01”, $W$2=“I63.02”, $W$2=“I63.031”, $W$2=“I63.032”, $W$2=“I63.039”, $W$2=“I63.09”, $W$2=“I63.10”, $W$2=“I63.111) for example, but it doesn't seem to work. Suggestions?

    Thanks!

    1. Hi Damon,

      Please check the format for cell $W$2. It should be "Text" if you compare the text values, not "General".

  35. Hi, I have a list of all colleagues in our coy, some have left already, so for those I enter the exit date.
    Now what I want is to highlight not only the cell which contains a date value but "the whole row" based on the exit date column.
    Could I get some advice please.
    Many Thanks

    1. Hi Nel,

      To highlight the whole row please add the absolute reference symbol "$" before the cell reference. For example, if you have the dates in column B:
      =$B1=DATE(2016,1,1)

  36. Hi, I'm looking to make a formula that highlights the days Friday-Sunday but I'm hitting an issue with my cells. The cells that I want highlighted have a formula in them that takes the date from say C2 and adds 14 days to get the date I need. I'm assuming that's why the weekday formula isn't working for me because there's a formula in the cell and not a date. Any suggestions?

  37. Hi

    I have been trying to do a sum but I am not sure how

    I have a 2 rows of numbers

    Cell A Cell B Cell C
    58.50 56.33€ in cell c What I would like to do is something like this =if cell B is > than Cell A minus Value e.g 0.50
    58.50 51.90€
    59.70 56.92€
    60.30 57.32€
    69.00 68.90€

    I hope this makes sence

  38. I have a training matrix that has the date of when the subject or test was last taken. Each year is a new refresher

    I want those dates to turn green 45 days before the next year, Yellow for 30 days before, and Red for 15 days before and over.

    How would I set up the formatting for this. I have been through so many different ways to do the conditional formatting and it just won't work for me.

    1. Hi Heather,

      You need to add 3 separate rules using the "Use a formula to determine which cells to format" option with the following formulas:

      1. For the red color:
      =DAYS(DATE(YEAR(A1), 12, 31),A1) <= 15

      2. For the yellow color:
      =DAYS(DATE(YEAR(A1), 12, 31),A1) <= 30

      3. For the red color:
      =DAYS(DATE(YEAR(A1), 12, 31),A1) <= 45

      Please add the rules in same order.

  39. Hello,

    I have a issue in excel conditional format sheet that

    I have 6 cell is for formatting .

    I want if continuously cell value is 0 and then last cell value is 1 then cell value should 60
    if 5th cell value is 1 then cell value should 50
    if 4th cell value is 1 then cell value should 40
    if 3rd cell value is 1 then cell value should 30
    if 2nd cell value is 1 then cell value should 20
    if 1st cell value is 1 then cell value should 10

    &
    same in 2 new cell but 1 cell value is 10,20,30,40,50 then should only next not previous cell value again in next cell

    Thank You in advance.

  40. Hi,
    I have a sheet with several conditional formatting in place. For some reason, the conditional formatting stop functioning (not displaying it anymore) while adding some new conditions on some fresh cells. I am quite sure the formulas are correct (as in used in the sheet and displaying correctly). My sheet is quite long (conditional formatting not functioning applied on column CH), so was wondering if there is any limit on number of conditional formatting that you can have in a sheet. I am a bit lost. I am working with excel 2007 for mac.

  41. Hello Svelana,
    I have a simple issue where I need the color of the values in a cell to change based on the text in another cell. So for instance if cell B2 = "TED" then the value in cell A1 should have a font of say red. I have list of 10 names I would like it to go through and each name should have different font color. So "Jane" would be blue :Chris" yellow etc.
    Can I create a formula that could have all possible 10 names and font colors.
    Thanks,
    Eke

    Thanks,
    Eke

    1. Hi Eke,

      You can create 10 separate rules using the "Use a formula to determine which cells to format" option.
      For example, the formula for the red color will look like the following:
      =B2="TED"

  42. Hi dear
    Can I highlight a whole record means specific row upto a specified number of columns.
    Scenario:
    If the student successfully completes his course then I want his entire record(row) to be highlighted as green when the end date column equals to today.
    Thanks in advance

  43. Macro to auto save final value with date..

    Ex: 3/3/2016-20,000
    4/3/2016-30000
    Like that daily values save in one excel sheet.

    The above amount is daily collection denomination...i want details of daily collection details after one month

  44. Is this site is still working?

  45. I have an interesting one. I have a ss with 40,000+ rows. I want to do the following. If something is highlighted with a value example abc123, I want to highlight all of the other cells that have abc123.

  46. Hello,

    The sheet I am working on has an array of test results based on an alpha numeric recipe code. I have specific results that need to be formatted for quick reference based on ranges that depend on data from other cells. All the conditional formatting works except the last parameter I am stuck on. Based on the Codes in Column A, if 30C20IW or 30D10DW appear; then the cell in Column P needs to be formatted Red based on the number entered and it being < the target in Column N. There are existing CFs in Column P for numbers above/below ranges based on Column N that work fine. What is the formula to combine the different conditions; so that new format based on a different parameter is applied only when the two specific recipe codes appear?

  47. Hello,

    Is it possible to use IF OR and Other conditions in Pivot Calculation field?
    Example: i have pivot with country[ US, UK, China, India, Kenya] in column 'B' and Transactions in column 'C', Sales in Column 'd'. Now my question - if the column value is US i want to have the Transaction value in column 'E', if its UK, then i need Sales value in same column 'e', if Kenya, then i need Transaction Value.

    kindly suggest.

  48. Hi dear,
    I want col H to be red fill as well as showing the text Defaulter
    1)if col E(completion date of course) is passed and the col F (remaining fee) is still to be paid i.e >0
    2) if col E(completion date) is passed and the col F=0 then I want green fill and showing text Clear
    3) if Cole E(completion date) is not over which means the course still is in progress and col F>0 then I want orange file showing text "Ask for the Fee".
    Any help will be highly appreciated
    Thanks in advance

    1. Can any1 like to add?

      1. I finally got my answer by reading your if & and/or topic and now want little bit more complexity in it.

        =IF(AND(E70),"Defaulter",IF(AND(E7TODAY(),Q7>0),"Ask for fee","")))

        Thanks

  49. i want to get the highlighted cells(which were highlighed by conditional formating)to a seperate column using a formular.not using filtering option

    Thanks

  50. I need to highlight the similar text in different collumn.Please give me a commands.
    For example
    A-column B-column
    TXP 1_TXP
    1_TXP-1
    1_TXP-2
    1_TXP_TCH
    Then i need highlight b collumn all text

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