Breakdown a given number by ranges

TexasWonder

New Member
Joined
Feb 5, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I have an issue I can't solve, if given a variable number, I'm trying to breakdown that number based on a set of fixed ranges. For example, the number 1200 fits into the fixed ranges below like so:

Range:. Breakdown of "1200"
1-200. 200
201-400. 199
401-600. 199
801-infinity. 602

I can't quite figure out what formula would make this count happen
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Can this work? (I am assuming your the skip from 600 to 800 is a typo).

Mr Excel Questions2.xlsm
AB
1Number:1200
2Nbr Ranges:4
3Initial Intervals200
4Range StartRange End
51200
6201400
7401600
86011200
Sheet14
Cell Formulas
RangeFormula
B5B5=B3
A6:A8A6=IF(ROWS($A$5:A6)>$B$2,"",1+B5)
B6:B8B6=IF(ROWS($A$5:A6)>$B$2,"",IF(ROWS($A$5:A6)=$B$2,$B$1,A6+$B$3-1))
 
Upvote 1
I failed to put the 3rd column in (the counts). Yours is incorrect as you are subtracting the start of the range. You need to subtract the end of the prevous range. So your counts are 200,200,200,600.
 
Upvote 1
Welcome to the MrExcel board!

Your ranges look strange to me. Apart from the calculation issue already mentioned, your ranges do not include 601 to 800.

Anyway see if this is something that you can adapt.

23 02 06.xlsm
ABC
1Number1200
2
3Range StartRange EndResult
41200200
5201400200
6401800400
7801infinity400
Ranges
Cell Formulas
RangeFormula
C4:C7C4=LET(r,B$1-SUM(C$3:C3),IF(r=0,"",MIN(r,IFERROR(B4-A4+1,r))))


23 02 06.xlsm
ABC
1Number275
2
3Range StartRange EndResult
41200200
520140075
6401800 
7801infinity 
Ranges
Cell Formulas
RangeFormula
C4:C7C4=LET(r,B$1-SUM(C$3:C3),IF(r=0,"",MIN(r,IFERROR(B4-A4+1,r))))
 
Upvote 1
Solution
Thanks everyone! This is very helpful. Yes typing on my phone rather quickly so initially my post had the wrong range calculation and I did accidentally forget to put 601 to 800.
 
Upvote 0
If one of the posts provides you with the answer please mark it as the answer.
 
Upvote 0
Update to Post #2.

If you want to display "Infinity" instead of the max amount as input, you can use this formula in column B:
=IF(ROWS($A$5:A6)>$B$2,"",IF(ROWS($A$5:A6)=$B$2,"Infinity"A6+$B$3-1))
 
Upvote 0
You're welcome. Glad we could help. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top