Creating new rows from a minimum value and count

ScruffyW1lf

New Member
Joined
Jun 1, 2023
Messages
11
Office Version
  1. 365
Platform
  1. Windows
Hi, have a large number of records that includer a reference, a minimum value and a maximum value e.g. 0 (min) 800 (max). The minimum and maximum values vary per record but are all wholly divisible by 10. I wish to break down the record into a series of new records so that e.g. a record min= 0, max = 800 is now a series of records with the same reference as the original but 0-10,10-20, 20-30 until it reaches the max value - in this case 790-800. I have a count already set up against each original record so know how may "sub" records to expect. I am assumin this will need some iterative VBA or similar, but haven't a clue how to do it. Anyway care to teach this old dog?
 
OK, Sadly I am unable to use XL2BB. Instead I tried replicating your example in a blank/unsullied workbook. - created exactly the same as per the example and copied/pasted the equation to F2. The same #NAME? error popped up. Makes me wonder whether I have total functionality.
 
Upvote 0

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
I see, if it is a #NAME error then one of the functions that has been used in the formula may not be available to you.

An easy way to check is to type an = in a cell and the start to type the functions below to see if you have them or not. I suspect one of the below, in the most likely order:
TOCOL
SEQUENCE
HSTACK
 
Upvote 0
If it is TOCOL that you don't have then maybe the below would work for you:
Book1
ABCDEFGH
1ReferenceMinMaxCountReferencelBracketuBracket
2123010010123010
34560200201231020
47890300301232030
51233040
61234050
71235060
81236070
91237080
101238090
1112390100
12456010
134561020
144562030
154563040
164564050
174565060
184566070
194567080
204568090
2145690100
22456100110
23456110120
24456120130
25456130140
26456140150
27456150160
28456160170
29456170180
30456180190
31456190200
32789010
337891020
347892030
357893040
367894050
377895060
387896070
397897080
407898090
4178990100
42789100110
43789110120
44789120130
45789130140
46789140150
47789150160
48789160170
49789170180
50789180190
51789190200
52789200210
53789210220
54789220230
55789230240
56789240250
57789250260
58789260270
59789270280
60789280290
61789290300
Sheet1
Cell Formulas
RangeFormula
F2:H61F2=LET(startRange,B2:B4,countRange,D2:D4,ref,A2:A4, rpt,XLOOKUP(SEQUENCE(SUM(countRange)),SCAN(0,countRange,LAMBDA(a,b,a+b)),ref,,1), cumTotal,MMULT(IF(ROW(countRange)>TRANSPOSE(ROW(countRange)),1,0),countRange), rowSeq,SEQUENCE(SUM(countRange),1,0,1), totCount,SUM(countRange), modRow,MOD(rowSeq,totCount), series,MATCH(modRow,cumTotal), startValue,INDEX(startRange,series), subtract,INDEX(cumTotal,series), result,startValue+(rowSeq*10)-(subtract*10), HSTACK(rpt,result,result+10))
Dynamic array formulas.
 
Upvote 0
Seems my last has not appeared. Try again. No, sadly I cannot use XL2BB. However, I set up your example in a new unsullied workbook - copying across the formula you provided. The same #NAME? was the outcome. wondering now whether I have the functionality to make the equation a success.
 
Upvote 0
It did and you replied. Refresh was a bit too slow for me. I actually tried all three, TOCOL, SEQUENCE and HSTACK. None of them were offered in the drop down list of functions as I was typing them out, so at least I've learned something.... I don't have everything when I thought I had.
 
Upvote 0
What is the build/version of your 365?
Build.jpg
 
Upvote 0
Right, I have two works laptops. Whilst waiting for my main one to boot up, I used the other one and called up the Excel book containing the supplied data and formula. This laptop had a version that recognised all the functions, so I continued with it and successfully ran the formula!! Success. Albeit I had to remove a rake of "@" in the formula that was not there on the misbehaving laptop. So whilst success has been achieved (it ran really quickly), I now have a bone to pick with Corporate IT. Many thanks for this, the formula will definitely be used many times again in the future.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,323
Members
452,635
Latest member
laura12345

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