Replacing OFFSET to sum up to max value from specific cell

MFengineer

New Member
Joined
Feb 25, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello everyone, I am new to the board & thank you all in advance for the help.

I have data for the time it takes each step in a manufacturing process & each step has a unique name that never repeats, as seen below, pasted in A1 corner.

StepstimeStart PointSum of StepsCount
2800N152800N3142
2800N28Max Time
2800N3420
2800N410
2800N510
2800N610

What I want to accomplish is have (2) inputs that I can change independently, which are, which step am I starting on (Start Point) & MAX time I have available, then return the total time up to that cell (Sum of Steps) without exceeding the max time & how many steps were completed (Count).

For example, as seen on table above, lets say I will be starting at "2800N3" (located in A4) & I only have 20 minutes (my given Max Time), & I want to know how many steps I will be able to complete in those 20 minutes and what is the actual total time (sum) up to that last completed step. In this case, with 20 minutes, I will complete steps 2800N3 & 2800N4, and the sum of those completed steps is 14, and the number of steps completed was 2.

Another example, Start Point: 2800N2, Max Time: 30, RESULTS: Sum of Steps: 22 & Count: 3, ie with 30 minutes we can complete 2800N2 thru 2800N4.

I was able to get this to work using a combination of match, index, subtotal and offset, however offset is a volatile function, and since I will have about 30 of these in the same cell (one for each mfg machine) it becomes really slow when changing values, so I would like to use something that in non-volatile in hopes the calculations are faster.

Also asked here Replacing OFFSET to sum up to max value from specific cell
 
Last edited by a moderator:

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Maybe stage this somewhere else on your sheet?

Book1
ABCDE
1StepstimeStart PointSum of StepsCount
22800N152800N1274
32800N28Max Time
42800N3430
52800N410
62800N510
72800N610
8
9
10StepsTest
1155
12813
13417
141027
1510 
1610 
Sheet1
Cell Formulas
RangeFormula
D2D2=IFERROR(MAX(FILTER($B$11:$B$20,$B$11:$B$20<>"")),"")
E2E2=COUNT($B$11:$B$20)
A11:A16A11=FILTER($B$2:$B$7,($A$2:$A$7>=$C$2))
B11:B16B11=IF(ROWS($B$11:B11)>COUNT($A$11:$A$16),"",IF(SUM($A$11:A11)>$C$4,"",SUM($A$11:A11)))
Dynamic array formulas.
Cells with Data Validation
CellAllowCriteria
C2List=$A$2:$A$7
 
Upvote 0
Maybe stage this somewhere else on your sheet?
FYI, I think the question has been resolved at the cross-post. :)

@MFengineer
It would be great if you could tell us when the question is resolved elsewhere. One of the problems with cross-posting is that helpers can get a little annoyed if they put a deal of time into trying to solve your problem, only to subsequently find out that you already have a solution. Doesn't encourage them to help you next time you have a question. ;)
 
Upvote 0
Here is one with no helper columns.

MrExcelPlayground7.xlsx
ABCDE
2StepstimeStart PointSum of StepsCount
32800N152800N3142
42800N28Max Time
52800N3420
62800N410
72800N510
82800N610
Sheet7
Cell Formulas
RangeFormula
D3D3=MAX(FILTER(MMULT((--(ROUNDUP(SEQUENCE(ROWS(FILTER(B3:B8,(ROW(B3:B8)-ROW(B3)+1)>=MATCH(C3,A3:A8))),ROWS(FILTER(B3:B8,(ROW(B3:B8)-ROW(B3)+1)>=MATCH(C3,A3:A8))),,1)/4,0)>MOD(SEQUENCE(ROWS(FILTER(B3:B8,(ROW(B3:B8)-ROW(B3)+1)>=MATCH(C3,A3:A8))),ROWS(FILTER(B3:B8,(ROW(B3:B8)-ROW(B3)+1)>=MATCH(C3,A3:A8))),,1)-1,ROWS(FILTER(B3:B8,(ROW(B3:B8)-ROW(B3)+1)>=MATCH(C3,A3:A8)))))),FILTER(B3:B8,(ROW(B3:B8)-ROW(B3)+1)>=MATCH(C3,A3:A8))),(MMULT((--(ROUNDUP(SEQUENCE(ROWS(FILTER(B3:B8,(ROW(B3:B8)-ROW(B3)+1)>=MATCH(C3,A3:A8))),ROWS(FILTER(B3:B8,(ROW(B3:B8)-ROW(B3)+1)>=MATCH(C3,A3:A8))),,1)/4,0)>MOD(SEQUENCE(ROWS(FILTER(B3:B8,(ROW(B3:B8)-ROW(B3)+1)>=MATCH(C3,A3:A8))),ROWS(FILTER(B3:B8,(ROW(B3:B8)-ROW(B3)+1)>=MATCH(C3,A3:A8))),,1)-1,ROWS(FILTER(B3:B8,(ROW(B3:B8)-ROW(B3)+1)>=MATCH(C3,A3:A8)))))),FILTER(B3:B8,(ROW(B3:B8)-ROW(B3)+1)>=MATCH(C3,A3:A8)))<C5)))
E3E3=SUM(--(MMULT((--(ROUNDUP(SEQUENCE(ROWS(FILTER(B3:B8,(ROW(B3:B8)-ROW(B3)+1)>=MATCH(C3,A3:A8))),ROWS(FILTER(B3:B8,(ROW(B3:B8)-ROW(B3)+1)>=MATCH(C3,A3:A8))),,1)/4,0)>MOD(SEQUENCE(ROWS(FILTER(B3:B8,(ROW(B3:B8)-ROW(B3)+1)>=MATCH(C3,A3:A8))),ROWS(FILTER(B3:B8,(ROW(B3:B8)-ROW(B3)+1)>=MATCH(C3,A3:A8))),,1)-1,ROWS(FILTER(B3:B8,(ROW(B3:B8)-ROW(B3)+1)>=MATCH(C3,A3:A8)))))),FILTER(B3:B8,(ROW(B3:B8)-ROW(B3)+1)>=MATCH(C3,A3:A8)))<C5))


Here is the same thing, unpacked a bit to make more sense.

MrExcelPlayground7.xlsx
ABCDEFGHIJKLMNOPQRSTUVWX
2StepstimeStart PointSum of StepsCount
32800N152800N3142344111110004TRUE4142
42800N28Max Time101111110014TRUE14
52800N3420101111111024FALSE
62800N410101111111134FALSE
72800N510
82800N610
Sheet7
Cell Formulas
RangeFormula
D3D3=MAX(FILTER(MMULT((--(ROUNDUP(SEQUENCE(ROWS(FILTER(B3:B8,(ROW(B3:B8)-ROW(B3)+1)>=MATCH(C3,A3:A8))),ROWS(FILTER(B3:B8,(ROW(B3:B8)-ROW(B3)+1)>=MATCH(C3,A3:A8))),,1)/4,0)>MOD(SEQUENCE(ROWS(FILTER(B3:B8,(ROW(B3:B8)-ROW(B3)+1)>=MATCH(C3,A3:A8))),ROWS(FILTER(B3:B8,(ROW(B3:B8)-ROW(B3)+1)>=MATCH(C3,A3:A8))),,1)-1,ROWS(FILTER(B3:B8,(ROW(B3:B8)-ROW(B3)+1)>=MATCH(C3,A3:A8)))))),FILTER(B3:B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U6U3=(T3#<C5)
V3:V4V3=FILTER(T3#,U3#)
W3W3=MAX(V3#)
X3X3=SUM(--U3#)
Dynamic array formulas.
]
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,171
Members
452,615
Latest member
bogeys2birdies

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