help with IF function

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
 
F

Frank Kabel

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"))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top