I'm trying to add multiple conditions in one cell
I'm doing this:
=SI(OU(A3=$A$1;A3>$A$1);"OK");SI(ET(A3<$A$1;B3<>0);"Nope");SI(OU(B3=0;B3="");"SO")
I don't understand where is my problem ?
Someone can explain me
CodePudding user response:
Every IF
statement needs a TRUE and FALSE value for a condition. Your parentheses are in the wrong spots; you have to nest the IFS like this:
=SI(OU(A3=$A$1;A3>$A$1);"OK";SI(ET(A3<$A$1;B3<>0);"Nope";SI(OU(B3=0;B3="");"SO";"Omelet du fromage")))
Or in English:
=IF(OR(A3=$A$1;A3>$A$1);"OK";IF(AND(A3<$A$1;B3<>0);"Nope";IF(OR(B3=0;B3="");"SO";"Omelet du fromage")))
CodePudding user response:
My first step would be to reduce the formula by not using the OR() (OU()) like so:
=if(A3>=A1,"OK","No")
CodePudding user response:
In case you are trying to add multiple conditions in an IF condition, I find that it helps to first write down the conditions and then replace them with the cell addresses to help simplify the placement of braces.
=IF (Condition 1, Output if True, Output if False)
For every additional condition check, you can add the same code in the respective output place and continue. By following this template you can easily solve this without getting any error involving parantheses.
Your rectified code should be:
=IF(OR(A3=$A$1,A3>$A$1),"OK",IF(AND(A3<$A$1,B3<>0),"Nope",IF(OR(B3=0;B3=""),"SO","Omelet du fromage")))