Conditional Formatting for Various Dates

GBCOACW

New Member
Joined
May 8, 2024
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I am trying to figure out formulas to create conditional formatting for dates that take into account the current date and its relation to future dates, and that are not limited to specific months, years, or number of days.
I would like these formulas to be able to carry over into future years without needing to be updated after a specific month or year has passed.
The dates are all within column C.
Specifically, I'm trying to create formulas to:
  • Highlight cell if a date is before the current date
  • Highlight cell if a date is within the current month
  • Highlight cell if a date is after the current month, but within the current year
  • Highlight cell if a date is any year after the current year
Many thanks!
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Welcome to the Board!

Looks like some sort of homework assignment.
Have a look here, which shows you how to use various methods to use dates in Conditional Formatting.

It should cover most of what you want, and after you see the methods being used, you might be able to figure out the rest.
Post back if you get stuck with any certain one.
 
Upvote 0
You might also want to think about adding a cell that has the current date in it. You can use the =TODAY() function in excel, but if you do that for all of your conditional formatting on a large number of cells, you will find that your spreadsheet slows down significantly as =TODAY() is a volatile function and will recalculate every time a volatile action is taken.
 
Upvote 0
You might also want to think about adding a cell that has the current date in it.
You mean hard-coded, right? To avoid the =TODAY() volatility?

If so, instead of manually updated that every day, they could use a Workbook_Open event procedure to automatically hard-code the value into the cell whenever the workbook is opened, i.e.
VBA Code:
Private Sub Workbook_Open()
    Sheets("Sheet1").Range("A1") = Date
End Sub
 
Upvote 0
You mean hard-coded, right? To avoid the =TODAY() volatility?

If so, instead of manually updated that every day, they could use a Workbook_Open event procedure to automatically hard-code the value into the cell whenever the workbook is opened, i.e.
VBA Code:
Private Sub Workbook_Open()
    Sheets("Sheet1").Range("A1") = Date
End Sub
exactly!
 
Upvote 0

Forum statistics

Threads
1,224,802
Messages
6,181,048
Members
453,014
Latest member
Chris258

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