How to match against multiple value possiblities in Excel

Posted by Henno on Super User See other posts from Super User or by Henno
Published on 2012-03-18T14:47:26Z Indexed on 2012/03/18 18:04 UTC
Read the original article Hit count: 166

Filed under:

I have list of person names in column A.

I want to display "1" in column B for names which end with either "e" or "i" or "n".

If there would be only one match to test against, I would write something like:

=IF( MID(A1,FIND(" ",B1)-1,1) = "e", "1", "0")

In PHP I would solve that like this:

echo in_array( $names[$row_number], array('e', 'i', 'n') ) ? '1' : '0';

What formula should I use in column B in Excel?

© Super User or respective owner

Related posts about microsoft-excel