Conditional format formula

Sherlock794

New Member
Joined
Jul 18, 2021
Messages
5
Office Version
  1. 2016
Platform
  1. Windows
I have a report that lists stock orders and a date required column. I would like to add a condition format that reads looks at the date required date, minus today. End state I would like to apply the condition format to the corresponding stock code, if it is due in more that 14 days (green), between 14 and 0 days (amber) and if it is passed the date (0) required then (red).
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Hi Sherlock794,

Try this:

Sherlock794.xlsx
ABC
1
2
3Stock CodeDate Required
4XYZ00130-Jun-21
5XYZ00212-Jul-21
6XYZ00324-Jul-21
7XYZ00405-Aug-21
8XYZ00517-Aug-21
9XYZ00629-Aug-21
10XYZ00710-Sep-21
11XYZ00812-Jul-21
12XYZ00925-Jul-21
13XYZ01003-Aug-21
14XYZ01112-Aug-21
15
16
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B4:B9999Expression=AND(C4-TODAY()<0,C4<>"")textNO
B4:B9999Expression=AND(C4-TODAY()>=0,C4-TODAY()<=14)textNO
B4:B9999Expression=C4-TODAY()>14textNO
 
Upvote 0
Solution
Toadstool, this is just what I am looking to achieve. I will give it ago tomorrow, thank you.
 
Upvote 0
Hi Sherlock794,

Try this:

Sherlock794.xlsx
ABC
1
2
3Stock CodeDate Required
4XYZ00130-Jun-21
5XYZ00212-Jul-21
6XYZ00324-Jul-21
7XYZ00405-Aug-21
8XYZ00517-Aug-21
9XYZ00629-Aug-21
10XYZ00710-Sep-21
11XYZ00812-Jul-21
12XYZ00925-Jul-21
13XYZ01003-Aug-21
14XYZ01112-Aug-21
15
16
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B4:B9999Expression=AND(C4-TODAY()<0,C4<>"")textNO
B4:B9999Expression=AND(C4-TODAY()>=0,C4-TODAY()<=14)textNO
B4:B9999Expression=C4-TODAY()>14textNO

Hi Toadstool

Your solution is very close to what I am also looking but instead of days, how would you modify the expression to calculate based on month?

Regards

Declan
 
Upvote 0
Hi Declan,

You don't say exactly how you want to highlight the age so I'm using today to 3 months ago is green, over 3 months but less than 6 months ago is amber and over 6 months but less than 12 months is red.

DPBarry.xlsx
BC
3Stock CodeDate Required
4XYZ00109-Sep-20
5XYZ00220-Dec-20
6XYZ00323-Jan-21
7XYZ00426-Feb-21
8XYZ00505-May-21
9XYZ00608-Jun-21
10XYZ00710-Jul-21
11XYZ00813-Aug-21
12XYZ00916-Sep-21
13XYZ01010-Oct-21
14XYZ01113-Nov-21
1517-Dec-21
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B4:B18Expression=AND(EDATE(C4,6)<TODAY(),EDATE(C4,12)>=TODAY())textNO
B4:B18Expression=AND(EDATE(C4,3)<TODAY(),EDATE(C4,6)>=TODAY())textNO
B4:B18Expression=AND(EDATE(C4,0)<TODAY(),EDATE(C4,3)>=TODAY())textNO
 
Upvote 0
Hi Declan,

You don't say exactly how you want to highlight the age so I'm using today to 3 months ago is green, over 3 months but less than 6 months ago is amber and over 6 months but less than 12 months is red.

DPBarry.xlsx
BC
3Stock CodeDate Required
4XYZ00109-Sep-20
5XYZ00220-Dec-20
6XYZ00323-Jan-21
7XYZ00426-Feb-21
8XYZ00505-May-21
9XYZ00608-Jun-21
10XYZ00710-Jul-21
11XYZ00813-Aug-21
12XYZ00916-Sep-21
13XYZ01010-Oct-21
14XYZ01113-Nov-21
1517-Dec-21
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B4:B18Expression=AND(EDATE(C4,6)<TODAY(),EDATE(C4,12)>=TODAY())textNO
B4:B18Expression=AND(EDATE(C4,3)<TODAY(),EDATE(C4,6)>=TODAY())textNO
B4:B18Expression=AND(EDATE(C4,0)<TODAY(),EDATE(C4,3)>=TODAY())textNO
Cheers Toadstool

Works perfect

Regards

Declan
 
Upvote 0

Forum statistics

Threads
1,214,994
Messages
6,122,633
Members
449,092
Latest member
bsb1122

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