Solved

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

Posted on 2016-09-16
8
772 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 20

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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
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 20

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 33

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 20

Expert Comment

by:Roy_Cox
ID: 41812669
Hi Chris

Pleased to help
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

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…
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

691 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