ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Excel - Negative nested if then conditions (https://www.excelbanter.com/excel-discussion-misc-queries/255509-excel-negative-nested-if-then-conditions.html)

TTB

Excel - Negative nested if then conditions
 
Help, my formulas does not seem to calculate negative numbers. If a= 91 then
result is 30 days.

=if(a<-90,"-90days",if(a<-60,"-60days","30 days"))
--
TTB Thanks!

rzink

Excel - Negative nested if then conditions
 
TTB,

You need to give the formula a complete cell reference A1, or A2, not just A.

=if(a1<-90,"-90days",if(a1<-60,"-60days","30 days"))

Also if you want -90 to return "-90days", and -60 to return "-60days", then
you will need to replace "<" with "<=" like this:

=if(a<=-90,"-90days",if(a<=-60,"-60days","30 days"))

Hope this helps.

Ryan

"TTB" wrote:

Help, my formulas does not seem to calculate negative numbers. If a= 91 then
result is 30 days.

=if(a<-90,"-90days",if(a<-60,"-60days","30 days"))
--
TTB Thanks!


David Biddulph[_2_]

Excel - Negative nested if then conditions
 
That's correct.
91<-90 is false
91<-60 is false
"30 days" is the correct answer from the formula.

If a were -91 you would get "-90days"
If a were -61 or -89 you would get "-60days"
--
David Biddulph

TTB wrote:
Help, my formulas does not seem to calculate negative numbers. If a=
91 then result is 30 days.

=if(a<-90,"-90days",if(a<-60,"-60days","30 days"))





All times are GMT +1. The time now is 02:07 AM.

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