0
votes

I am trying to set a conditional formatting for an expiration date field. The idea is to show via color coding (green, yellow, and red) when the expiration date is approaching according to the cell (In the E column) and today's date.

It should fill green when the date in the field is equal or after today

=E3>TODAY()

It should fill yellow when the date in the field is less than today and less than 3 months (90 days) (between 89 days and yesterday)

=AND(E3<TODAY(),E3>(TODAY()-90))

It should fill red when the date in the field is less than 3 months (90 days)

=E3<=TODAY()-90

Excel Screenshot

The colors do not match my date ranges.

EDIT:

I have updated my original post to include more info and updated screenshot example.

I included the dates (including "today's date") as reference. I added the conditional Formatting Rules formula in the cells. I included the Correction column to show what the correct color should be.

2
=AND(H3 > TODAY()-90, H3 < TODAY())? - GSerg
Is the order of the conditions important? I have the order as yellow, green, red. - Rick
Depending on how you lay out the formulas, it may be. With these formulas, it isn't. If your data starts in H3 but you apply the formula to the entire H:H, the result will be shifted two cells down. If you want to apply the formula to entire H:H, change H3 to H1. - GSerg
I added a screenshot of the conditional format and edited my entry. - Rick

2 Answers

0
votes

This is what I have:

enter image description here

And this order on the conditional formatting:

enter image description here

Formulae used:

Green:

=D6>=TODAY()

Yellow:

=AND(D4<TODAY(),D4>(TODAY()-90))

Red:

=D5<=TODAY()-90

Update:

With 14/03/2023

enter image description here

0
votes

I changed the rule type from Use a formula to determine which cells to format to Format Cells that contain.

It worked perfectly.

enter image description here enter image description here enter image description here enter image description here enter image description here