View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Can I use "In" in an "If" statement?

I would think you'd want an exact match:
=IF(ISERROR(MATCH(A2,L1:L4,0)), "y", "n")

or alternatively:
=IF(ISnumber(MATCH(A2,L1:L4,0)), "n", "y")




Bearacade wrote:

You can save 4 characters by doing this...

=IF(OR($A2="benchmark",$A2="benchmark folder",$A2="physical
name",$A2="label part"), "n", "y")

it doesn't check for case, so you don't have to cap the first
letter...

The other thing you can do is make a table of what you are checking, I
put it in L1:L4

=IF(ISERROR(MATCH(A2,L1:L4)), "y", "n")

--
Bearacade

------------------------------------------------------------------------
Bearacade's Profile: http://www.excelforum.com/member.php...o&userid=35016
View this thread: http://www.excelforum.com/showthread...hreadid=557100


--

Dave Peterson