Solved

Excel Conditional formatting looking for date - 30 days change cell color

Posted on 2016-09-16
8
205 Views
Last Modified: 2016-09-23
Hi Experts,
I need a conditional format that will change a cell to yellow if the date is 30 or 60 or 90 days before today's date.,

Example, I have a column of expiry dates, (actually multiple columns but I will just copy to others later), I need to change cell color to when date is about to expire.

If cell's date is expiring 30 days from today or already expired then turn cell yellow.
That's it.
Thanks

If I could use a cell to dictate the 30 - 60 - 90 in the formula that would be awesome.
Thanks
Chris
0
Comment
Question by:chris pike
8 Comments
 
LVL 31

Expert Comment

by:Helen_Feddema
ID: 41801765
Can you be more precise?  When you say "the date is 30 or 60 or 90 days before today's date", do you mean exactly 30, or 60, or 90 days, or (say) 30 - 59, 60 - 89, or 90+ days?  Do you want different colors for each date or date range?  Later  you say just yellow for expiring 30 days from today.
0
 
LVL 18

Assisted Solution

by:Roy_Cox
Roy_Cox earned 125 total points
ID: 41801852
Hi Chris

Select the cell and select Conditional Formatting in the Ribbon

Screenshot-2016-09-16-17.00.52.png
Then Manage Rules and New Rule

Screenshot-2016-09-16-17.03.35.png
When the New Formatting Rule window appears, select Format only cells that contain as the rule type.
You can apply multiple formulas as required and formats.
Screenshot-2016-09-16-17.06.04.png
Enter the formula and choose the Format

The next step is to enter the range for the format to apply to

Screenshot-2016-09-16-17.09.50.png
Remember that using a Table for the data then the range becomes dynamic and the Conditional Formatting expand as data is added or contract as data is removed.

Let me know if anything is not clear.
0
 

Author Comment

by:chris pike
ID: 41801963
Hi Roy, Again.... :)
I changed it a little bit, I did Less than and then +30 days, it highlights anything almost expired or already expired.

How do i ignore blank cells, as above instructions highlights the blank cells, or do I need a second conditional format?
Thanks
0
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.

 
LVL 27

Accepted Solution

by:
Glenn Ray earned 250 total points
ID: 41802347
You can use a formula instead of a value comparison (as in above examples) to check for blank cells and ignore conditional formatting.

I've expanded on your question by creating an example workbook that applies three levels of conditional formatting:
Red: if Expiry Date is 90+ days old
Orange: if Expiry Date is 60+ days old
Yellow: if Expiry Date is less than or equal to 30 days from today's date

The rule are applied in the order stated above; if the first condition is true, the conditional formatting stops there, otherwise, it continues down the list.
EE-CondFormat.png
The rules are:
Red:  =IF(AND(A2<>"",A2<=TODAY()-90),TRUE,FALSE)
Orange: =IF(AND(A2<>"",A2<=TODAY()-60),TRUE,FALSE)
Yellow: =IF(AND(A2<>"",A2<=TODAY()+30),TRUE,FALSE)

Note that the formulas use relative referencing (A2, not $A$2) so that you can just expand the range to which is applies and still have the formatting work.

My example also has an aging column to the right as a check to ensure that the proper formatting applies.

Regards,
-Glenn
EE-CondFormat.xlsx
0
 
LVL 18

Expert Comment

by:Roy_Cox
ID: 41802721
My Method still works, just add the other rules

Screenshot-2016-09-17-10.00.04.png
0
 
LVL 32

Assisted Solution

by:Rob Henson
Rob Henson earned 125 total points
ID: 41804422
@Roy - using your method doesn't allow for blanks

@Glenn - don't need the IF statement, the Conditional Formatting is checking for a TRUE statement to apply the format, formula can be just:

=AND(A2<>"",A2>TODAY()+30)

Thanks
Rob
0
 

Author Closing Comment

by:chris pike
ID: 41812609
Thanks Everyone.
Got it done.
Good work.
0
 
LVL 18

Expert Comment

by:Roy_Cox
ID: 41812669
Hi Chris

Pleased to help
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
round down to max number 11 32
Excel VBA 10 38
Excel formula Sumif not working 4 26
Msgbox tickler 7 18
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

813 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

11 Experts available now in Live!

Get 1:1 Help Now