Conditional formatting based on four date ranges

bssltd

New Member
Joined
Jul 29, 2014
Messages
2
Hi,

I'm trying to add a "traffic light" conditional format based on four separate date cells for a plant hire schedule.
These four cells are Date On, Date Off, Date Suspended From, and Date Suspended To.

What I want to achieve is:
- A Green light if today's date is greater than or equal to the Date On cell and not greater than the Date Off cell, indicating the plant is ON hire.
- An Amber light if today's date is equal to the same formula as the green light, but also greater than or equal to the Suspended From date, and not greater than the Suspended To date, indicating the plant is SUSPENDED.
- A Red light if today's date is outside the Date On and Date Off cells, indicating the plant is OFF hire.

The Date Off cell will remain blank until the plant is off hired.
The Suspended To date will also remain blank until the end of the suspension period.

I've tried various methods of achieving this.
I've tried the Traffic light function within one cell, as well as trying three different cells - one for each status.
I've tried inputting formula in 3 separate cells to return the values 0,1, or 2 depending on status.
So far I've played about with IF functions for the On/Off dates along with AND to add the Suspended dates.

I'm not that experienced with more complex formulae/functions, and don't know what else may work.

Here's an example of my date columns, and what should be their current status.
Current StatusHire OnHire OffSuspended FromSuspended To
*Green*01/07/201412/07/201415/07/2014
*Red*20/07/201425/07/2014
*Amber*20/07/201428/07/2014

<tbody>
</tbody>


Any help would be greatly appreciated.
Sorry for the long post, and I hope I've explained myself clearly.

Thanks in advance.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
I think this calculation will work, which you can then translate in to Conditional Formatting and test for; but I may well have missed something so try it with a range of data...

Excel 2010
ABCDEF
1Current StatusStatus CalcHire OnHire OffSuspended FromSuspended To
2*Green*G01-Jul-1412-Jul-1415-Jul-14
3*Red*R20-Jul-1425-Jul-14
4*Amber*A20-Jul-1428-Jul-14

<tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
B2=IF(AND(TODAY()>C2,OR(TODAY()<d2,d2=""< font="">)</d2,d2=""<>), IF(OR(AND(E2="", F2=""), AND(TODAY()>F2, F2<>"")), "G", "A"), "R")

<tbody>
</tbody>

<tbody>
</tbody>

/AJ
 
Upvote 0
Thanks for that Adam.
I've tweaked it a little, but your suggestion was a good starting point for me. The only bit that's missing is the Off Hire information. Your formula doesn't cover it, and I'm struggling to see how to integrate it with what you've done already.

Any more suggestions?

Thanks,
Chris

(Sorry for the late response, but I've not had a lot of time to look at this over the last week).
 
Upvote 0

Forum statistics

Threads
1,215,327
Messages
6,124,280
Members
449,149
Latest member
mwdbActuary

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
Back
Top