Nested If - driving me crazy! Please Help!

wethernt

New Member
Joined
Jan 27, 2016
Messages
16
Can't figure out what I am doing wrong for the life of me... Yes, it long... trying to bucket dates into 8 different buckets as follows: 2013, 2014, >120days&YR15, 91-120, 61-90, 31-60, 1-30, Current Thanks for any help.

=IF([Invoice Due Date]<=DATEVALUE(12/31/2013),"2013",
IF([Invoice Due Date]<=DATEVALUE(12/31/2014),"2014",
IF(AND([Invoice Due Date]<=DATEVALUE(12/31/2015), [Invoice Due Date]<(TODAY()-120)),"120+YR15"),
IF(AND([Invoice Due Date]>=(TODAY()-119), [Invoice Due Date]<(TODAY()-90)),"91-120"),
IF(AND([Invoice Due Date]>=(TODAY()-90), [Invoice Due Date]<(TODAY()-60)),"61-90"),
IF(AND([Invoice Due Date]>=(TODAY()-60), [Invoice Due Date]<(TODAY()-30)),"31-60"),
IF(AND([Invoice Due Date]>=(TODAY()-30), [Invoice Due Date]<(TODAY()-1),"1-30")),
"Current"))
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Welcome to MrExcel.

This is syntactically correct, if that's what you want:

=IF([Invoice Due Date]<=DATEVALUE(12/31/2013),"2013",
IF([Invoice Due Date]<=DATEVALUE(12/31/2014),"2014",
IF(AND([Invoice Due Date]<=DATEVALUE(12/31/2015), [Invoice Due Date]<(TODAY()-120)),"120+YR15",
IF(AND([Invoice Due Date]>=(TODAY()-119), [Invoice Due Date]<(TODAY()-90)),"91-120",
IF(AND([Invoice Due Date]>=(TODAY()-90), [Invoice Due Date]<(TODAY()-60)),"61-90",
IF(AND([Invoice Due Date]>=(TODAY()-60), [Invoice Due Date]<(TODAY()-30)),"31-60",
IF(AND([Invoice Due Date]>=(TODAY()-30), [Invoice Due Date]<(TODAY()-1)),"1-30",
"Current")))))))
 
Upvote 0
Another ways, perhaps:

=LOOKUP(DueDate,
CHOOSE({1,2,3,4,5,6,7,8}, --"1/1/13", --"1/1/14", --"1/1/15", TODAY()-120, TODAY()-90, TODAY()-60, TODAY()-30, TODAY()),
{2013,2014,"121+","91-120","61-90","31-60","1-30","Current"})
 
Upvote 0
Welcome to MrExcel.

This is syntactically correct, if that's what you want:

=IF([Invoice Due Date]<=DATEVALUE(12/31/2013),"2013",
IF([Invoice Due Date]<=DATEVALUE(12/31/2014),"2014",
IF(AND([Invoice Due Date]<=DATEVALUE(12/31/2015), [Invoice Due Date]<(TODAY()-120)),"120+YR15",
IF(AND([Invoice Due Date]>=(TODAY()-119), [Invoice Due Date]<(TODAY()-90)),"91-120",
IF(AND([Invoice Due Date]>=(TODAY()-90), [Invoice Due Date]<(TODAY()-60)),"61-90",
IF(AND([Invoice Due Date]>=(TODAY()-60), [Invoice Due Date]<(TODAY()-30)),"31-60",
IF(AND([Invoice Due Date]>=(TODAY()-30), [Invoice Due Date]<(TODAY()-1)),"1-30",
"Current")))))))

Thanks for your assistance. Actually, new member forum error. I will move this to the Power BI forum. I am tyring to use the formula above in a powerpivot calculated column. Should work but still get type mismatch error. Thanks.
 
Upvote 0

Forum statistics

Threads
1,214,537
Messages
6,120,096
Members
448,944
Latest member
SarahSomethingExcel100

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