Formula based on days

JoeExcelHelp
5StarLounger
Posts: 1177
Joined: 22 Jul 2013, 18:29

Formula based on days

Post by JoeExcelHelp »

Help please

Trying to get this formula to number of days

Code: Select all

=-(IF(AE14<Today()+E3),0,IF(AND(AE133<=AD133,AE133<=MIN(INDEX(($G14:AD14>Today()+E3))*($G133:AD133),))),-(AE133-MIN(INDEX(($G14:AD14>Today()+E3))*($G133:AD133),))),IF(OR(AD133="",AD133=0),IF(AE133>MIN(INDEX(($G14:AD14>Today()+E3))*($G133:AD133),)),0,AE133),0))))
Currently its considering months

Code: Select all

=-(IF(AE14<EOMONTH(TODAY(),$E$3/30-1),0,IF(AND(AE133<=AD133,AE133<=MIN(INDEX(($G14:AD14>EOMONTH(TODAY(),$E$3/30-1))*($G133:AD133),))),-(AE133-MIN(INDEX(($G14:AD14>EOMONTH(TODAY(),$E$3/30-1))*($G133:AD133),))),IF(OR(AD133="",AD133=0),IF(AE133>MIN(INDEX(($G14:AD14>EOMONTH(TODAY(),$E$3/30-1))*($G133:AD133),)),0,AE133),0))))

JoeExcelHelp
5StarLounger
Posts: 1177
Joined: 22 Jul 2013, 18:29

Re: Formula based on days

Post by JoeExcelHelp »

This first formula keeps highlighting E3 as the problem.. just cant figure out why it doesnt work.. also E3 is a number of day example 50

User avatar
HansV
Administrator
Posts: 78631
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Formula based on days

Post by HansV »

There shouldn't be a ) after E3. Try

=-(IF(AE14<TODAY()+$E$3,0,IF(AND(AE133<=AD133,AE133<=MIN(INDEX(($G14:AD14>TODAY()+$E$3)*($G133:AD133),))),-(AE133-MIN(INDEX(($G14:AD14>TODAY()+$E$3)*($G133:AD133),))),IF(OR(AD133="",AD133=0),IF(AE133>MIN(INDEX(($G14:AD14>TODAY()+$E$3)*($G133:AD133),)),0,AE133),0))))
Best wishes,
Hans

JoeExcelHelp
5StarLounger
Posts: 1177
Joined: 22 Jul 2013, 18:29

Re: Formula based on days

Post by JoeExcelHelp »

Very silly mistake :).. Thank You Hans