return a value between set numbers

J

Joe Black

Hi I am trying to work out how to return a number of between 1 to 5 if a
single cell is between specific numbers. So i would like a A2 to equal 1 if
A1 is between 0 and 48 or A2 to equal 2 if A1 is between 49 and 96 or A2 to
equal 3 if A1 is between 97 and 144 or A2 to equal 4 if A1 is between 145 and
192 or A2 to equal 5 if A1 is between 193 and 240
any help would be appreciated. thank you in advance
 
N

nicholas_sutherland

This formula will do it - I have included errors for negative
numbers / numbers over 240
=IF(A1=0,1,IF(A1<=240,IF(A1<0,"Error Number too low",ROUNDUP
(A1/48,0)),"Error Number too high"))
If you take the error checking out its a bit simpler:
=IF(A1=0,1,ROUNDUP(A1/48,0))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top