help with IF function

  • Thread starter Thread starter nh786
  • Start date Start date
N

nh786

In VB we can use the function

if A1 IN ("f","z",r") then "Flexible" else if A1 IN ("S", "Q") the
....etc

Do we have a similar syntax in excel to avoid a very complex and neste
IF statements. How can we use this IN function? And if IN is no
supported then can I achieve similar results using some other functio
like OR etc.

Thanks in advanc
 
Hi
one way:
=IF(OR(A1="f",A1="z",A1="r"),"Flexible",IF(OR(A1="S",A1="Q"),"etc.","so
mething else"))

or try
=IF(SUM(COUNTIF(A1,{"f","z","r"})),"Flexibile",IF(SUM(COUNTIF(A1,{"S","
Q"})),"etc.","something else"))
 
Back
Top