Solved

Conditional formatting in Excel for dates older than 2 weeks

Posted on 2011-09-16
8
332 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:teylyn
Comment Utility
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:teylyn
Comment Utility
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
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 50

Assisted Solution

by:teylyn
teylyn earned 250 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Many thanks for the speed of your help
0
 
LVL 19

Expert Comment

by:akoster
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
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…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

744 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

16 Experts available now in Live!

Get 1:1 Help Now