ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I use the IF function to calculate date (https://www.excelbanter.com/excel-discussion-misc-queries/1703-how-do-i-use-if-function-calculate-date.html)

Pulling My Hair Out!

How do I use the IF function to calculate date
 
I am creating a statement form. I need it to take the date of each item on
the statement and calculate whether that item is less than 30 days, 31-60
days pastdue, 61-90 days past due, and finally over 90 days past due.
Depending on the out come of the value, I would like the amount of each item
placed into the appropriate box (current, 1-30 days past due, etc...)
Wow, upon reading the above, I think I've managed to confuse my self!

Peo Sjoblom

=IF(AND(TODAY()-A1<31,TODAY()A1),"Less than or equal to
30",IF(AND(TODAY()-A130,TODAY()-A1<61),"Between 31 and 60
days",IF(AND(TODAY()-A160,TODAY()-A1<91),"Between 61 and 90
days",IF(TODAY()-A190,"more than 90 past","Not past"))))

or better

=IF(TODAY()A1,VLOOKUP(TODAY()-A1,{0,"Less than or equal to 30";31,"Between
31 and 60";61,"Between 61 and 90";91,"Over 90"},2),"Not past due")

Regards,

Peo Sjoblom

"Pulling My Hair Out!" wrote:

I am creating a statement form. I need it to take the date of each item on
the statement and calculate whether that item is less than 30 days, 31-60
days pastdue, 61-90 days past due, and finally over 90 days past due.
Depending on the out come of the value, I would like the amount of each item
placed into the appropriate box (current, 1-30 days past due, etc...)
Wow, upon reading the above, I think I've managed to confuse my self!



All times are GMT +1. The time now is 11:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com