Excel question - Co...
 

MegaSack DRAW - This year's winner is user - rgwb
We will be in touch

[Closed] Excel question - Colour formatting

6 Posts
4 Users
0 Reactions
40 Views
Posts: 2297
Full Member
Topic starter
 

Morning all.

Are there any excel conditional formatting gurus in the house today?

I'm trying to turn a cell green or red depending on the date in that cell.

If the date has passed then it needs to be red, and if the date is in the future then it needs to be green. The cell would also need to change from green to red as the calendar date changes.

Is such a piece of excel sorcery possible? I'm using Excel 2010.

Ta in advance


 
Posted : 31/10/2014 10:51 am
Posts: 1142
Full Member
 

If you add 2 rules to the Conditional Formatting based on the cell value, one being Cell Value < =now() and the second being Cell Value > =now() - should give you what you need?
RM.


 
Posted : 31/10/2014 10:59 am
Posts: 0
Full Member
 

I'd use TODAY() to get a clearer cutoff, because a hard coded 31/10/2014 is less than NOW() so you'd shade today as being red which I don't think is what you want ?

NOW() returns date & time, TODAY() just returns the date. Or more specifically, 00:00 on the morning of that day.


 
Posted : 31/10/2014 11:08 am
Posts: 2297
Full Member
Topic starter
 

Ta RM

Managed to work it out:

=J59>TODAY()-365 (for the green colouring)
=J59<TODAY()+365 (for the red colouring)


 
Posted : 31/10/2014 11:10 am
Posts: 0
Full Member
 

That's not going to do what you asked for ! Ditch the ±365 bits.


 
Posted : 31/10/2014 11:25 am
Posts: 0
Free Member
 

What @Sunday says


 
Posted : 31/10/2014 11:35 am
Posts: 2297
Full Member
Topic starter
 

Cheers Sunday. That's it sorted.


 
Posted : 31/10/2014 11:45 am