Array SUM or SUMPRODUCT function error

KratosZG

New Member
Joined
Jan 26, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
  2. Web
Hi!

I have been working on implementing MRP Excel solution in a company I work for. I have already done one, and now I was working on a new more detailed system. My company prohibits me to install XLB2BB add-in so I will do my best to explain everything.

First sheet 'ProdBOMs' contains Bill of Materials for all products:
Product codeProduct nameMaterial codeMaterial nameQty
PROD1Product 1MAT1Material 1
1​
PROD1Product 1MAT2Material 2
2​
PROD1Product 1MAT3Material 3
3​
PROD1Product 1MAT4Material 4
4​
PROD1Product 1MAT5Material 5
5​
PROD2Product 2MAT1Material 1
10​
PROD2Product 2MAT2Material 2
8​
PROD2Product 2MAT3Material 3
6​
PROD2Product 2MAT4Material 4
4​
PROD2Product 2MAT5Material 5
2​
PROD3Product 3MAT1Material 1
20​
PROD3Product 3MAT2Material 2
30​
PROD3Product 3MAT3Material 3
40​
PROD3Product 3MAT4Material 4
50​
PROD3Product 3MAT5Material 5
60​

1706267336017.png


Second sheet 'Plan' contains production plan by products and by weeks:
Product codeProduct nameW03/24W04/24W05/24W06/24W07/24W08/24W09/24W10/24
PROD1Product 1
10​
15​
100​
PROD2Product 2
20​
35​
100​
10​
PROD3Product 3
10​
30​
20​
100​

1706267360047.png



Third sheet 'BOMs' contains BOMs matrix with materials on left side and products on upper side. That is a matrix derived from first sheet 'ProdBOMs' (first 5 columns).

PROD1PROD2PROD3
15.1.2024​
22.1.2024​
29.1.2024​
5.2.2024​
12.2.2024​
19.2.2024​
26.2.2024​
4.3.2024​
Product 1Product 2Product 3W03/24W04/24W05/24W06/24W07/24W08/24W09/24W10/24
MAT1Material 111020
0​
(formula) 10​
15​
0​
100​
0​
0​
0​
MAT2Material 22830
0​
20​
30​
0​
200​
0​
0​
0​
MAT3Material 33640
0​
30​
45​
0​
300​
0​
0​
0​
MAT4Material 44450
0​
40​
60​
0​
400​
0​
0​
0​
MAT5Material 55260
0​
50​
75​
0​
500​
0​
0​
0​

1706267651762.png


On the right side of that matrix (next columns) is the calculation of how much of each material we need to produce planned products by weeks. That part is where I need your help. The formula that is in the cell for W04/24 and MAT1 (marked with word "formula" in upper table) is:

Excel Formula:
=SUM(INDEX(PPlan;MATCH(BOMsProducts;PPlanProducts;0);MATCH(H$2;PPlanWeeks;0))*INDEX(BOMsSummary;ROW()-2;MATCH(BOMsProducts;PPlanProducts;0)))

The formula is array CSE (Ctrl+Shift+Enter) formula, even though Excel recognizes automatically in another older table this formula as array formula and I can just "Enter" formula without "{}" and "CSE"

PPlan = Plan!$C$2:$J$4
BOMsProducts = BOMs!$C$1:$E$1
PPlanProducts = Plan!$A$2:$A$4
PPlanWeeks = Plan!$C$1:$J$1
BOMsSummary = BOMs!$C$3:$E$7

The result should be 810, because we use MAT 1 in all 3 Products and sum of the multiplication of two array is ((10*1) + (20*10) + (30+20)) is 810.

I have tried to take parts: first array and second array and then SUM them without CSE and with CSE and it does work. I have also tried SUMPRODUCT with and without CSE and it works. But when I try to combine two arrays in one array formula it does not work, even though as I said works in older larger table. I must be missing something, and I just can't figure it out...

Please help!
Thank you!
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
I am not sure what happend during my explanation but now I got it working. I have one possible solution/explanation but I have tested it. It didn't work and that is why I have posted my problem here.

Possible explanation: On every named range I have added 1 column (if the range represent row values) or 1 row (if the range represented the column range) so in the future I could easly add more products or materials whenever I needed without expanding manually the named range. Now I think that when I reduced named range as explained in the first post everything works. Because since the last values of all named ranges were empty the formulas probably took that as some kind of error (?) Could that really be the issue?

Another related explanation: If I leave named ranged expanded for 1 row/column I only have to fill with whichever sign (can be "x", just not to leave the cell empty) in named ranges BOMsProducts and PPlanProducts and formula magicaly works even without CSE.

Can anyone explain this a little bit so everyone can learn something :)
Thank you!
 
Upvote 0

Forum statistics

Threads
1,223,877
Messages
6,175,134
Members
452,614
Latest member
MRSWIN2709

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