![]() |
How to express this in an if statement.
I hope someone might be able to show me how to express the following in an IF
statement. =if(a1 is between 0 and 3 then "low", if(a1 is between 4 and 6 then "medium", if(a1 is between 7 and 10 then "high", if(a110 then "extreme", "") -- Thanks Kevin |
One way:
If one can assume that there will be no numbers < 0, and that all numbers are integers: =LOOKUP(A1,{0,4,7,11},{"low","medium","high","extr eme"}) (otherwise, you need to specify what happens for negative numbers and non-integers, like 6.5) As an IF() statement: Strictly: =IF(AND(A1=0,A1<=3),"low",IF(AND(A1=4,A1<=6),"me dium", IF(AND(A1=7,A1<=10),"high",IF(A110,"extreme","so mething else")))) or, using the above assumptions: =IF(A1<=3,"low",IF(A1<=6,"medium",IF(A1<=10,"high" ,"extreme"))) In article , "kevin" wrote: I hope someone might be able to show me how to express the following in an IF statement. =if(a1 is between 0 and 3 then "low", if(a1 is between 4 and 6 then "medium", if(a1 is between 7 and 10 then "high", if(a110 then "extreme", "") |
Hi Kevin,
You don't tell what it has to be if A1<0, what if it is 3.5, etc, but this may help: =IF(A1<4,"low",IF(A1<7,"medium",IF(A1<11,"high","e xtreme"))) -- Kind Regards, Niek Otten Microsoft MVP - Excel "kevin" wrote in message ... I hope someone might be able to show me how to express the following in an IF statement. =if(a1 is between 0 and 3 then "low", if(a1 is between 4 and 6 then "medium", if(a1 is between 7 and 10 then "high", if(a110 then "extreme", "") -- Thanks Kevin |
Thanks very much for your help, works great.
"Niek Otten" wrote: Hi Kevin, You don't tell what it has to be if A1<0, what if it is 3.5, etc, but this may help: =IF(A1<4,"low",IF(A1<7,"medium",IF(A1<11,"high","e xtreme"))) -- Kind Regards, Niek Otten Microsoft MVP - Excel "kevin" wrote in message ... I hope someone might be able to show me how to express the following in an IF statement. =if(a1 is between 0 and 3 then "low", if(a1 is between 4 and 6 then "medium", if(a1 is between 7 and 10 then "high", if(a110 then "extreme", "") -- Thanks Kevin |
All times are GMT +1. The time now is 07:01 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com