array formula to perform vlookup and sumproduct at once

jerryjacobi

New Member
Joined
Nov 27, 2017
Messages
2
Hi,
I am trying to compile an array formula to perform following action:

Here are input data:

Prices in EUR for parts for months
Jan 2018Feb 2018Mar 2018Apr 2018
PART11224
PART22345
PART33456

<tbody>
</tbody>

Structures (bill of material) of finished products
PRODUCT1PRODUCT2PRODUCT3
PRODUCT11
PRODUCT21
PRODUCT31
PART111
PART211
PART311

<tbody>
</tbody>

And now I need to get price of each final product of each month. For example PRODUCT1 is composed of one piece PART1 and one piece PART2. For January they have prices in the first table (1 EUR and 2 EUR). So total price of PRODUCT1 for January is 1x1 + 1x2 => 3 EUR. For February it is 1x2 + 1x3 => 5 EUR.

Final PRICELIST should look like this:
Jan 2018Feb 2018Mar 2018Apr 2018
PRODUCT13579
PRODUCT257911
PRODUCT346810

<tbody>
</tbody>

Is there a way how make an array formula to calculate price in PRICELIST based on above data? I am trying to solve this for days but still can't make it work :(

It should be combination of vlookup (to find valid price) and sumproduct (to multiply piece prices by number of parts in final product). But this vlookup must return price of all parts for given month ... Am I going in the right direction?

Thank you very much for you help.
BR
Lukas
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Welcome to Mr Excel

Maybe something like this - for testing purposes i changed the qty of Part2 in PRODUCT1 (in red)

A
B
C
D
E
F
G
H
I
J
1
Jan 2018​
Feb 2018​
Mar 2018​
Apr 2018​
PRODUCT1​
PRODUCT2​
PRODUCT3​
2
PART1​
1​
2​
2​
4​
PRODUCT1​
1​
3
PART2​
2​
3​
4​
5​
PRODUCT2​
1​
4
PART3​
3​
4​
5​
6​
PRODUCT3​
1​
5
PART1​
1​
1​
6
PART2​
2​
1​
7
PART3​
1​
1​
8
9
Jan 2018​
Feb 2018​
Mar 2018​
Apr 2018​
10
PRODUCT1​
5​
8​
10​
14​
11
PRODUCT2​
5​
7​
9​
11​
12
PRODUCT3​
4​
6​
7​
10​
13

Array formula in B10 copied across and down (gray area)
=SUM(INDEX($H$2:$J$7,0,MATCH($A10,$H$1:$J$1,0))*SUMIF($A$2:$A$4,IF(ISNUMBER(INDEX($H$2:$J$7,0,MATCH($A10,$H$1:$J$1,0))),$G$2:$G$7),INDEX($B$2:$E$4,0,MATCH(B$9,$B$1:$E$1,0))))
Ctrl+Shift+Enter

Hope this helps

M.
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

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