Alternative to complex OFFSET Function

dwestfall

New Member
Joined
May 14, 2018
Messages
5
Hi, I'm currently using an OFFSET function embedded in a SUMPRODUCT formula to calculate a multiple instances of a single production stream. The formula directly underneath "Total Volume" is the following:

SUMPRODUCT($C$5:C5,N(OFFSET($D5:$D$5,ROWS($D5:$D$5)-ROW($D5:$D$5)+CELL("row",$D5:$D$5)-1,0)))

The formula works fine, however, it's repeated thousand of times across 30 other sheets and thus greatly increasing file size and slowing down the spreadsheet to a glacial pace. Does anyone have any recommendations on how to achieve the same result with an INDEX function instead of OFFSET? Thanks!

Total
CountVolumeInstancesVolume
140140
232032
326166
422054
520186
617071
7161102
814085
9131115
1012097
11111126
12100107
13
101136
1490116
1591145

<tbody>
</tbody>
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
A
B
C
D
1
2
3
4
CountVolumeInstancesTotal Volume
5
1​
40​
1​
0​
6
2​
32​
0​
0​
7
3​
26​
1​
0​
8
4​
22​
0​
0​
9
5​
20​
1​
0​
10
6​
17​
0​
0​
11
7​
16​
1​
0​
12
8​
14​
0​
0​
13
9​
13​
1​
0​
14
10​
12​
0​
0​
15
11​
11​
1​
0​
16
12​
10​
0​
0​
17
13​
10​
1​
0​
18
14​
9​
0​
0​
19
15​
9​
1​
0​
Sheet: Sheet49

Your formula returns 0 in every cell? In which cell is your formula entered?
 
Upvote 0
Welcome to the MrExcel board!

As Oscar has alluded to, it is hard to know exactly where your data is located.
However, this formula appears to produce the same results and will be somewhat less burdensome of your system so perhaps you could give it a try.

Excel Workbook
BCD
4VolumeInstancesTotal Volume
540140
632032
726166
822054
920186
1017071
11161102
1214085
13131115
1412097
15111126
16100107
17101136
1890116
1991145
Volume
 
Upvote 0
Oscar / Peter, thanks for the replies. In my spreadsheet, the aforementioned formula is located in D3, with first array in SUMPRODUCT starting in B3 and second dynamic array in C3. So, SUMPRODUCT($B$3:B3,N(OFFSET($C3:$C$3,ROWS($C3:$C$3)-ROW($C3:$C$3)+CELL("row",$C3:$C$3)-1,0))) would be the first formula in D3. Thanks in advance.
 
Upvote 0
To clear up any confusion ..
Actually, for me at least, you have created more confusion.
- You say that the (first) formula is in D3, but in the sample file it appears to be in D4
- If the values in column D of the sample file are the correct results, they seem to follow a very different pattern to the results shown in post #1 above. Can you explain how the first few results (say D4 to D8) would be obtained if doing it manually?

Excel Workbook
ABCD
1Total
2CountVolumeInstancesVolume
3
4140
5232140
63262112
742290
85201114
96172176
10716147
118143244
129131246
131012208
1411111220
1512101235
Sheet1
 
Upvote 0
Apologies for the confusion; the pattern you posted above from my file is correct for what I'm seeking help with. Same with cell location of formula and lookup range's.

To do this manually, you'd create a two way matrix which multiples each "instance" by each volume value over a time series. I've included a second version of the file to demonstrate this visually here:

https://www.dropbox.com/s/55r6vp8mfpjrpop/Array Formula Example 2.xlsx?dl=0
 
Upvote 0
Here's the manual form without having to open file attachment:


Book1
HIJKLM
1Volume4032262220
2Instances12345
3
4140322622
52806452
6
7140
8Total Volume4011290114
Sheet1
 
Upvote 0

Forum statistics

Threads
1,214,588
Messages
6,120,412
Members
448,959
Latest member
camelliaCase

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