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
by Svetlana Cheusheva, updated on
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 28. Total comments: 1726
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
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)
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.
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.
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!
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.
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.
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.
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
Hi i am new to Excel sheets and having trouble in creating dependent dropdown list for columns
Hi Neeraj,
Please look at the following article, it should help:
https://www.ablebits.com/office-addins-blog/dependent-cascading-dropdown-lists-excel/
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?
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.
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.
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.
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!
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.
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
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.
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!
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!
Hi Damon,
Please check the format for cell $W$2. It should be "Text" if you compare the text values, not "General".
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
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)
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?
Hi Cynthia,
Do you use the following formula?
=OR(WEEKDAY(A1) = 6, WEEKDAY(A1) = 7)
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
Hi George,
You need a formula like the following:
=IF(B1>A1, value-if-true, value-if-false)
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.
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.
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.
Hi krishna,
Please show us how your data looks like.
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.
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
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"
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
Hi Aamir,
Sure, you can do it. Just select all the columns you want to highlight so that the rule will apply to the entire table, and then write a formula for the top cell. You can find more details and a few examples in this tutorial:
How to change the row color based on a cell's value
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
Is this site is still working?
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.
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?
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.
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
Can any1 like to add?
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
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
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
Hi,
I want to highlight a cell containing a alphanumeric based on multiple references
Ex:If any cell contains BMR01 or BMR02 and goes on it has to get highlighted.
Tnks in advance
tell me how to take multiple references
Hello Rajesh!
It depends on what rules are used to create an alpha numeric code.
For example, you can fulfill your task using the following formula in a conditional formatting rule:
=AND(LEFT(A1,4)="BMR0",IFERROR(VALUE(MID(A1,5,1)) < 3,FALSE))
Hi,
I would like to implement conditional formatting based on the items chosen from a drop down list. So if items "A" or "B" or "C" of the list are selected the color of the cell change, if items "D" or "E" or "F" of the list are selected the color remains the same.
I am using excel 2007 for Mac so no VBA option. thanks for your help
Dear All,
if there a 2 pages first 1 page contain all the details of the employees salary as per field. At the same time in 2 page fimo recovery was tallied at the one branch if it is tallied all the related column should be colored in 1st & 2 page
please suggest thanking you
Hello, i would like to change the colour of a number of cells in a row if column P contains any text, however the colour it changes to depends on the text in column D would you please be able to help
many thanks.
Hello Charlotte!
You need to create different rules: one for each colour and text condition. For example:
yellow color - =AND(NOT(ISBLANK(P1)),D1="text1");
orange color - =AND(NOT(ISBLANK(P1)),D1="text2") etc.
Hi Svetlana,
I'm working in an Excel file where alphabetical values (student grades) are recorded on Sheet 1 and these grades are stored as numerical values on Sheet 2 (using VLookup). I'm wanting to conditionally format the grades on Sheet 1 based on their numerical value on Sheet 2 (if the grade in one exam is higher than their predicted grade, colour it green, for example). This is working fine for the first column. I'm using absolute column and relative row references and this works for the first column ((='Sheet2'!$F6>='Sheet2'!$D6) applied to =$F$6:$F$47 on Sheet 1.)
As there are a lot of columns (none-consecutive, ie the grades are in columns F, H, J on Sheet 1 and their numerical values in F,H & J on Sheet 2) to add this formatting to, I've tried to apply it to the other columns on Sheet 1 using 'Applies to =$F$6:$F$47, $H$6:$H$47' etc. However, this doesn't work for the second column, and colours the cells seemingly at random.
Please can you tell me how I'd fix this?
Thank you ever so much.
How do you tell there was a First Expired First Out (FEFO) breach.
I have this very large data and am trying to determine if a product with a later (greater) BB date is posted before one with an earlier (less) BB date on excel. The BB dates are in a column while the posting date is in another column
I have been doing this manually and will like to have a formula that is faster.
I'll appreciate your assistance
Hi. My dates are customised as ddd dd mmm yy (so today is Tue 15 Mar 16). I can't get CF to turn today red using today(), even though Excel knows that the cell is actually 15/03/2016. Can I do this another way?
Hello SeeBee!
Please select the entire column (for example D) and create a conditional formatting rule using the following formula: =D1=TODAY()
How to format a range of cell bases on a list of values (range of values). Ex. I have a lis of available answers: A, B, C, D ..., Z. So, whenever a user writes an answer not part of the list, the cell is formatted into red color (for ex).
I tried to use the formula: =$C2AcceptedValues
where AcceptedValues is the range name of the accepted values. But for whatever reason it's not working. Any suggestions? What do I do wrong? Thanks.
=$C2AcceptedValues ($C2 not equal to AcceptedValues)
how to Rectify Circular reference error
Hello Muthu,
Please check out these tips to find and remove circular references in Excel.
i have a 2sheet in single file one of the name is daily and 2nd is weekly i want to highlight colour or sign row when 1sheet value is greater than 2sheet
I want to fill cells with a color if they contain an letter and number but the number isn't the same in every case. How do I set this rule?
hi I have found your tutorials brilliant, but as a newbe to excel ,please help with this one.
two lists each contain names ie joe blogs mary smith.
I want to search the first list for a name from the second list and if found I wish to change a number in another cell,and so on all the way through from the second list looking in the first.ive tried the if function but I don't know how to deal with text?
Hello,
I have another question regarding conditional formatting...
My scenario is:
In Column A, I have a numerical value entered (ex: 6.0625).
In Column B, I have another numerical value entered (ex: 8.60).
I need to format all the cells is Column A, if they do not have a value within a certain decimal point numerical range of the value in Column B.
For example, in cell A1, the value is 6.0625, and in cell B1, the value is 8.60. I would want the cell in A1 to highlight red because it does not fall within a +/- 0.25 range. What formula can I use to format all of Column A this way. Take into consideration that not all of the numerical values in Column B are the same. So the comparison will need to be for each row between those two columns.
Thanks in advance!
Hi,
I am trying to figure out how to edit a drop down menu for a spread sheet at work. I am trying to edit "Contact Names of sales reps" to include both their personal e-mail and phone number like the other original ones were formatted to do; So that when you click on their name in the drop down menu, it includes their contact info from the 2 other columns to the right of each sales rep. How do I enable that or edit to create that?~
I have a spreadsheet consisting of 8 columns and 8 rows. The first column and row is B10. B10 thru B17 has a drop down list in each row which is the same list. The list consists of a series of 3 number a space and 3 more numbers. I have a conditional format in C10-I10 and the other columns and rows follow suit. The formula is =AND(123456=$B$10)=TRUE then change the font to RED with Parenthesis. The formula works in B10 if I type in 123456 but will not work if I have the drop down list and chose 123456 from the list. Any help would be appreciated.
Hi...
I was wondering if I enter a text in a row then that text should determine the value in anorher row automatically. Is there any formula regarding this.
Eg...
If I enter abc text in row C4 then row D4 value should 10 automatically.
Waiting for help...
Is there a way to highlight a cell on a sheet if the number in it is also in a list on another sheet?
I have a list of numbers on sheet 1 starting at B2 working down the column (B2,B3,B4,....) then on sheet 2 I would be inputting numbers and would like the cell to change color if the number entered matches any of the numbers in the list from sheet 1.
I use conditional formatting to change the color of the cell from green for good to red for bad, works good. My boss just asked me to modify this to put the conditional formatted color into another cell. So what he wants will look like this, cell A5 has conditional formatting that will turn green or red depending on the text value and on the same page cell AW83 will turn the same color as cell A5. I need help with the last part cell AW83 working
forgot to mention cell AW83 has a numeric value that needs to remain after the cell changes color thanks
Hello Mike,
The easiest way to go would be creating the same rules for AW83 that you have for cell A5.
Otherwise you will need to add a user-defined function to your file as there is no function in Excel that checks colors. The following blog post describes the steps to get our GetCellColor function:
https://www.ablebits.com/office-addins-blog/count-sum-by-color-excel/#count-cells-color
You need to copy just the first function from the code in the post.
Then you can use this function to get the color code from A5 in another cell, e.g. enter =GetCellColor(A5). Finally, you'll need to create a conditional formatting rule for AW83 and use the following type of formula in it:
=GetCellColor($A$5)=5287936
5287936 is the color code you need to replace with the code of green or red color you may have in A5.
Hello,
If the cells in the column have negative and positive value (ex. A1 = -1, A2 = 9), how can I create a formula to fill cell with red color if negative value and green if positive value?
Thanks,
Hello Tim,
You need to create two conditional formatting rules: one for each color.
You can use this simple formula for positive numbers to fill with green color:
=$A1>=0
Here is a formula for negative numbers with red fill format:
=$A1<0
Hi Sako,
How exactly is the date range defined in sheet2? Is it 2 cells with the start date and end date?