Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Inbar
 
Posts: n/a
Default use the OR function inside an IF function

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")
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Paul Mathews
 
Posts: n/a
Default use the OR function inside an IF function

=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")

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Inbar
 
Posts: n/a
Default use the OR function inside an IF function

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),"Cucumber",IF(OR(B13=173,B13= 174,B13=175),"Peper",IF(OR(B13=163,B13=164,B13=165 ,B13=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")

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Inbar
 
Posts: n/a
Default use the OR function inside an IF function

My Mistake:
The cell no was wrong.
So thanks for your help!

Inbar

"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")

  #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")





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Inbar
 
Posts: n/a
Default use the OR function inside an IF function

The column B8 does not recognize the value 101 because there is a condition
on the B8 column. when I remove the condition and simply write the vlaue 101,
the function works.

=IF(OR(B8=148,B8=149,B8=1501),"Mellon",IF(OR(B8=10 1,B8=102),"Watermelon",IF(B8=184,"Squash",IF(OR(B8 =153,B8=154),"Cucumber",IF(OR(B8=173,B8=174,B8=175 ),"Peper",IF(OR(B8=163,B8=164,B8=165,B8=166),"Toma to","N/A"))))))

any idea what to do?

"Inbar" wrote:

My Mistake:
The cell no was wrong.
So thanks for your help!

Inbar

"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")

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

What sort of condition?

--
HTH

Bob Phillips

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

"Inbar" wrote in message
...
The column B8 does not recognize the value 101 because there is a

condition
on the B8 column. when I remove the condition and simply write the vlaue

101,
the function works.


=IF(OR(B8=148,B8=149,B8=1501),"Mellon",IF(OR(B8=10 1,B8=102),"Watermelon",IF(
B8=184,"Squash",IF(OR(B8=153,B8=154),"Cucumber",IF (OR(B8=173,B8=174,B8=175),
"Peper",IF(OR(B8=163,B8=164,B8=165,B8=166),"Tomato ","N/A"))))))

any idea what to do?

"Inbar" wrote:

My Mistake:
The cell no was wrong.
So thanks for your help!

Inbar

"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")



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Inbar
 
Posts: n/a
Default use the OR function inside an IF function

=left(B7,3)

B8 holds this condition in order to cut the left 3 numbers from the value in
B7.

"Bob Phillips" wrote:

What sort of condition?

--
HTH

Bob Phillips

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

"Inbar" wrote in message
...
The column B8 does not recognize the value 101 because there is a

condition
on the B8 column. when I remove the condition and simply write the vlaue

101,
the function works.


=IF(OR(B8=148,B8=149,B8=1501),"Mellon",IF(OR(B8=10 1,B8=102),"Watermelon",IF(
B8=184,"Squash",IF(OR(B8=153,B8=154),"Cucumber",IF (OR(B8=173,B8=174,B8=175),
"Peper",IF(OR(B8=163,B8=164,B8=165,B8=166),"Tomato ","N/A"))))))

any idea what to do?

"Inbar" wrote:

My Mistake:
The cell no was wrong.
So thanks for your help!

Inbar

"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")




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

Change that to

=--LEFT(B7,3)

then

--
HTH

Bob Phillips

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

"Inbar" wrote in message
...
=left(B7,3)

B8 holds this condition in order to cut the left 3 numbers from the value

in
B7.

"Bob Phillips" wrote:

What sort of condition?

--
HTH

Bob Phillips

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

"Inbar" wrote in message
...
The column B8 does not recognize the value 101 because there is a

condition
on the B8 column. when I remove the condition and simply write the

vlaue
101,
the function works.



=IF(OR(B8=148,B8=149,B8=1501),"Mellon",IF(OR(B8=10 1,B8=102),"Watermelon",IF(

B8=184,"Squash",IF(OR(B8=153,B8=154),"Cucumber",IF (OR(B8=173,B8=174,B8=175),
"Peper",IF(OR(B8=163,B8=164,B8=165,B8=166),"Tomato ","N/A"))))))

any idea what to do?

"Inbar" wrote:

My Mistake:
The cell no was wrong.
So thanks for your help!

Inbar

"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")






  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
David Biddulph
 
Posts: n/a
Default use the OR function inside an IF function

I guess that your problem may be that
=left(B7,3) will return a text string, whereas your OR formula is looking
for the number 101.

I think you'll find that it will work if you use =VALUE(LEFT(B7,3))

David Biddulph

"Inbar" wrote in message
...
=left(B7,3)

B8 holds this condition in order to cut the left 3 numbers from the value
in
B7.

"Bob Phillips" wrote:

What sort of condition?

--
HTH

Bob Phillips

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

"Inbar" wrote in message
...
The column B8 does not recognize the value 101 because there is a

condition
on the B8 column. when I remove the condition and simply write the
vlaue

101,
the function works.


=IF(OR(B8=148,B8=149,B8=1501),"Mellon",IF(OR(B8=10 1,B8=102),"Watermelon",IF(
B8=184,"Squash",IF(OR(B8=153,B8=154),"Cucumber",IF (OR(B8=173,B8=174,B8=175),
"Peper",IF(OR(B8=163,B8=164,B8=165,B8=166),"Tomato ","N/A"))))))

any idea what to do?

"Inbar" wrote:

My Mistake:
The cell no was wrong.
So thanks for your help!

Inbar

"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")








  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Inbar
 
Posts: n/a
Default use the OR function inside an IF function

Well Done David!

its working now. thanks a lot.

inbar

"David Biddulph" wrote:

I guess that your problem may be that
=left(B7,3) will return a text string, whereas your OR formula is looking
for the number 101.

I think you'll find that it will work if you use =VALUE(LEFT(B7,3))

David Biddulph

"Inbar" wrote in message
...
=left(B7,3)

B8 holds this condition in order to cut the left 3 numbers from the value
in
B7.

"Bob Phillips" wrote:

What sort of condition?

--
HTH

Bob Phillips

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

"Inbar" wrote in message
...
The column B8 does not recognize the value 101 because there is a
condition
on the B8 column. when I remove the condition and simply write the
vlaue
101,
the function works.


=IF(OR(B8=148,B8=149,B8=1501),"Mellon",IF(OR(B8=10 1,B8=102),"Watermelon",IF(
B8=184,"Squash",IF(OR(B8=153,B8=154),"Cucumber",IF (OR(B8=173,B8=174,B8=175),
"Peper",IF(OR(B8=163,B8=164,B8=165,B8=166),"Tomato ","N/A"))))))

any idea what to do?

"Inbar" wrote:

My Mistake:
The cell no was wrong.
So thanks for your help!

Inbar

"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")






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I use a Reference inside a SUMIF or COUNTIF Function? Albie Excel Worksheet Functions 11 May 14th 10 04:26 PM
Date & Time mully New Users to Excel 4 May 23rd 05 11:56 AM
Hyperlinks using R[1]C[1] and offset function in its cell referenc Elijah-Dadda Excel Worksheet Functions 0 March 5th 05 03:31 AM
Conversion SVC Excel Worksheet Functions 9 February 28th 05 02:29 PM
HOW CAN I GET OFFICE 2003 EXCEL BASIC TO NEST FUNCTIONS LIKE EXCE. Robert AS Excel Worksheet Functions 4 December 2nd 04 10:49 AM


All times are GMT +1. The time now is 12:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"