A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How do I use a range of numbers in an if statement?



 
 
Thread Tools Display Modes
  #1  
Old October 10th, 2005, 10:16 PM
pbeattie
external usenet poster
 
Posts: n/a
Default How do I use a range of numbers in an if statement?

I would like to use a range of numbers in an IF statement. As an example
IF("C8 =3,4,or5",25,0) which is meant to read if cell C8 is equal to the
number 3, the number 4, or the number 5, then show 25, if not show 0. Is
there a simple way to write this range of numbers into this IF statement?

Thanks,
  #2  
Old October 10th, 2005, 10:33 PM
Peo Sjoblom
external usenet poster
 
Posts: n/a
Default

Sure, try

=IF(OR(C8={3,4,5}),25,0)


Regards,

Peo Sjoblom


"pbeattie" wrote in message
...
I would like to use a range of numbers in an IF statement. As an example
IF("C8 =3,4,or5",25,0) which is meant to read if cell C8 is equal to the
number 3, the number 4, or the number 5, then show 25, if not show 0. Is
there a simple way to write this range of numbers into this IF statement?

Thanks,



  #3  
Old October 10th, 2005, 10:36 PM
Richard Buttrey
external usenet poster
 
Posts: n/a
Default

On Mon, 10 Oct 2005 14:16:03 -0700, "pbeattie"
wrote:

I would like to use a range of numbers in an IF statement. As an example
IF("C8 =3,4,or5",25,0) which is meant to read if cell C8 is equal to the
number 3, the number 4, or the number 5, then show 25, if not show 0. Is
there a simple way to write this range of numbers into this IF statement?

Thanks,



IF(OR(C8=3,C8=4,C8=5),25,0)

or if the test is anything between 3 and 5 inclusive

=IF(AND(C8=3,C8=5),25,0)

Rgds
__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I get an IF statement to pull a date range?? Brooke Medvecky Worksheet Functions 9 April 19th, 2006 08:48 PM
How do i set up a range of numbers which prompts at a particular n Stefan General Discussion 0 October 10th, 2005 11:29 AM
Counting if numbers fall within a specified range KG General Discussion 4 September 10th, 2005 02:30 PM
Using COUNTIF to find numbers within a range greater than the mean Lowkey Worksheet Functions 2 May 17th, 2005 06:34 PM
Search range of numbers for amounts that total a given Mike Briscoe General Discussion 1 July 30th, 2004 06:20 AM


All times are GMT +1. The time now is 04:05 PM.


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