In short, if one wanted to make an IF switch
a) if A < 0.5 ... B = 10.
b) if A >= 0.5 ... B = 15.
c) if A > 1.0 ... B = 20.
How would one go about that?
|
In short, if one wanted to make an IF switch a) if A < 0.5 ... B = 10. How would one go about that? |
|||||
|
|
This will work as a SWITCH function:-
But this is internally doing Nested IF. Best Way to use 3 way switch is as follows:-
|
|||
|
|
|
You can nest "if" expressions like this:
(I added A1<=1 otherwise because A>1.0 implies A also >= 0.5) |
|||
|
|
|
Have a look here if this link helps A typical switch function would look like,
|
|||
|
|
|
If is the easiest way to do this. A more flexible method to calculate is to exploit Excel's use of True=1. Assuming the value is in A1:
This will allow you to add any number of conditions and will get you out of the nested IFs. This works because in each grouping the evaluation is a logic function returning True or False, ie The above example I've put in isn't exactly correct, some numbers will generate True for two different groups. The middle group would need an
|
|||
|
|