Status based on a time frame

gregomel

New Member
Joined
Jun 28, 2004
Messages
9
Hello...

I have a query that pulls an issue date. It also pulls a column that says "Late" or "On-time". This pulls from a source that is older so late/on time status is based on 5 days. It is now based on 3 weeks. I would like for any record with a date in the past 3 weeks to say "3 weeks" in the status column. Everything else can be "late." Basically everything issued today (and anything issued in the past 3 weeks should say "3 weeks') everything else is late.

This is formula I'm currently working with is:

IIf([DWG/RDDP Issued to Supplier Date]>DateAdd("d",-21,Date()),"Late","3 weeks")

It worked at first but now is not working. Also, what is the appropriate location for this formula? I had it in the first criteria box but it then only worked if it was in the second one. Any suggestions?
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
The expression needs to go in the top row of the query grid, not the Criteria row. Also, you may find it useful to give the field a name for later use --
Code:
TimeStatus:IIf([DWG/RDDP Issued to Supplier Date]>DateAdd("d",-21,Date()),"Late","3 weeks")
Denis
 
Upvote 0

Forum statistics

Threads
1,221,877
Messages
6,162,579
Members
451,776
Latest member
bosvinn

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