Conditional formatting based on date doesn't clear when date is erased

dragonabsurdum

New Member
Joined
Jul 3, 2015
Messages
3
One of my conditional formatting rules is giving me some grief. This might be simpler with VBA, but I'm trying to avoid using a macro-enabled sheet since the file is shared overseas, I'm new to the company, and I'm not sure how they'd feel about me modifying the sheet that much.

Anyhoo...

The following rule will change the row to green when a date is entered into Column F (Date Responded), which is fine. The problem is that if someone clears the date, it remains green rather than being evaluated by the other rules. The entire column is formatted as "Date" and the other rules work prior to a date initially being entered into Column F.

=LEFT(CELL("format",INDIRECT("F"&ROW())))="D"

The closest I came to finding a fix was to have the rule evaluate whether the cell contained text in the format "dd/mm/yyyy", but there is the odd cell where 2 dates are entered. Is it possible to set conditional formatting to evaluate the cell based on the first 10 characters from the left? INDIRECT seems to be a bit finicky in conditional formatting and I haven't been able to get it to work. Every other rule seems to be working as expected.

The complete set of rules I have currently is as follows:
=ISBLANK(INDIRECT("A"&ROW())) <- no format, Stop If True (Column A is "Date Received")
=INDIRECT("F"&ROW())="P" <- pink fill, Stop If True (indicates response has been prepared for review, but has not been sent)
=INDIRECT("F"&ROW())="M" <- blue fill, Stop If True (indicates we are waiting for input from the client before responding)
=INDIRECT("F"&ROW())="N/A" <- green fill, Stop If True (no response required)
=LEFT(CELL("format",INDIRECT("F"&ROW())))="D" <- green fill, Stop If True (response sent)
=LEN(INDIRECT("F"&ROW()))>0 <- pale pink fill, Stop If True (invalid response error indication)
=INDIRECT("E"&ROW())<(TODAY()) <- red fill, Stop If True (response overdue, Column E is the due date)
=INDIRECT("E"&ROW())<(TODAY()+3) <- yellow fill (response due within 3 days)
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
I believe I found a solution. I changed the problematic rule to:

=NOT(ISERROR(DATEVALUE(TEXT(LEFT(INDIRECT("F"&ROW()),10),"dd/mm/yyyy"))))

This appears to have fixed the issue with the row not reverting to no fill/red/yellow/etc. as relevant when the date is cleared from "Date Responded". It also gets around the problems I had if people decided to enter multiple dates into the same cell.
 
Upvote 0

Forum statistics

Threads
1,223,630
Messages
6,173,454
Members
452,514
Latest member
cjkelly15

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