Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
pbeattie
 
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   Report Post  
Peo Sjoblom
 
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   Report Post  
Richard Buttrey
 
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
__________________________
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
If statement w/ rounding but not all numbers AMarie Excel Worksheet Functions 5 October 10th 05 08:58 PM
Excel charts with one standard grid and wide range of numbers LeoCh Charts and Charting in Excel 1 September 12th 05 12:04 AM
Match function...random search? Les Excel Worksheet Functions 10 July 28th 05 11:54 AM
occurance of numbers in cell range Dillenger Excel Worksheet Functions 14 February 21st 05 06:45 PM
can the negative numbers in an IF statement be in a diff color th. [email protected] Excel Worksheet Functions 1 January 12th 05 07:39 PM


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