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

P

pbeattie

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,
 
R

Richard Buttrey

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
__________________________
 
Top