ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Formula HELp (https://www.excelbanter.com/excel-worksheet-functions/177309-formula-help.html)

DP7

Formula HELp
 
Why does the below formula not work? Any help would be greatly appreciated.
Thanks
=IF(AND(AN10="AIR",AX10="Fri"),AH10+3,IF(AND(AN10= "AIR",AX10="Sat"),AH10+2,IF(AND(AN10="AIR",OR(AX10 ="Mon",AX10="Tue",AX10="Wed",AX10="Thu",AX10="Sun" )),AH10+1,IF(AX10="Mon",AH10+4,IF(AX10="Tue",AH10+ 6,IF(AX10="thu",AH10+5,IF(AX10="fri",AH10+5,IF(AX1 0="sun",AH10+5,IF(AX10="Will advise",AX10,"")))))))))

David Biddulph[_2_]

Formula HELp
 
Which version of Excel? If before 2007, I guess your problem is too many
layers of nesting.

Try to rearrange to reduce the nesting depth, such as
=IF(AN10="AIR",IF(AX10="Fri",AH10+3,IF(AX10="Sat", AH10+2,IF(OR(AX10="Mon",AX10="Tue",AX10="Wed",AX10 ="Thu",AX10="Sun"),AH10+1,""))),IF(AX10="Mon",AH10 +4,IF(AX10="Tue",AH10+6,IF(AX10="thu",AH10+5,IF(AX 10="fri",AH10+5,IF(AX10="sun",AH10+5,IF(AX10="Wil l
advise",AX10,"")))))))
or go another stage to
=IF(AN10="AIR",IF(AX10="Fri",AH10+3,IF(AX10="Sat", AH10+2,IF(OR(AX10="Mon",AX10="Tue",AX10="Wed",AX10 ="Thu",AX10="Sun"),AH10+1,""))),IF(AX10="Mon",AH10 +4,IF(AX10="Tue",AH10+6,IF(OR(AX10="thu",AX10="fri ",AX10="sun"),AH10+5,IF(AX10="Will
advise",AX10,"")))))

[With either of these, as in your original, it doesn't specifically cover
"Wed" or "Sat" if AN10 is not "AIR", so presumably this is intended to
return a blank result?]

An alternative approach for reducing nesting depth is to use a LOOKUP
instead of nested IFs.
--
David Biddulph

"DP7" wrote in message
...
Why does the below formula not work? Any help would be greatly
appreciated.
Thanks
=IF(AND(AN10="AIR",AX10="Fri"),AH10+3,IF(AND(AN10= "AIR",AX10="Sat"),AH10+2,IF(AND(AN10="AIR",OR(AX10 ="Mon",AX10="Tue",AX10="Wed",AX10="Thu",AX10="Sun" )),AH10+1,IF(AX10="Mon",AH10+4,IF(AX10="Tue",AH10+ 6,IF(AX10="thu",AH10+5,IF(AX10="fri",AH10+5,IF(AX1 0="sun",AH10+5,IF(AX10="Will
advise",AX10,"")))))))))





All times are GMT +1. The time now is 04:56 PM.

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