IIF Statment (Days Aged)

gpouliot

New Member
Joined
Jan 19, 2009
Messages
39
Hi,

I'm currently using DateDiff("d",[Tran_Date],Now()). What I'm trying to do now is create a category called "Days Aged Cat"

1-7 Days
7-14 Days
14-30 Days
30+ Days

I know I can use the IIF statement and I was able to to do the first one
IIF([Days]<=7,"1-7Days") but this is as far as I got. I'm not sure how to create the remainder of the string. I always get an error.

Thanks
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Just keep nesting your IIF statements.

But you first need to determine some definite end-points. If it is 7 days, where does it fall? In "1-7 days" or "7-14 days"?

Your final statement will look something like:

Code:
IIF([Days]<=7,"1-7 Days",IIF([Days]<=14,"8-14 Days",IIF([Days]<=30,"15-30 Days","30+ Days")))
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,739
Members
449,050
Latest member
excelknuckles

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