Sumproduct with multiple criteria from a row or columm

duduburton

New Member
Joined
Nov 13, 2014
Messages
1
Guys,
I am an avid reader of this Excel forum and have learned much things here.
I have an advanced question regarding the SumProduct.

The problem is:
Let´s supose I have a plan to by for my company Cars, Bikes and Buses, with the quantity of that table below:

TABLE 1
Year 1Year 2Year 3
Car234
Bike467
Bus8910
Airplane111213

<tbody>
</tbody>

However, I'm reestructuring the company and decide to replace most of transport for efficient type like (not buying the original ones):
So: the replacement idea will be like a table:

TABLE 2
Electric CarEletric BusSpaceship
Car100%
Bike50%50%
Bus100%
Airplane10%10%80%

<tbody>
</tbody>

You can read the data like: for each 10 planes I planned to buy, if I want a new type of transportation I will by 1 Electric Car, 1 Electric Bus and 8 SpaceShips.

However, this substitution table have also a yearly base improvement on the horsepower:

TABLE 3
Year 1Year 2Year 3Year 4
Electric Car10 HP5 HP5 HP5 HP
Electric Bus15 HP10 HP5 HP5 HP
Spaceship20 HP10 HP10 HP5 HP

<tbody>
</tbody>

(sorry, many details, I know):

What I want is to build a result table to find the number of transportation per horsepower per year that will made the following queries:

TABLE 4
Year 1Year 2Year 3Year 4
5 HP
10 HP* example 1** example 2
15 HP
20 HP

<tbody>
</tbody>

* example 1
1) look for the HP label on the "A" column of TABLE 4 (found 10 HP)
2) seek for 10 HP in year 1 of TABLE 3 in Column "A" (found Electric Car)
3) Multiply the matrix of TABLE 2 per the Column of Year 1 in the TABLE 1 to find the number of Electric Car (100%*2 + 50% *4 + 100%*8)
4) this will be the number in example 1 cell.

** example 2
1) same procedure (found 10 HP)
2) however, we found 2 entries on TABLE 3, Electric Bus ans Space Ship
3) for that step, we will multiple the line of Year 2 from TABLE 1 per the Electric Bus and sum with the same operation for the SpaceShip
4) that will be the number.


I have tried to operate as this, but it does not work (reference, the formula is on cell B2 of Table4):

= SUMPRODUCT ((((TABLE4!A2=TABLE3!B2:B5)*(TABLE3!A2:A5))=TABLE2!A1:D1)*TABLE2!B2:D5*TABLE1!B2:B5)

the formula works well until the TABLE2!A1:D1 (I tried also with transpose and arrays functions), but in the case of exemple 2 (repeat data) we got a N/A error.

My doubt is that in the case of looking for the result of (TABLE4!A2=TABLE3!B2:B5)*(TABLE3!A2:A5))=TABLE2!A1:D1) but moved for the exemple 2, the operator should lead to to do a comparison criteria with 2 horse powers on TABLE2!A1:D1. But it does not.

Do you have suggestions?
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
The vector headed with Electric Car in TABLE 2 consists of: 100%, 50%, nil, 10%. If this must be multiplied with the Year 1 vector of TABLE 1, which conists of 2, 4, 8, 11, we would get: 100% * 2 + 50% * 4 + 0% * 8 + 10% * 11, a different multiplication than yours: 100%*2 + 50% *4 + 100%*8. Any comments?
 
Upvote 0

Forum statistics

Threads
1,215,516
Messages
6,125,286
Members
449,218
Latest member
Excel Master

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