1 - I have a column with percentage values, If the percent is less than 92% but greater than 85% i want the background to be yellow, and then if it is less than 85% the background would be red.
2 - I have 2 columns B & C that have time values - I want to compare C to B and if C is great than B by 5 mins then the background would be red - example Column B = 9:00:00, Column C = 9:06:52. Column C background would be red
How can I accomplish this?
Microsoft Excel
Last Comment
Rob Henson
8/22/2022 - Mon
byundt
I suggest using a formula criteria to determine which cells to format.
For the first one, let's assume that cell D2 is the first cell that needs conditional formatting. You might use formulas like:
=D2<0.85 for the red format
=AND(D2>=0.85, D2<0.92) for the yellow format
After entering the formula, click the Format button, go to the Fill tab and choose your color. Click OK twice.
For the second one, you might use a criteria like:
=AND(COUNT(B2:C2)=2, (C2-B2)>=TIME(0,5,0)) for the red format
Dave KIlby
ASKER
Thank you - what if I wanted to check column D and E which are also time values, but I want to check if column E is 5 or more mins less than column D then format red
For the first one, let's assume that cell D2 is the first cell that needs conditional formatting. You might use formulas like:
=D2<0.85 for the red format
=AND(D2>=0.85, D2<0.92) for the yellow format
After entering the formula, click the Format button, go to the Fill tab and choose your color. Click OK twice.
For the second one, you might use a criteria like:
=AND(COUNT(B2:C2)=2, (C2-B2)>=TIME(0,5,0)) for the red format