View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default use the OR function inside an IF function

I get Watermelon as expected. You don't have spaces in the cell at all?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Inbar" wrote in message
...
Thanks Paul,
It helped!
now when I combine this condition within a long and detailed IF condition.
it has a problem:


=IF(OR(B13=148,B13=149,B13=1501),"Mellon",IF(OR(B1 3=101,B13=102),"Watermelon
",IF(B13=184,"Squash",IF(OR(B13=153,B13=154),"Cucu mber",IF(OR(B13=173,B13=17
4,B13=175),"Peper",IF(OR(B13=163,B13=164,B13=165,B 13=166),"Tomato","N/A"))))
))

the result I'm getting is "N/A" although the cell value is 101. maybe you
see the problem?

"Paul Mathews" wrote:

=IF(OR(B18=148,B18=150),"A","B")

"Inbar" wrote:

Hi,

I am trying to use the OR function within an IF condition.
when I use each function seperatly, it works fine. but both functions
together always return the value of "B" - as false result, even when

the
requested cell holds one of the true values.

for example:
=IF(B18=OR(148,150),"A","B")