Link to home
Start Free TrialLog in
Avatar of pdvsa
pdvsaFlag for United States of America

asked on

Shade a cell based on date range

Hello,

I need to shade a cell based on a date range.  I tried to use the Conditional Formatting "between" but I am not getting it right.  

Example:  
I have 3 columns:  Margin Rate; From Date; To Date

I need to color "Margin Rate" if today's date is between the "From Date" and "To Date".

Please see attached example

thank you
EE_ConditionalFormat.xlsx
ASKER CERTIFIED SOLUTION
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Let's say Margin Rate is Column A, From Date is Column B, To Date is Column C. You actually have 2 conditions to be tested.

1. Is Today > Column B (from date)
2. Is Today < Column C (to date)

Create a new rule for the first condition: =TODAY()>B1
Add a second rule for the second condition: =TODAY()<C1

You can make the formatting for both rules the same or you can make the formatting for the first rule green and the second rule red. The red would indicate that today's date does not fall within the time window.
Avatar of pdvsa

ASKER

worked perfectly.  thank you!