Conditional Formatting

jackb270193

New Member
Joined
May 27, 2016
Messages
1
Hi There,

I am struggling to conditional format a cell to change colour based on comparing two dates against one another and against a time frame, for example:

Cell A1 Reads 27/01/2016
Cell A2 Reads 10/02/2016

I then want Cell A3 to change colour based on the below information:-

If Cell A2 is greater than Cell A1 by OVER 19 days then the cell will change Red
If Cell A2 is greater than Cell A1 by OVER 15 -18 days then the cell will go Amber
If Cell A2 is greater than Cell A1 by 15 or less days then the cell will go green

The above example, Cell A3 should go green because 10/02/2016 is less then 15 days older than 27/01/2016 if you understand.

I hope this makes sense.

Thanks!
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
=IF(A2-A1>19,"True")
=IF(AND(A2-A1>15,A2-A1<=19,"True")
=IF(A2-A1<=15,"True")

Try using these 3 formulas. This is not tested.
 
Upvote 0
63falcondude when using CF, it only ever evaluates to TRUE or FALSE, so you just need to construct the rule based on that (don't need the IF)

1. highlight the range you want to apply the conditional formatting to
2. on the home tab, styles, select CF
3. select new rule, select use formula
4. enter =A2-A1>19...format fill RED

Repeat 3 and 4 with...
=A2-A1>15 format fill Amber

and
=A2-A1<=15 format fill GREEN

If you enter them in that order/sequence, you wont need the AND part

Also, if you are OK with this, if you format the cell to green using regular formatting, you can do away with the last rule
 
Upvote 0

Forum statistics

Threads
1,216,588
Messages
6,131,589
Members
449,657
Latest member
Timber5

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top