Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default return a value between set numbers

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default return a value between set numbers

Try this:

=IF(COUNT(A1),MATCH(A1,{0,49,97,145,193}),"")

--
Biff
Microsoft Excel MVP


"Joe Black" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default return a value between set numbers

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))

On Dec 31, 12:13*pm, Joe Black
wrote:
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


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default return a value between set numbers

=LOOKUP(A2,{1,49,97,145,193;1,2,3,4,5})

"Joe Black" wrote:

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

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
How to return the average of the LAST 3 numbers in a row thorshammer Excel Worksheet Functions 3 August 11th 08 04:15 AM
how to return a set of numbers in column A Welby Excel Worksheet Functions 0 August 17th 07 02:14 AM
how to return a set of numbers in column A Toppers Excel Worksheet Functions 0 August 17th 07 02:12 AM
how to return a set of numbers in column A Welby Excel Worksheet Functions 0 August 17th 07 01:55 AM
Get different numbers to return text?? Curalice Excel Worksheet Functions 6 January 19th 06 08:20 PM


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