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 23. Total comments: 1726
Hi! I am trying to create a spreadsheet to keep track of when physical cards would expire. I want the spreadsheet to auto fill yellow when the physical will expire in 30 days and auto fill red when it will expire in 7 days. I have done this in the past but it has been a while and I can't seem to remember the formula.
Thanks!
Conditional formatting: How can we apply conditional formatting in a column based on data from another column.
Eg: I need to format rows in Column A based on data in the same row from Column B
If the row in column B has text "I win", Column A should be highlighted green. In the same way I should e able to apply for the whole column A
Thanks in advance
HI! I'M TRYING TO FORMAT A WORK SHEET WHERE EVERY VALUE ENTERED IN COLUMN SAY L, SHOULD PRECEDED BY THE 'TRUE' TEXT IN COLUMN M.
SO IF I ENTER ANY PERCENTAGE VALUE IN COLUMN L, I SHOULD GET THE VALUE TRUE IN THE CORRESPODING CELL IN COLUMN M. i tried data validation and conditional formatting,they both seem not to work
PLEASE HELP,IT'S an urgent request.
Thanks!
Hi Kamo,
You can use the IF function in column M that will check if the cell in column L is blank, e.g.:
=IF($L1<>"","TRUE","")
I hope this helps
I want to write an equation for a column in which each value depends on the value before it. EX: if my equation is y=X+1 and the first number in my column is 1 then the next number should be 2 and then the one after should be 3 and so on
Hello!
I have a question and i would really appreciate an answer on this one.
I have a cell (E7) which drops down and gives us 4 options. Next to that cell, i have a 52x18 table (F10:W61). The cells in this table show a particular value for each of the 4 options mentioned above. For instance:
If i select "Availability" in the first cell, the F10 shows me 90%, G15 shows me 60% and so on.
My objective is to set color ranges. I can achieve this for 1 set of values, by selecting "format only cells that contain", and inputing the range. The problem is, if i change the text value in E7, the rules stay the same, and i need the following rules.
If i select first option of E7:
from 0-75% -> Red
from 75-90% -> orange
from 90-100% -> Green
If i select second option of E7:
from 0-80% -> Red
from 80-95% -> Orange
from 95-100% -> green
and so on. The rest i can do by myself. Thank you so much!!
I'm not sure if you have answered something like this before but here goes... I have a cell that I want to highlight if the value on the next cell is not blank.
for example:
N2 has 3 but O2 is empty the conditional format will not do anything but if N2 has 3 and O2 is not blank the conditional format will highlight the whole row.
This is the current formula: =IF($N2=3,1,0). this highlights all rows if N2=3 regardless if O2 is empty.
hi
i want to do conditional formatting to avoid duplication of entries or highlight entries which are duplicate using multiple columns criteria.
e.g. i want to highlight column D with values in column A, B, C & D are repeated at the same time in the sheet somewhere else? Is it possible
17-Feb-15 20 1 5
17-Feb-15 16 2 4
17-Feb-15 20 2 3
17-Feb-15 20 1 5
Now row 1 and row 4 all the entries are same. How can i highlight with the same set of entries are getting repeated in the sheet?
If I want to change the colour of Column D based on the columns A/B/C having text of Y or N what is the best method. ie. YYY = Red NNN = Green, any other combination has amber?
Thanks in advance
Hi,
i want to know when i am writing a column name (problem details) and another column name(result) so need when i put result onle(pass)thst's time problem details column is atowmatic highlighted in green such as
Complaint Details Result
Hard Disk Damage Solved
Hard Disk Damage
before putting solved complaint details column is red color.
when i put solved in result column then complaint details column is turn into green color.
please need your immediate response.
I currently have a Conditional Formatting set up to color code the cell Green if DBSK is entered for the first time within a row. Although, if a second entry of DBSK is entered within the same row, I need that cell to turn Yellow and then if the same DBSK entry is made a 3rd time within the row, I need that cell to then turn red. What is the best way to go about coding this or conditional formatting it?
High im new to excel and i was wondering if it would be possible to get column k to be highlighted when a row has data but nothing is entered in the k column. then when an entry is made in column k the highlight would be removed.
for example lets say in row 5 i have in column A- NUMBER, column b- last name, column c- first name, column d- employee #,... and in column k is titled date approved.
so the premise would be that k would be blank until i entered a date and if that could be highlighted when blank so that it can stand out and the highlight removed once a date has been entered. if you can help that would be great
Hi, I am hoping that someone could help!
I am trying to colour format rows depending of the information of two columns.
Column E is limited to YES or NO
Column F are years
I want to add conditional formatting so:
= YES and under or equal 30 go green
= YES and over 30 go yellow
= NO and under or equal 30 to blue
I would appreciate any assistance you could offer.
Thanks so much!
Nuria
Hi Nuria,
You need to create a conditional formatting rule for each color using the AND function:
1) =AND($E2="YES",$F2<=30) for green cells
2) =AND($E2="YES",$F2>30) for yellow cells
3) =AND($E2="NO",$F2<=30) for blue cells
Hi Irina,
Is that possible to paste that resulted cell to another excel without any condition in new excel.
For Ex: Pasting the values to another excel.
Hi, I have dataset,as below, how can I write formulae which will output a Y into column B if there is a "Y" present in column A? Is it possible to extend this also for further similar conditions? Thanks
A B
1 XXZ1 N
2 XYX2 Y
3 ZSD3 N
Hi Aaron,
You can use the combination of ISNUMBER and SEARCH functions to look for specific text within your cells:
=IF(ISNUMBER(SEARCH("Y",$A1)),"Y","N")
Hi, I wanted to know if it was possible to highlight a number of cells based on the value to the left column. For example, I type in the value 1, and 1 cell to the right of that value is filled in green, I type in the value 7, and the next 7 cells to the right of that value are filled green. Is this possible?
I'm trying to do something that should be fairly easy, but I'm having trouble making it happen.
Simplified: I have dropdown lists in C3 (Where did we go?). And the distance from home to the place gone in E3. The options for the dropdown list are stored in I3-I33 (Names of locations) with an associated value in J3-J33 (Distance traveled).
What I would like is for E3-E36 to return the values in J3-J33 if the C3-C36 dropdown option is entered.
C3-C36= Dropdown List
E3-E36= Result from J3-J33
I3-I33= Dropdown List options
J3-J33= Distances for each option chosen
So, if I choose "Grand Canyon" from C3s drop down, and it is located in I8, the distance of 2000 miles is listed in J8. I would like that value to show up in E3.
I can make it work for one specific number but not for the entire list.
"=IF(C4=I3:I33,J3:J33)" only returns the correct answer if C4=I4. I need it to return the value in the J3-33 cells.
Thanks for any help,
-Rob
Hi Rob,
The easiest way to go would be using the VLOOKUP function in column E:
=VLOOKUP(C3,I3:J33,2,FALSE)
If will match the value from C3 to a value in column I and return the corresponding record from column J. Please see this tutorial to learn more about VLOOKUP.
What an awesome blog! great stuff here!
I am trying to find a solution to a conditional formatting using a formula issue (I THINK!)...
Please see image at: to see what I am hopeful of achieving.
Thx!
well - I tried to post a url in that...
trying again here without the brackets
sbonham.com/ganba/GymSheetMockup.jpg
Thank you very much for your kind words, Steve, and thank you for the screenshot.
I'm sorry, but there is no easy way to check several words that are in cell B3. One possible solution would be taking the key words into separate cells, selecting the range with comments, and creating a Conditional Formatting rule for each key word with the following type of formula:
=SEARCH($B$3,E6)
Here $B$3 is the cell with the key word and E6 is the first cell of your range with comments.
Hi
I want to format a series of cells 2*4 (represents 1 day)to green if the combined value is 0/blank.
=SUM($B$6:$C$9)=0 goes for the same cells =$B$6:$C$9 so far no problem. But how do i autofill this formua over a sheet with hundreds of cells working 2*4.. Is it even possible or do i nedd macro?
Thanks.
/fred
Hi Fred,
Could you describe your data structure in more detail? Do you want to sum values in range B6:C9 and then B10:C13, or are 2*4 groups arranged in a different way?
Thats correct, downwards would be B10:C13 an to the right D6:E9 and so on.. And if the sum of these 8 combined cells are 0/blank i want them all (ex. B6:C9) to be green, if the value is something else they should become white. All 8 of them. The formula above does this, but it wont autofill over the sheet like i want..
Thank you for the details, Fred,
Please select all your data and use the following formula for the Conditional Formatting rule:
=SUM(INDIRECT( ADDRESS((INT((ROW()-2)/4)*4+2),(INT((COLUMN())/2)*2))&":"&ADDRESS((INT((ROW()-2)/4)*4+2+3),(INT((COLUMN())/2)*2+1)) ))=0
You can read about the INDIRECT function in this blog post.
Another way to go is use OFFSET function:
=sum(OFFSET(INDIRECT(ADDRESS((INT((ROW()-2)/4)*4+2),(INT((COLUMN())/2)*2))), , , 4, 2))=0
Sorry, i don´t get this.. Im about to give up on this.. Thanks anyway!
So I am having a particular issue that this seem to be the closet I am getting. I have a column I am trying to get to fill with x color based on the rest of the row. simple enough I have found ways to do that even here with the search function. however even using conditional formatting it doesn't seem to work if its scanning in-cell drop down.
so there is a header roll the I have names in the first column, second column for color indicator and then column 3:28 is for putting a checkmark or x. if the person knows that task listed at the columns header like forklift certified then john doe gets a ✓ and the status column with be green and a × would be red to indicate he is on restrictions and not perform one or all of his tasks.
any thought that allow for later addition of employees without having to modify the function parameters?
Hi Dear!
you are always there like a teacher for me to learn new formulas and option in excel thank you so much dear.
Hello,
I am trying to create conditional formats that uses icons where I can say if the value is >30%, then green, between 30% and 29% is yellow, and less than 28% is red. Somehow, the yellow one is not yielding results. Also, is it possible to use the conditional format when the data is negative?
Thanks a lot,
Maud
Hello Maud,
Please try to use one of the following formulas for the rule that doesn't work, these examples assume that the numbers are in column A:
=AND($A2>=29%,$A2<=30%)
You can also try this one:
=AND($K2-29%>=0)
You can use negative numbers for conditional formatting as well.
Hi,
I'm looking for the formula for conditionally formatting in situation where we have 2-set of values.
Let's say - If I've 50-locations actual sales Vs their INDIVIDUAL targets (Which are different for each location) and need to conditionally format RED/GREEN for their given achievements (Achieved : Yes = Green / No = Red)
I need a versatile formula to set in entire column - I tried few options and it fails :(
Please help - I appreciate it in advance
Thanks and Regards
Hello,
If I understand your task correctly, you need to create two Conditional Formatting rules:
1) One will highlight the locations Green if the value in the column with their "Actual sales" is equal to or more than the value in their "Individual target":
=$B2>=$C2
1) The other rule will highlight the locations Red if the value in the column with their "Actual sales" is less than the value in their "Individual target":
=$B2<$C2 Please replace column B with the name of the column with actual sales, and column C with the name of the column with individual targets. I hope this helps.
Hello,
Is there a way to make the application of a formula in one cell conditional upon whether or not another cell is blank?
E.g. If cell C1 contains a number, I want cell D1 to return the value of C1/366. If cell C1 is blank, I want cell D1 to be blank.
At the moment, I have got to a stage where if cell C1 contains a number, D1 displays (in text) "=C1/366" and does not process the formula.
Hi Josie,
Sure, you need to use the IF function in D1:
=IF(C1<>"",C1/366,"")
It says if C1 is not empty, divide it by 366, otherwise leave the cell blank.
I hope this helps.
Hi,
I need your help. I am using conditional formatting>New Rule>Format only cells that contains>specific text. formatting is working i am using colors in that red and green Green for with in limit and Red is for Breach. applied formatting works properly but actual problem is when i closed file after save next time that formatting removed.
what is the reason behind why this happening? why that formatting not saved with that file ?
can any body help me out please in this regard ?
Hi, I need to highlight values on a spread sheet in column F if the value is bigger than the value in column D. How do I write the formula for the whole column without doing it one for one.
Hi Willie,
Just enter the dollar sign before the names of the columns in your formula, e.g.
=$F2>$D2
You also need to make sure "Applies to" range contains all records in column F, so when you click "Manage rules", you will see "=$F$2:$F$350" under "Applies to" if you have 350 rows.
Let me know if you have any other questions.
I am creating a large excel document that has information populating though it. If I have a cell on one page showing ten items, i would like on another page where it will populate over ten cells showing one item all with that same discription. is there a way to do this? I really need to! To explain further - on one page it is a quote which says 10 doors, on another page i want it to populate 1 door ten times where there will be further information added for an architect to review.
namaste,
Excel formulas for conditional formatting based on another cell value
in that i need time conditional formatting
my travel time stated time 7:00 i should reached 8:00if above 1 hour diff should be diff coloer
Need you advice .
HI, i need to put in a column:
in green: different texts, aleatory
in red: NO
in yellow: DEF
gray:nothing
i already put red, yellows and gray conditions.
so, for green: edit formating rule/format only cell contain/ not equal to/=AND("NO";"DEF")
doont work, dont bring me anything in green.
help¡?
Hi Zak,
Please include a cell reference into your formula:
=AND($H2<>"NO",$H2<>"",$H2<>"DEF")
I hope this helps.
Hi,
Svetlana,
We need your help we want to use conditional formatting on a sheet 1 column A but references is on another sheet 2, If in Sheet 2 Column B Value is greater than Column A, than Sheet 1 Column A should be highlight reflect as color
Hello,
To compare values in different sheets, you need to include the name of the sheet to the cell reference, so your formula will look this way:
=Sheet2!$B2>Sheet1!$A2
Please also make sure you apply the rule to column A in Sheet 1.
Hi Svetlana, Can I use conditional formatting on one sheet and monitor a cell on another sheet? So I want a cell on one sheet to change colors when the cell on another sheet has specific text or numbers.
Hi Todd,
Sure, you just need to add the name of the sheet to the reference in your formula, e.g. if you want to monitor the value in A2 in Sheet 2, here is how it should look:
=Sheet2!$A$2="Value"
Good afternoon,
Can you please assist me with the following:
If cell B4 contains the two letter code v6, reflect in
cell R4: September 15th.
Hello Gerardo,
You need to enter an IF statement into R4:
=IF($B4="v6","September 15th","")
You can read more about the IF function in this blog post:
https://www.ablebits.com/office-addins-blog/if-function-excel/
If cell J8 value is 5 and cell K8 value is 2 and I want cell G8 to list the value from J8 when K8 is 2...how do I formulate that?
Hello Todd,
If you want to display the value from J8 when K8 is 2, then you need a simple IF statement in G8:
=IF(K8=2,J8,"")
If you want to get the value from J8 if both conditions are true: K8 contains 2 AND J8 contains 5, then you need the following formula in G8:
=IF(AND(J8=5,K8=2),J8,"")
Hi, can you please help me find a formula for my query. I want to conditional format and show me where a figure reduces to zero in a column. I'm checking leave audits and need to identify where someone's balance has been taken off them. So basically just identifying zeros isn't enough, I need to show where the preceding cell above had a figure and then in the next it is zero.
Hello Svetlana
Following your formula suggestion which should conditionally format a date in column E based on the open or closed status appearing in column H, I am finding the same results despite the status.
I am attempting to use the following formula:
=AND($E6<TODAY(), $H6="O")
As certain as can be, I have checked all your listed reasons why this may not work. The result I am getting is exactly the same as it would be for, =$E6<TODAY()
Any help you can give would be immensely appreciated. Please!
20
30
40
50
20
sum = 160 my query is i want sum 190 then i am having freedom to change the cell value (30) what is option of reverse caluclation
I have two columns containing sub totals. In the first column I have number and text mixed like ' 1 count ',' 2 count ' etc. In the second column there are values corresponding to sub totals. I tried to find out the highest value in column B. However the secondary sub totals had to be ignored as they were nothing but sum of first set of sub totals. The formula I used in the new rule, was =and(isnumber(search("count",$A1)),$B1=max($B:$B)). But nothing gets highlighted. Please help
I am trying to create a formula for the following
I want the number 2 to be generated in the selected cell when all the values in three separate cells are below a specific number, if this statement is not true than I want a value of 0 generated.
I have tried several formulas and none seem to work, my latest try was with the following:
=IF(AND(NOT(C5<85),NOT(R5<85)NOT(S5<85)),2,0)
This returns this error message: #ERROR, Formula Parse Error
Hi,
I wants to apply like if i will update A1 as Apple, B1 suppose to show Red automatically, how to do that
please explain.
I have a spreadsheet for work where I have figures based on where our console is for the morning and then the afternoon so we can check the difference in numbers which is spread across 3 sheets named - AM, PM, DIFFERENCE.
I am looking to format this so that is there is a difference in the numbers then the cell would either change colour or show a symbol.
I would need it so that if we have a number in the morning, for example 10, and at the end of the day it showed 15 it would need to turn red or have a symbol to say the figure increased?
Any help would be greatly appreciated!
Hi,
I was wondering whether there is a way in which you can change a cell value according to the fill of that cell or of other cells. For example, if I have A2 filled with red, I want to write inside of it the word "DENIED" and if I put green, I would like to write "GRANTED". Thank you in advance!
Hi
I have a problem. i like to link one cell to another in the same format.
I'm Bold & Italic. I'm with under line Bold is Bold & Italic is Italic.
i try many formulas but its not working.
can you help me.
In spreadsheet, I need to link two cells
For example, If I click on a1 then c1 cell automatically get highlighted.
It is possible is google spreadsheet?
If yes means, How to do that?
how do i highlight (change background color) for a row in multiple tables based on a cell having similar values?
for ex if i have multiple tables measuring the performance of tv channels and i want to highlight certain channels in different market tables..how can i do it..
was trying conditional formatting but not getting the answer
(all the tables are in the same page/sheet)
The conditional formatting based on another cell's value was exactly what I wanted, but it isn't working and I have checked all 6 of your troubleshooting items - but still no joy. I have prepared a worksheet to calculate savings for an energy customer based on a particular (user input) value that would determine the rate structure for each client meter. The client has 5 meters, so I have 5 sections to calculate their potential savings under different input scenarios. There are 3 potential rate structures for each meter and the savings from their (current) rate structure will depend upon the transformer capacity chosen. I want to be able to highlight the actual savings calculation lines for each meter based on the rate structure elected by the transformer capacity chosen. If the capacity chosen is 100% of the transformer capacity, then the rate qualifier is zero and there is no rate change. I would not have any lines highlighted. If the capacity chosen is 50-99% of the transformer capacity, then the rate qualifier is 1 and there would be cost changes/potential savings associated with the new rates. I would want the appropriate lines associated with the calculations for rate 1 to be highlighted if the rate qualifier were 1, but NOT highlighted for any other value. Similarly, if the capacity were less than 50% of the transformer capacity, the rate qualifier would calculate as a 2 and the cost/potential savings lines associated with the 2nd rate structure would calculate and I would want them to be highlighted - but not highlighted for any other value than 2. So far I have been unsuccessful in getting the conditional highlighting to work. In manage rules, I used an absolute cell address for my reference cell to check the value and the cells to be highlighted were correct, but still no highlighting. What else could be wrong? I don't need the highlighting for myself, but I am giving this workbook to my boss, who won't know how it is built and will need the highlighting to help him understand how the workbook is calculating when he makes input changes to the transformer values. Thanks for any help you can give!
Just to clarify on my last comment....
I cant use the option to highlight dates between a certain range as i need the dates and highlighting to be relative to todays date. so if i chose to use a "between" formula i would have to change the date range daily which defeats the object
Good Day
Please may you assist. I am working on a call report and i need my formulas to produce the following two results:
1) Highlight all dates prior to 30 days from today in RED BOLD
Highlight all dates prior to 15 days from today in PURPLE BOLD
Highlight all dates in the last 14 days NORMAL BLACK
2)Highlight all dates which fall 2 weeks from today in PURPLE BOLD
Highlight all dates which fall one week from today in RED BOLD
highlight all dates which fall on future dates in BLACK BOLD WITH RED BACKGROUND
I've worked out the formulas for one of the above but i cant get them to work together simultaneously without affecting eachother. so in other words problem (1) will be applicable to one column so i need all those formulas to work together and not affect eachother.... i cant seem to get excel to give preference to the formulas with the lowest date, it seems to be working on the 30days first, then the 15 and then the 7 so my 7 days will not highlight because it is already highlighted from the formula of 30 days.
PLEASE ASSIST - THIS IS BOGGLING MY BRAIN
I need to highlight a cell if:
it contains a specific text
AND
it is not duplicated in the same column
Thank you
Hello
I need a formula for the following:
Cell A2 returns a result of 16, I need to classify this result into one of 6 groups
if A2 90, I want cell B2 to display GROUP 1
Thanks very much
T
I need to set a whole column of information not to be lesser than $X, if it's lesser than the amount it should just show 0. What should I do?
So, this is a straight line depreciation project and I need to divide my depreciation expense in half for the first year and the disposal/last year. However, the problem is that we do not know when would the disposal/last year be, it might vary from year 3-20. How should I put it in excel?
Hi,
I am not sure how to make this work, but I figured I would ask if this is possible.
Let's say I created a list of items
for example
In Column A I have a drop down list
Broom
Mop
Dustpan
and in column b (or whatever column)
I want it to automatically post the price on whatever I selected in column A
So for example
lets say the prices are;
Broom -- $5.00
Mop -- $10.50
Dustpan -- $3.50
if i go to a new line, and click mop I want it to autopopulate in column B as $10.50
Does that make sense?
thanks,
Aysheh
I have an issue with letters:
Column V Column W
01/01/2016 Y
01/02/2016 Y
01/02/2016 N
I need column V to be highlighted red if there is an "N" in column W and if the date has passed today's date
I also need column V to highlight Orange if there is an "N" in column W and the date is within 2 weeks before today's date
Is this possible?
Thank you
Hi Martha,
You need to create 2 conditional formats for column V using formulas.
Please use the following formula for the red color:
=AND(DAYS(TODAY(),$V24)>=0,DAYS(TODAY(),$V24)14,$W24="N")
Hi guys. I am trying to have a different number in one columns depending on how big the amount is in the other columns. so use 0.002635 if other column is >100mill, use 0.002531 if other column is >200mill. The following formula is not working:
=IF(H5>=0,"0.002635",IF(H5>=200000000,"0.002531",IF(H5>=300000000,"0.001879",IF(H5>=400000000,"0.001545","0"))))
Can you please help?
Hi Agata,
Please try this formula:
=IF(H5>=400000000,"0.001545",IF(H5>=300000000,"0.001879",IF(H5>=200000000,"0.002531",IF(H5>=0,"0.002635","0"))))