Conditional Formatting based on passed date

SnKeaK

New Member
Joined
Oct 27, 2012
Messages
24
SEPDEFG
4553609/01/2024019$15.93$.90$1.77
4553709/02/20240211$100$.32$2.45
4553809/03/20240319$232$3$4.56
4553909/04/202404

In the example above, I am trying to conditionally format cells in the column labeled D through G. The objective is I need two criteria met.

1. Cells in D column, D2 for example must be greater than 0
2. Cells in B column, B2 for example date must be less than today. So in other words, I only want the cells in that row highlighted if it's past the current date.

=AND($D2>0,DATEVALUE(B2)<TODAY() -----is being applied to =$D$2:$G$5 with no success.

I need D2 to G2 highlighted after Sep 1st passes. Then once Sep 2nd arrives/passes, highlight D3 to G3. And so on.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
the dates appear left justified , as does the numbers
are they real dates & numbers ?

normally dates and numbers are right justified
on the date column
change the format to general all the dates should change to numbers

select D2:G10000 or however many rows yoy need

=AND( $B2<>"", $B2<today() , $D2>0)

otherwise

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

This will possibly enable a quicker and more accurate solution for you.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC

then put the sample spreadsheet onto a share

I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed

Make sure you set any share or google to share to everyone
 
Last edited:
Upvote 0
you need to put the info as a reply here
B is not a date as you are using
=TEXT(A2,"mm/dd/yyyy")
so you cannot use <today()
so not sure why you are doing that, as A is a date
=AND( $A2<>"", $A2<today() , $D2>0)

Cell Formulas
RangeFormula
B2:B31B2=TEXT(A2,"mm/dd/yyyy")
C2:C31C2=LEFT(MID(B2,FIND("/",B2)+1,LEN(B2)),FIND("/",MID(B2,FIND("/",B2)+1,LEN(B2)))-1)
D3:D31D3=IF(TODAY()>=DATEVALUE(B3),IF(COUNTA($L$2:$L$31)<=0,"",COUNTA($L$2:$L$31)),"")
E3:E31E3=IFERROR(SUM(O$2-[@[Monthly Wheel Dues]]-[@[Commision Earned]]),"")
F3:F30F3=IF([@[Total '# of Entries]]="","",[@[Total '# of Entries]]*0.1)
G3:G31G3=IF(TODAY()>=DATEVALUE(B3),IF(Table14[@[Tips Received ]]="","",SUM(O$2-O$4)*10%),"")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D2:G31Expression=AND( $A2<>"", $A2<TODAY(), $D2>0)textYES
 
Upvote 0
the dates appear left justified , as does the numbers
are they real dates & numbers ?

normally dates and numbers are right justified
on the date column
change the format to general all the dates should change to numbers

select D2:G10000 or however many rows yoy need

=AND( $B2<>"", $B2<today() , $D2>0)

otherwise

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

This will possibly enable a quicker and more accurate solution for you.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC

then put the sample spreadsheet onto a share

I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed

Make sure you set any share or google to share to everyone

you need to put the info as a reply here
B is not a date as you are using
=TEXT(A2,"mm/dd/yyyy")
so you cannot use <today()
so not sure why you are doing that, as A is a date
=AND( $A2<>"", $A2<today() , $D2>0)

Cell Formulas
RangeFormula
B2:B31B2=TEXT(A2,"mm/dd/yyyy")
C2:C31C2=LEFT(MID(B2,FIND("/",B2)+1,LEN(B2)),FIND("/",MID(B2,FIND("/",B2)+1,LEN(B2)))-1)
D3:D31D3=IF(TODAY()>=DATEVALUE(B3),IF(COUNTA($L$2:$L$31)<=0,"",COUNTA($L$2:$L$31)),"")
E3:E31E3=IFERROR(SUM(O$2-[@[Monthly Wheel Dues]]-[@[Commision Earned]]),"")
F3:F30F3=IF([@[Total '# of Entries]]="","",[@[Total '# of Entries]]*0.1)
G3:G31G3=IF(TODAY()>=DATEVALUE(B3),IF(Table14[@[Tips Received ]]="","",SUM(O$2-O$4)*10%),"")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D2:G31Expression=AND( $A2<>"", $A2<TODAY(), $D2>0)textYES
you need to put the info as a reply here
B is not a date as you are using
=TEXT(A2,"mm/dd/yyyy")
so you cannot use <today()
so not sure why you are doing that, as A is a date
=AND( $A2<>"", $A2<today() , $D2>0)

Cell Formulas
RangeFormula
B2:B31B2=TEXT(A2,"mm/dd/yyyy")
C2:C31C2=LEFT(MID(B2,FIND("/",B2)+1,LEN(B2)),FIND("/",MID(B2,FIND("/",B2)+1,LEN(B2)))-1)
D3:D31D3=IF(TODAY()>=DATEVALUE(B3),IF(COUNTA($L$2:$L$31)<=0,"",COUNTA($L$2:$L$31)),"")
E3:E31E3=IFERROR(SUM(O$2-[@[Monthly Wheel Dues]]-[@[Commision Earned]]),"")
F3:F30F3=IF([@[Total '# of Entries]]="","",[@[Total '# of Entries]]*0.1)
G3:G31G3=IF(TODAY()>=DATEVALUE(B3),IF(Table14[@[Tips Received ]]="","",SUM(O$2-O$4)*10%),"")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D2:G31Expression=AND( $A2<>"", $A2<TODAY(), $D2>0)textYES
I really appreciate your help. Thank you.
 
Upvote 0
how thats solved it for you - WHY are you turning A into B with text()
just format A to the display you want ?
 
Upvote 0
how thats solved it for you - WHY are you turning A into B with text()
just format A to the display you want ?
Well, I'm familiar with a few things in excel, but as you know, newbs make things a lot more difficult than it has to be. That's what I did here. Check column C's formula and you'll see why I did that. Just playing with stuff I guess. And I thought it was solved after using column A like you suggested.
 
Upvote 0
ok, everyone starts somewhere :)
anyway
if you just want to show the day of the month
=DAY()

and use a custom format
0#

Coco Lotto Master Tracker.xlsx
ABCD
1SEPTotal # of Entries
24553609/01/2024019
34553709/02/20240211
44553809/03/20240311
54553909/04/20240411
64554009/05/20240511
74554109/06/20240611
84554209/07/20240711
94554309/08/20240811
104554409/09/202409 
114554509/10/202410 
124554609/11/202411 
134554709/12/202412 
144554809/13/202413#VALUE!
154554909/14/202414#VALUE!
Monthly Entry Report 9-24
Cell Formulas
RangeFormula
B2:B15B2=TEXT(A2,"mm/dd/yyyy")
C2:C15C2=DAY(A2)
D3:D15D3=IF(TODAY()>=DATEVALUE(B3),IF(COUNTA($L$2:$L$31)<=0,"",COUNTA($L$2:$L$31)),"")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D2:G31Expression=AND($B2<>"",$B2<TODAY(),$D2>0)textNO
 
Upvote 0
ok, everyone starts somewhere :)
anyway
if you just want to show the day of the month
=DAY()

and use a custom format
0#

Coco Lotto Master Tracker.xlsx
ABCD
1SEPTotal # of Entries
24553609/01/2024019
34553709/02/20240211
44553809/03/20240311
54553909/04/20240411
64554009/05/20240511
74554109/06/20240611
84554209/07/20240711
94554309/08/20240811
104554409/09/202409 
114554509/10/202410 
124554609/11/202411 
134554709/12/202412 
144554809/13/202413#VALUE!
154554909/14/202414#VALUE!
Monthly Entry Report 9-24
Cell Formulas
RangeFormula
B2:B15B2=TEXT(A2,"mm/dd/yyyy")
C2:C15C2=DAY(A2)
D3:D15D3=IF(TODAY()>=DATEVALUE(B3),IF(COUNTA($L$2:$L$31)<=0,"",COUNTA($L$2:$L$31)),"")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D2:G31Expression=AND($B2<>"",$B2<TODAY(),$D2>0)textNO
CellConditionCell FormatStop If True
D2:G31Expression=AND($B2<>"",$B2<TODAY(),$D2>0)textNO

After changing the CF to this, nothing highlights. I'm just confused. I'll post link to show what I have. I'm not sure how to use the built in feature here. Permissions got denied when I tried. Coco Lotto Master Tracker.xlsx
 
Upvote 0
why change to
=AND($B2<>"",$B2<TODAY(),$D2>0)
that was the original suggestion , BUT column B is text
=TEXT(A2,"mm/dd/yyyy")
based on the real date in A2
so as mentioned try using A instead of B
=AND($A2<>"",$A2<TODAY(),$D2>0)
 
Upvote 0
why change to
=AND($B2<>"",$B2<TODAY(),$D2>0)
that was the original suggestion , BUT column B is text
=TEXT(A2,"mm/dd/yyyy")
based on the real date in A2
so as mentioned try using A instead of B
=AND($A2<>"",$A2<TODAY(),$D2>0)
Etaf, so your formula works great. However I have a problem with a particular row where the conditional formatting simply refuses to work. Can you take another look at my worksheet and see if you can spot the problem? It is Row 3, D3:G3

 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,173
Members
451,543
Latest member
cesymcox

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