if statement see "Men's/Mens/Men" or "Women's/Womens/Women" returning "Male or Female"

2.6k views Asked by At

I have a very basic question. thanks for helping.

if the cell contains "Men's/Mens/Men" or "Women's/Womens/Women" then returning "Male" or "Female"

why the following is not working? and i want to make sure it

=if(a1=(or("Men's/Mens/Men","Women's/Womens/Women"),"Male","Female")

for example:

Items                                                  Gender
O'Neill Women's Knot My Problem Tank Shirt             Female
O'Neill Womens Love VW Tank Shirt                      Female
O'Neill Women India Armor Tank Shirt                   Female
O'Neill Men's Knows All Tank Shirt                     Male
O'Neill Mens Jack O'Neill Hookipa Short-Sleeve Shirt   Male
O'Neill Men Welder Long-Sleeve Shirt                   Male

i know i can use two conditional statements to make this work, but is there a way to use just one if and use some other functions? say OR?

thank you.

2

There are 2 answers

0
m0r0dan On

Answered a number of times, i.e. here

In your case this should do the work:

=IF(SEARCH(a1="Men"),"Male","Female")

5
Tomasz Kuryło On

You are using "or" wrong.

If there are only 2 possible answers (male and female):

=if(or(a1="Men's";a1="Mens";a1="Men");"Male";"Female")

Other than that, I'd use nested Ifs