#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Formulas

I know this should be easy but I'm having a difficult time making this
formula. I need a formula that would do the example listed below:

For example, if B2 was a number between 1-100, it would return a "1" in B3,
and
if the number was between 101-250, it would return a "2" in B3 and so on.

Any assistance would be greatly appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 418
Default Formulas

Astrad459 wrote:
I know this should be easy but I'm having a difficult time making this
formula. I need a formula that would do the example listed below:

For example, if B2 was a number between 1-100, it would return a "1" in B3,
and if the number was between 101-250, it would return a "2" in B3 and so on.


Did you mean 101-200? If not, then I am not sure what "and so on"
would be. For example, when is 3 returned: 251 to what number?

Assuming you mean 101-200, the following might do what you want:

=max( 0, 1 + int( (B2-1) / 100 ) )

MAX(0,...) is needed to cover the case of B2<=0. If B2 is always 1 or
more, you can get away with simply "1 + int(...)"

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,886
Default Formulas

Hi

A little unclear from your posting, as to what you do want. But if you
mean
1 - 100 = 1
101 - 200 = 2
201 - 300 = 3
then try
=INT((A1-1)/100)+1

--
Regards

Roger Govier


"Astrad459" wrote in message
...
I know this should be easy but I'm having a difficult time making this
formula. I need a formula that would do the example listed below:

For example, if B2 was a number between 1-100, it would return a "1"
in B3,
and
if the number was between 101-250, it would return a "2" in B3 and so
on.

Any assistance would be greatly appreciated.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Formulas

That's exactly what I would like to do:

Say cell B2 has a number of 233.
I need cell B3 to read "2" because it is within the range of 100-249.
If the number were 98, it should read a "1" because it is within the range
of 1-99.
A number of 250-399 would read "3", and the range goes on with bigger
numbers located in B2.

The formula below will not work because it is not based purely on 100's.
Thank you for your response though.


"Roger Govier" wrote:

Hi

A little unclear from your posting, as to what you do want. But if you
mean
1 - 100 = 1
101 - 200 = 2
201 - 300 = 3
then try
=INT((A1-1)/100)+1

--
Regards

Roger Govier


"Astrad459" wrote in message
...
I know this should be easy but I'm having a difficult time making this
formula. I need a formula that would do the example listed below:

For example, if B2 was a number between 1-100, it would return a "1"
in B3,
and
if the number was between 101-250, it would return a "2" in B3 and so
on.

Any assistance would be greatly appreciated.




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,345
Default Formulas

Hi Astrad459,

You still don't give the whole set of ranges that you want to test for.
With the upper limit of every range, ie from the example you have given 99,
249, 399, try:

=SUM(--(B2{0,99,249,399,499,549,749,999}))

(The 499,549,749 & 999 are my *guesses* at further range limits)

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"Astrad459" wrote in message
...
That's exactly what I would like to do:

Say cell B2 has a number of 233.
I need cell B3 to read "2" because it is within the range of 100-249.
If the number were 98, it should read a "1" because it is within the range
of 1-99.
A number of 250-399 would read "3", and the range goes on with bigger
numbers located in B2.

The formula below will not work because it is not based purely on 100's.
Thank you for your response though.


"Roger Govier" wrote:

Hi

A little unclear from your posting, as to what you do want. But if you
mean
1 - 100 = 1
101 - 200 = 2
201 - 300 = 3
then try
=INT((A1-1)/100)+1

--
Regards

Roger Govier


"Astrad459" wrote in message
...
I know this should be easy but I'm having a difficult time making this
formula. I need a formula that would do the example listed below:

For example, if B2 was a number between 1-100, it would return a "1"
in B3,
and
if the number was between 101-250, it would return a "2" in B3 and so
on.

Any assistance would be greatly appreciated.








  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 418
Default Formulas

Astrad459 wrote:
That's exactly what I would like to do:
Say cell B2 has a number of 233.
I need cell B3 to read "2" because it is within the range of 100-249.
[....]
A number of 250-399 would read "3", and the range goes on with bigger
numbers located in B2.


Non sequitur! Previously, you said that 101-250 would return 2, not
100-249. So 100 should convert to 1 and 250 should convert 2,
according to your original specifications.

Since your specifications are so ambiguous, I suggest that you adapt
the following paradigm to your specific needs, whatever they a

=MATCH(MAX(0,A1), {0,1,101,251,300}, 1) - 1

The key elements a (a) the "{...}" array should contain each of the
lower bounds of your ranges; and (b) "1" in the 3rd argument of MATCH()
says "match the largest value in the array less than or equal to the
look-up value.

The above MATCH() will return 1 greater than your intended results,
which is why I subtract 1 afterwards. That allows for A1<=0, A1 is
empty, and A1 is text.

If you do not need that much robustment -- that is, if A1 is always 1
or greater -- you can use the following simpler paradigm:

=MATCH(A1, {1,101,251,300}, 1)

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 change column letters to correct ones in many formulas automatically? Dmitry Kopnichev Links and Linking in Excel 7 October 13th 05 09:52 PM
how can i get formulas in excel to copy and paste? bman Excel Worksheet Functions 1 October 3rd 05 04:15 PM
How to make Excel run limited number of formulas on a given worksh John Excel Discussion (Misc queries) 0 January 12th 05 04:29 PM
Way to make Excel only run certain formulas on a worksheet? jrusso Excel Discussion (Misc queries) 0 January 12th 05 04:23 PM
calculating formulas for all workbooks in a folder Chad Excel Worksheet Functions 3 November 13th 04 05:22 PM


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