Solved

Conditional formatting in Excel for dates older than 2 weeks

Posted on 2011-09-16
8
334 Views
Last Modified: 2012-05-12
Hi, i have an Excel document that is used to record dates that of maintenance, backups etc.
I would like to apply conditional formatting to cells that contain a date that is older than then the "Todays" date by 2 weeks plus by highlighting those cells in a different colour.
I can see an option where you can manually enter "Format cells that are Greater than date", but i dont want to have to keep manually changing this date, i guess there is an option for it to look at the PC's current date and highlight any cell that is older by more than 2 weeks
regards
Rick
0
Comment
Question by:Rick_Penney
  • 3
  • 3
  • 2
8 Comments
 
LVL 50

Expert Comment

by:Ingeborg Hawighorst
ID: 36548184
Hello,

if A1 has a date, then select A1 and create a conditional format with New Rule > Use a Formula to determine ...

Enter this formula

=A1>=today()+14

Select a format and hit OK.

cheers, teylyn
0
 
LVL 50

Expert Comment

by:Ingeborg Hawighorst
ID: 36548189
If A2 and below also have dates, you can then copy A1 and use Paste Special > Formats to copy the same format to the cells below. Since the conditional formula contains a relative reference, the next row down will check A2, the next one A3, and so on.

cheers, teylyn
0
 
LVL 19

Accepted Solution

by:
akoster earned 250 total points
ID: 36548216
Standard conditional formatting date options are :

today / yesterday / tomorrow
last 7 days
previous week / this week / next week
previous month / this month / next month

this does not fit the 2 weeks so a different approach is needed : using a formula.
you could use the formula

= (A1 < Today() - 14)

assuming that the dates are placed in column A. Otherwise, replace A1 with the first cell in the selection containing the dates.
0
 

Author Comment

by:Rick_Penney
ID: 36548251
Hi
many thanks to both of you for your quick replies and help, sorry teylyn , i couldn't get your formula to work, i wasn't adding any spaces so maybe that was why.
Thank you akoster, your formula works perfectly. is it possible to apply this to multiple cells in one go rather than doing this for each cell individually?
thank you
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 50

Assisted Solution

by:Ingeborg Hawighorst
Ingeborg Hawighorst earned 250 total points
ID: 36548283
The difference between akoster's formula and mine is the operator after today()

You said

>>  "Todays" date by 2 weeks plus

So I assumed "today plus two weeks"

=A1>=today()+14

akoster interpreted it as "today minus two weeks"

= (A1 < Today() - 14)

The brackets and the spaces do not make a difference.

A clear definition of what you want to compare A1 with would have.

cheers,
0
 

Author Comment

by:Rick_Penney
ID: 36548311
ok, thanks for the explanation, i did put (contain a date that is older than), anyway,
i'll increase the points to 500 and split it between you.
hope thats ok
regards
Rick
0
 

Author Closing Comment

by:Rick_Penney
ID: 36548318
Many thanks for the speed of your help
0
 
LVL 19

Expert Comment

by:akoster
ID: 36548390
You're welcome...

You can select the complete column A (or a range from A1 to let's say A22), select conditional formatting, enter the formula, and the complete selection will be conditionally formatted on each different cell.

So it's not like the whole column will be colored when cell A1 changes to a date in last year.


0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now