Product of 2 tables/datasets with multiple criteria (mix of Column/Row)

Scotster

Board Regular
Joined
May 29, 2017
Messages
65
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Looking for some help with a formula to calculate the total requirement of a part over multiple variants. Example below:

Part list with Type Quantity
Type1Type2Type3Type4Type5
Part101234
Part240123
Part334012
Part423401
Part512340

Type demand for each WK
WK1WK2WK3WK4WK5
Type101111
Type244536
Type31212995
Type4101313149
Type576767

Total Demand for each part
WK1WK2WK3WK4WK5
Part186
Part2
Part3
Part4
Part5

86 is worked out from the part1 * type1 + part1 * type2, etc. Fairly certain I should be able to use a sumproduct, but i'm struggling as I'm matching column headings to rows etc.

Any help greatly appreciated :)
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Try:
Excel Formula:
=MMULT(B2:F6,B9:F13)
where B2:F6 is Part list with Type Quantity
and B9:F13 is Type demand for each WK
 
Upvote 0
Try:
Excel Formula:
=MMULT(B2:F6,B9:F13)
where B2:F6 is Part list with Type Quantity
and B9:F13 is Type demand for each WK

Ahh, apologies. I just did 5 of each to keep it short... I should have said the part list will be significantly bigger than just 6 parts.

The part1 to part5 list can go on for 1000s of lines and won't ever be a similar size to the Type demand table.

I'll update the tables so that this is easily seen.
 
Upvote 0
Updated table to show dissimilar layout.

Part list with Type Quantity
Type1Type2Type3Type4Type5
Part101234
Part240123
Part334012
Part423401
Part512340
Part654321

Type demand for each WK
WK1WK2WK3WK4WK5WK6
Type1011115
Type2445362
Type312129954
Type41013131497
Type5767679

Total Demand for each part
WK1WK2WK3WK4WK5WK6
Part186
Part2
Part3
Part4
Part5
Part6
 
Upvote 0
That shouldn't matter as long as you have same number of Type in both tables.
Book1
ABCDEF
1Type1Type2Type3Type4Type5
2Part101234
3Part240123
4Part334012
5Part423401
6Part512340
7Part654321
8
9WK1WK2WK3WK4WK5
10Type101111
11Type244536
12Type31212995
13Type4101313149
14Type576767
15
16WK1WK2WK3WK4WK5
17Part18691908771
18Part25360605948
19Part34044504150
20Part46768605347
21Part58497909064
22Part67989857869
Sheet2
Cell Formulas
RangeFormula
B17:F22B17=MMULT(B2:F7,B10:F14)
Dynamic array formulas.
 
Upvote 0
Doh, I hadn't changed the formula to cover the whole table.

That's brilliant, I didn't realise it could be done so easily. Many thanks.
 
Upvote 0
Copied it into the large dataset and it works. The only limitation is the Part list with Qty must be the same size and order as the Total demand part list. I have a workaround where I can build the first table and then re-create the third table each time.

To save with this, is there any way to have the result table give the values based on the part number referenced? For example:

WK1WK2WK3WK4WK5
Part2
Part4
Part1

With this I could have the part table fixed with the values known, the second table fixed with the values known and the 3rd table able to update with reduced, and specified, part lists.
 
Upvote 0
Try:
Book1
ABCDEF
1Type1Type2Type3Type4Type5
2Part101234
3Part240123
4Part334012
5Part423401
6Part512340
7Part654321
8
9WK1WK2WK3WK4WK5
10Type101111
11Type244536
12Type31212995
13Type4101313149
14Type576767
15
16WK1WK2WK3WK4WK5
17Part25360605948
18Part46768605347
19Part18691908771
Sheet2
Cell Formulas
RangeFormula
B17:F19B17=MMULT(FILTER($B$2:$F$7,$A$2:$A$7=A17),$B$10:$F$14)
Dynamic array formulas.
 
Upvote 0
Nailed it, absolutely perfect.

Hadn't ever used MMULT before either, it seems very powerful.
 
Upvote 0
You're welcome.
MMULT is short for matrix multiplication. In simple terms, it's repeated sum products.
 
Upvote 0

Forum statistics

Threads
1,225,763
Messages
6,186,897
Members
453,384
Latest member
BigShanny

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