Thread: Using IF and OR
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Using IF and OR

One way:
=if(OR(K2={11,13,14,17,18,20,21,23}),1,0)

Another way without the =if()

=--OR(K2={11,13,14,17,18,20,21,23})

The =or() function returns True or False. The first - sign converts false to 0
and true to -1. The second - sign doesn't change the 0, and converts the -1 to
+1.



Dustin B wrote:

I am trying to use if and or statement together and cannot get the syntax
right. I know I must be missing something quite obvious here. What I am
trying to do is mark a cell with a 0 or 1 if cell K2 =
11,or13,or14,or17,or18,or20,or21,or23. Can someone throw me a bone on this
one? The help file in exel does not show syntax for using if and or together
and I guess that is what I am messing up.

Thanks.


--

Dave Peterson