Colorize IF Within 5 Days Prior to Cell's Value

ChrisOK

Well-known Member
Joined
Mar 26, 2003
Messages
601
Preferably looking for a formula to drop into Conditional Formatting - but okay if you have a better VBA option...

QUESTION:
What would be the best way to colorize a cell or range of cells if it's within 5 increments prior of the cell's content.

ie: cell A1 has a "15" in it (meaning due date is the 15th of the month )
I'd like that cell to turn "RED" if we are within 5 days of the 15 of the month...
Once the 15th is past - no colorization needed.

( it would need to look at the computer's calendar and know TRUE or FALSE and colorize if True )

Any quick ideas?
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
ChrisOK said:
Preferably looking for a formula to drop into Conditional Formatting - but okay if you have a better VBA option...

QUESTION:
What would be the best way to colorize a cell or range of cells if it's within 5 increments prior of the cell's content.

ie: cell A1 has a "15" in it (meaning due date is the 15th of the month )
I'd like that cell to turn "RED" if we are within 5 days of the 15 of the month...
Once the 15th is past - no colorization needed.

( it would need to look at the computer's calendar and know TRUE or FALSE and colorize if True )

Any quick ideas?

Well you wanted a quick one Chris,

=DAY(TODAY())=A1

Where A1 houses a number. Adjust the less than or greater than....
 
Upvote 0
ChrisOK said:
Thanks for your expeditious help!

Okay, I opened up A1, conditional format, chose formula, pasted the formula in there --- and plugged in a "-5" on the end, within the parens, etc -- trying to figure out where to define that variable and get it to work within the supplied function?

Can you elaborate?

Chris,

Maybe something like this....

=(Day(Today())-A1) > 15

I got some real world work to finish, I'll check back later
 
Upvote 0
I thought I had it working --- but thought wrong --

It should change color if today is within 5 of the cell contents:
Since today is Feb 9th, only the ones with an X by them would turn color:

1
3
5 X
7 X
9 X
12
25
30

9,8,7,6,5 would be the contents it would look for before turning color

If today was the 25th of the month, only the cell that shows "25" in the above list would light up....because 12 is more than 5 away and 30 is BEYOND today's date -- so it's not applicable....

?
 
Upvote 0

Forum statistics

Threads
1,203,453
Messages
6,055,530
Members
444,794
Latest member
HSAL

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