Solved

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

Posted on 2016-09-16
8
477 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 19

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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 19

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 19

Expert Comment

by:Roy_Cox
ID: 41812669
Hi Chris

Pleased to help
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Question has a verified solution.

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

733 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