Using Conditional Formatting with expired dates

Mustafa Evans

New Member
Joined
Mar 18, 2010
Messages
35
Office Version
  1. 2010
Platform
  1. Windows
Hi all, hope you can help am attempting to use conditional formatting to show expired and near expired (5 days) dates in my spreadsheet.

For expired dated i would like those cells to be RED.
For dates about to expire in the next 5 days those cells should be AMBER
and finally, those cells that are not about to expire should remain WHITE.

Am trying to use the TODAY() function in my calculations. Hope you can help.

The dates are in columns H, I and J, but begin in cell H8.

RED - =H8<=TODAY()
AMBER - =H8>=TODAY()-5
WHITE - =H8>TODAY()

Having done this am unsure what order they should run. Or is there a easier way.

Many thanks.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,788
Office Version
  1. 365
Platform
  1. Windows
I would change the amber to
Excel Formula:
H8<=Today()+5
and get rid of the rule for white.
 

Mustafa Evans

New Member
Joined
Mar 18, 2010
Messages
35
Office Version
  1. 2010
Platform
  1. Windows
Hi, sorry your suggestion doesn't seem to work, could you have another look at it please.

Many thanks.
AMBER Rule - Dates expiring in 5 days.pngCF Screen.pngRED Rule - Expired dates.pngSheet.png
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,788
Office Version
  1. 365
Platform
  1. Windows
You need to remove the quotes from the amber formula.
 

Mustafa Evans

New Member
Joined
Mar 18, 2010
Messages
35
Office Version
  1. 2010
Platform
  1. Windows

ADVERTISEMENT

Thanks, i thought i have deleted those already !!. I works now except i had to re-order the order they work with RED first followed by AMBER.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,788
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

Mustafa Evans

New Member
Joined
Mar 18, 2010
Messages
35
Office Version
  1. 2010
Platform
  1. Windows

ADVERTISEMENT

My protocol in CF is now working for dates, but i have another element regarding whether an appointment is Urgent or Routine. I've also managed to get this working. BUT when i combine them the conditional formatting clash and the result isn't what i need. I wonder if you could help further please.

Am not sure why the formula works as seems very untidy. The date element is OK, i just need to combine now.

So, the appointment type (Routine or Urgent) is selected in column G:

If ROUTINE is selected in cell G8, cell H8 is GREYED out (and ideally that cell is locked)
If URGENT, is selected in cell G8, then H8 will accept a date (entered manually) and cells I8 and J8 and GREYED out (and ideally those cells locks)
Working GREY Protocol.png

CF for Protocol GREY.png
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,788
Office Version
  1. 365
Platform
  1. Windows
You cannot lock cells with conditional formatting.

Those rules seem to be working, so what's the problem.
 

Mustafa Evans

New Member
Joined
Mar 18, 2010
Messages
35
Office Version
  1. 2010
Platform
  1. Windows
The Grey CF rules work, and in a different spreadsheet the date rules work, but they don't work when put together in the same spreadsheet.
CF combined not working.png
CF Screen.png
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,788
Office Version
  1. 365
Platform
  1. Windows
If G is Urgent should I & J still show red/amber, or should they remain grey?
 

Watch MrExcel Video

Forum statistics

Threads
1,130,014
Messages
5,639,555
Members
417,098
Latest member
steverob

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top