Multiple IF Functions

C

Confused

I'm new at this and am trying to put several different, unrelated IF formulas into a single cell but am having trouble with it. How do you differentiate between one formula and the next, but still have it in the same cell
Is there a limit to the number of IF formulas you can put in one cell? If so, how many?
 
A

Andy B

Hi

There is a limit of 7 nested IFs in a cell.
A simple multiple IF scenario could be:
=IF(A1<5,"under 5",IF(A1>5,"over 5","5"))
This checks the value in A1 and gives the result in text. If the first IF
returns FALSE, it continues into the next IF etc.

--
Andy.


Confused said:
I'm new at this and am trying to put several different, unrelated IF
formulas into a single cell but am having trouble with it. How do you
differentiate between one formula and the next, but still have it in the
same cell?
Is there a limit to the number of IF formulas you can put in one cell? If
so, how many?
 
M

MikeM

You're probably used to seeing If statements with the following structure or something simila
If condition the
execute if tru
els
execute if fals

The If statement in excel looks like the following
if(condition, execute if true, execute if false

If you want to add multiple unrelated if statements into a single cell then simply put them in one after another. However, you must somehow link the two if statements together with concatenation or math operator.
Example
=if(A1<5, 1, 0) & if(B1<5,1,0

if A1=2 and B1=3, then you would get "11
Here we concatenated 1 and 1 to get 11

If we change the formula to be..
=if(A1<5,1,0) + if(B1<5,1,0

if A1=2 and B1=3, then you would get "2
Here we added 1 and 1 to get 2.

To add more than one unrelated if statement insert them one after another, but make sure to link them somehow by concatenation or a mathematical operation.

Adding ifs this way there is no limit, but the formula length can only be a maximum 1,024 characters long.
 
Top