Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Help with IF statement

Can you have multiple tests, in the test section of the if statement? For
example.
If (A2=1or2or5or25,True,False)
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Help with IF statement

"Sean.rogers" wrote:
Can you have multiple tests, in the test section of the if statement? For
example.
If (A2=1or2or5or25,True,False)


Try it like this: =IF(OR(A1={1,2,5,25}),"Y","N")
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 860
Default Help with IF statement

Hi Sean,

You can do it like this,
=IF(OR(A2=1,A2=2,A2=5,A2=25),TRUE,FALSE)

or you can be simplify it like this,
=IF(OR(A2={1,2,5,25}),TRUE,FALSE)

HTH
Martin


"Sean.rogers" wrote in message
...
Can you have multiple tests, in the test section of the if statement? For
example.
If (A2=1or2or5or25,True,False)



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Help with IF statement

Thank you worked like a charm.

"Max" wrote:

"Sean.rogers" wrote:
Can you have multiple tests, in the test section of the if statement? For
example.
If (A2=1or2or5or25,True,False)


Try it like this: =IF(OR(A1={1,2,5,25}),"Y","N")
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Help with IF statement

You could simplify that further:

=OR(A2=1,A2=2,A2=5,A2=25)

or just:

=OR(A2={1,2,5,25})

Hope this helps.

Pete

On Apr 23, 1:24*pm, "MartinW" wrote:
Hi Sean,

You can do it like this,
=IF(OR(A2=1,A2=2,A2=5,A2=25),TRUE,FALSE)

or you can be simplify it like this,
=IF(OR(A2={1,2,5,25}),TRUE,FALSE)

HTH
Martin

"Sean.rogers" wrote in message

...



Can you have multiple tests, in the test section of the if statement? For
example.
If (A2=1or2or5or25,True,False)- Hide quoted text -


- Show quoted text -




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Help with IF statement

Can I include an arrey that referances another sheet?

"Max" wrote:

"Sean.rogers" wrote:
Can you have multiple tests, in the test section of the if statement? For
example.
If (A2=1or2or5or25,True,False)


Try it like this: =IF(OR(A1={1,2,5,25}),"Y","N")
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 860
Default Help with IF statement

Yep, I always think in terms of IF and forget the fact
that sometimes it is irrelevant.

I don't think I'll ever manage to expel that habit. <bg

Regards
Martin


"Pete_UK" wrote in message
...
You could simplify that further:

=OR(A2=1,A2=2,A2=5,A2=25)

or just:

=OR(A2={1,2,5,25})

Hope this helps.

Pete

On Apr 23, 1:24 pm, "MartinW" wrote:
Hi Sean,

You can do it like this,
=IF(OR(A2=1,A2=2,A2=5,A2=25),TRUE,FALSE)

or you can be simplify it like this,
=IF(OR(A2={1,2,5,25}),TRUE,FALSE)

HTH
Martin

"Sean.rogers" wrote in message

...



Can you have multiple tests, in the test section of the if statement?
For
example.
If (A2=1or2or5or25,True,False)- Hide quoted text -


- Show quoted text -



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Help with IF statement

Can I include an arrey that referances another sheet?

Do you mean something like this, which needs to be array-entered
ie press CTRL+SHIFT+ENTER to confirm the formula:
=IF(OR(A1=MyR),"Y","N")
where MyR refers to a col range on another sheet containing the values:
1,2,5,25
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


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 an If statement answer an If statement? M.A.Tyler Excel Discussion (Misc queries) 2 June 24th 07 04:14 AM
IF AND statement Lupe Excel Worksheet Functions 4 November 16th 06 08:55 PM
appending and IF statement to an existing IF statement spence Excel Worksheet Functions 1 February 28th 06 11:00 PM
If statement and Isblank statement Rodney C. Excel Worksheet Functions 0 January 18th 05 08:39 PM
Help please, IF statement/SUMIF statement Brad_A Excel Worksheet Functions 23 January 11th 05 02:24 PM


All times are GMT +1. The time now is 05:32 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"