Thread: Correct Syntax
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
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