Solved

Conditional formatting in Excel for dates older than 2 weeks

Posted on 2011-09-16
8
390 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

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
 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
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…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

860 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