Can I please have an amendment to this conditional formatting

les361800

New Member
Joined
Jul 11, 2023
Messages
27
Office Version
  1. 365
Platform
  1. Windows
I was kindly provided with this formula to turn a cell red when the date was the next day.
The cell however turns back to white when the date is the current date - can it be amended so that it turns red the day before, and stays red when on or past the date?

Thank you :)
 

Attachments

  • Screenshot 2024-03-20 120635.png
    Screenshot 2024-03-20 120635.png
    33.9 KB · Views: 8

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
I would say this should work for you hopefully =--SUBSTITUTE(D1,".","/")>=WORKDAY(TODAY(),-1),

I assume from this that your dates are incorrectly formatted as dd.mm.yyyy, If I were you I would avoid using dates in that format :)
 
Upvote 0
Do you always want that cell to be RED once it has first become RED? Or for a specific number of days, or when another condition overrides it?

Is D1 currently a text string that looks like a date?
 
Upvote 0
Do you always want that cell to be RED once it has first become RED? Or for a specific number of days, or when another condition overrides it?

Is D1 currently a text string that looks like a date?
Yes, please see the attached. It's a simple doccument to record jobs and date they need done by. Would just like the date to turn red the day before and stay red.
D is a date format column.

Thanks!
 

Attachments

  • Screenshot 2024-03-20 123142.png
    Screenshot 2024-03-20 123142.png
    36.8 KB · Views: 3
  • Screenshot 2024-03-20 123249.png
    Screenshot 2024-03-20 123249.png
    72.8 KB · Views: 4
Upvote 0
Yes, please see the attached. It's a simple doccument to record jobs and date they need done by. Would just like the date to turn red the day before and stay red.
D is a date format column.

Thanks!
Then the formula by @Deek6t8 will probably suit your needs. But, eventually all the cells in the column (with future dates) now will be permanently red.
If the conditional formatting is for taking action, why not remove that formatting when the action has been completed?

What happens when you change the format of column D to GENERAL? Does a date serial number appear? Or do you just have the column left justified?
 
Upvote 0
I would say this should work for you hopefully =--SUBSTITUTE(D1,".","/")>=WORKDAY(TODAY(),-1),

I assume from this that your dates are incorrectly formatted as dd.mm.yyyy, If I were you I would avoid using dates in that format :)
Hey, this didn't work :(

The dates seem to be fine with the original formula?
 
Upvote 0
Then the formula by @Deek6t8 will probably suit your needs. But, eventually all the cells in the column (with future dates) now will be permanently red.
If the conditional formatting is for taking action, why not remove that formatting when the action has been completed?

What happens when you change the format of column D to GENERAL? Does a date serial number appear? Or do you just have the column left justified?
Hi, that formula didn't work - any ideas?
We completely delete a line when the job is complete, I just need the date to be red from the date before until we bin it.

When I change it to general the dates just say the exact same, not justified either
 
Upvote 0
The dates you have are not actually dates in Excel they are text, the original Substitute formula converted them into dates for teh comparison by replacing the . with / then did the comparison as I said it would be better if the dates were actual dates then the formula would just be =D1>=today()-1 hope that makes sense :)
 
Upvote 0
When I change it to general the dates just say the exact same, not justified either
Yes, column D are not dates, just text. Unless you have a very very compelling reason to store dates as text (which means you won't be able to make charts or pivot tables with date structures for one reason) you should always store dates as date serial numbers. How you format the cell with the date value is your preference.


@Deek6t8 takes care of that with the double unary (--) in the formula by coercing the date string into a date value. The Substitution of "/" for "." is because excel may not (if ever) recognize a "." as a date separator for date value coercion (the sequence of y,m, & d may make a difference too).
 
Upvote 1
Yes, column D are not dates, just text. Unless you have a very very compelling reason to store dates as text (which means you won't be able to make charts or pivot tables with date structures for one reason) you should always store dates as date serial numbers. How you format the cell with the date value is your preference.


@Deek6t8 takes care of that with the double unary (--) in the formula by coercing the date string into a date value. The Substitution of "/" for "." is because excel may not (if ever) recognize a "." as a date separator for date value coercion (the sequence of y,m, & d may make a difference too).
Eek that didn't make much sense to me I'm afraid!

I have changed the dates and tried the suggested formula, but it still just doesnt work. All of the cells just turn white?
 

Attachments

  • Screenshot 2024-03-20 140635.png
    Screenshot 2024-03-20 140635.png
    20.5 KB · Views: 4
Upvote 0

Forum statistics

Threads
1,215,102
Messages
6,123,099
Members
449,096
Latest member
provoking

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