Multiply 2 SUMPRODUCT arrays with a 3rd array of different size

cgcamal

Active Member
Joined
May 2, 2007
Messages
472
Hi everyone,

I know if I multiply arrays of different size the result is an error, but in this
case is something like to try to generate
an array of the same size that those within the SUMPRODUCT formula.

I have the data and formula as you can see below. The formula looks for values in column D that match within column A and
sums their respective value in column B. The formula I have in G2 does that fine, but I still don't know how to multiply the
respective Quantity in column E by value in B of selected Type that is matched in A.


In the example below, the result should be {3;5;2}{2;1;4}=19 as in H2
, the thing is the original arrays in SUMPRODUCT
contain 10 elements and not 3.


* The values in D and E change depending which Types select users and how many of each one they buy(quantity).
Excel Workbook
ABCDEFGH
1Type AvailableValueTypes SelectedQuantitySub TotalTotal
2Type11Type221019
3Type23Type51
4Type34Type94
5Type41
6Type55
7Type61
8Type75
9Type86
10Type92
11Type101
...
Excel 2010
Cell Formulas
RangeFormula
G2=SUMPRODUCT(--(ISNUMBER(MATCH(INDEX($A$2:$B$11,,1),D$2:D$4,0))),INDEX($A$2:$B$11,,2))


Many thanks in advance for any help.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
In G2, the formula =SUMPRODUCT(SUMIF(A2:A11,D2:D4,B2:B11))
In H2, the formula =SUMPRODUCT(SUMIF(A2:A11,D2:D4,B2:B11), E2:E4)
 
Upvote 0
Hi everyone,

I know if I multiply arrays of different size the result is an error, but in this
case is something like to try to generate
an array of the same size that those within the SUMPRODUCT formula.

I have the data and formula as you can see below. The formula looks for values in column D that match within column A and
sums their respective value in column B. The formula I have in G2 does that fine, but I still don't know how to multiply the
respective Quantity in column E by value in B of selected Type that is matched in A.


In the example below, the result should be {3;5;2}{2;1;4}=19 as in H2
, the thing is the original arrays in SUMPRODUCT
contain 10 elements and not 3.


* The values in D and E change depending which Types select users and how many of each one they buy(quantity).
Excel Workbook
ABCDEFGH
1Type AvailableValueTypes SelectedQuantitySub TotalTotal
2Type11Type221019
3Type23Type51
4Type34Type94
5Type41
6Type55
7Type61
8Type75
9Type86
10Type92
11Type101
...
Excel 2010
Cell Formulas
RangeFormula
G2=SUMPRODUCT(--(ISNUMBER(MATCH(INDEX($A$2:$B$11,,1),D$2:D$4,0))),INDEX($A$2:$B$11,,2))


Many thanks in advance for any help.
Try...

=SUMPRODUCT(SUMIF(D2:D4,A2:A11,E2:E4),B2:B11)
 
Upvote 0
Many thanks for your help Mike and Aladin, much much more easy that I was trying and thinking :laugh:.

Much appreciated.

Best regards.
 
Upvote 0

Forum statistics

Threads
1,224,516
Messages
6,179,231
Members
452,898
Latest member
Capolavoro009

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