#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Correct Syntax

=IF(A1 = 1 #OR#2,1,2)

What is the correct way to write the OR part of the formula? Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default Correct Syntax

One way:

=IF(OR(A1=1,A1=2),1,2)

Another:

= 2 - OR(A1=1,A1=2)

In article
<51 ,
TeeSee wrote:

=IF(A1 = 1 #OR#2,1,2)

What is the correct way to write the OR part of the formula? Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,316
Default Correct Syntax

=IF(OR(A1=1,A1=2),1,2)

--
Kevin Backmann


"TeeSee" wrote:

=IF(A1 = 1 #OR#2,1,2)

What is the correct way to write the OR part of the formula? Thanks

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 419
Default Correct Syntax

TeeSee,

=IF(OR(A1=1,A1=2),1,2)

HTH,

Conan




"TeeSee" wrote in message
...
=IF(A1 = 1 #OR#2,1,2)

What is the correct way to write the OR part of the formula? Thanks



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default Correct Syntax

=IF(OR(A1=1,A1=2),100,200)

Means:
If A1 =1 or A1 =2 Then the result is 100, Else the result is 200

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"TeeSee" wrote in message ...
| =IF(A1 = 1 #OR#2,1,2)
|
| What is the correct way to write the OR part of the formula? Thanks




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Correct Syntax

=IF(OR(A1=1,A1=2),1,2)

Note: this will return 1 if A1 is either 1 ot 2 and 2 if A1 is anything other
than 1 or 2.

Is that what you want?

Maybe =IF(A1=1,1,IF(A1=2,2,""))


Gord Dibben MS Excel MVP

On Wed, 27 Feb 2008 13:48:33 -0800 (PST), TeeSee wrote:

=IF(A1 = 1 #OR#2,1,2)

What is the correct way to write the OR part of the formula? Thanks


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default Correct Syntax

Another way:

=If(Or(A1={1,2}),1,2)

--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"TeeSee" wrote in message
...
=IF(A1 = 1 #OR#2,1,2)

What is the correct way to write the OR part of the formula? Thanks


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
SQL syntax Spike Excel Worksheet Functions 2 March 8th 07 08:27 AM
COMPARING DATES with nested IF not working- Syntax is correct though Richard Flame Excel Discussion (Misc queries) 2 July 12th 06 07:04 PM
Correct VBA syntax Ken G. Excel Discussion (Misc queries) 3 December 7th 05 12:35 AM
what is the correct syntax for an allowable circular reference? excell idiot Excel Discussion (Misc queries) 1 March 10th 05 05:17 PM
Previous Post - Correct Syntax Query Clarence Crow Excel Worksheet Functions 0 December 7th 04 05:35 AM


All times are GMT +1. The time now is 09:47 PM.

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"