SOLVED

How do I make excel change the colour of a cell depending on a different cells date?

Copper Contributor

001.png

Hi,

 

How do I make excel change the colour of a cell depending on a different cells date?

 

Turn A2 red if - E2 cell is smaller than todays date

Turn A2 yellow with red outline if - E2 cell is equal to todays date

Turn A2 clear if - E2 cell is bigger than the current date

 

75 Replies
I have two sheets that are connected with formulas,when I change data in sheet 1 it changes in sheet 2.I want to ask what do I have to do,when I change data in sheet 1 to appear in another colour in sheet 2.

@TanjaC74 

You can use conditional formatting referring to the values of the cells on Sheet2, just like when you enter the data there directly.

@Hans Vogelaar what if I need a cell to change to be white if the adjacent cell is left blank I tried =D3=“BLANK” but that didn’t do the trick 

@Hans Vogelaar that did the trick 

 

now one more question I want C3 to change green if D3 falls between the value of 8.00-9.49

i already have the formulas for if it’s less than 7.99 it turns yellow =$D3<(7.99), and more than 9.5 it turns red =$D3 >(9.5) in place.

 

any idea what formula might work for 8.00-9.49?

 

@Hans Vogelaar 

debsenheimer_2-1712954782714.png

 

I have a spreadsheet with quarterly invoices. I want all cells in a row to turn black after the date in column H (ie where the N/As are in the first 5 rows.) and I want my range to be columns L,M,N,Q,R,S, U,V,W. (I will have different numbers of rows depending on the sheet and the year adn would rather not have to specify range.) I'm trying to tell it to look at a cell, check the header row to determine if that date is after the date in Column H, and if so change all other cells in date columns black for the rest of the row. And I want it repeated for the whole sheet. I just can't figure out how to code that. 

This is what I want it to look like at the end.

 

debsenheimer_1-1712954747604.png

 

Is there some form of conditional formatting or macro use that I could make this happen?

Thanks!

 

@debsenheimer 

Select L1:X100 (or further if you like).

On the Home tab of the ribbon, click Conditional Formatting > New Rule...
Select 'Format only cells that contain'.
Leave the first drop down set to 'Cell Value'.
Select 'equal to' from the second drop down.
In the box next to it, enter the formula

="N/A"

Click Format...
Activate the Fill tab.
Select black as fill color.
Click OK, then click OK again.

@debsenheimer 

To make the following work, enter dates in the month cells in row 1, formatted as mmm to display the abbreviated month name.

For example, in L1: 10/1/24, in M1 11/1/24 etc.

Select L2:X12 or further to the right and down.

L2 should be the active cell in the selection.

On the Home tab of the ribbon, click Conditional Formatting > New Rule...
Select 'Format only cells that contain'.
Leave the first drop down set to 'Cell Value'.
Select 'less than or equal to' from the second drop down.
In the box next to it, enter the formula

=AND($H2<>"", EOMONTH(L$1, 0)>$H2)

Click Format...
Activate the Fill tab.
Select black as color.
Click OK, then click OK again.

HansVogelaar_0-1712957551708.png

@Hans Vogelaar 

What if the same conditional format can be based on two differing texts in a single cell, such as  =$F2="Closed" as well as "Closed-Ext". I'm not sure how to combine that in one conditional formula... 

@Ray_Z316 

You could use

=OR($F2="Closed", $F2="Closed-Ext")

Excellent! Thank you for the speedy reply!
Also, what if the text can contain anything after "Closed" such as "Closed-Ext" or "Closed-nnn" can I use a * such as "Closed"* ?