Sumproduct in a vertical column

Jwood

New Member
Joined
Dec 17, 2003
Messages
35
I know there's an easy way to do this, but I can't figure it out. I need sumproduct to work on two different data sets vertically. I usually do them where the criteria and data are in separate columns.
I've put a simplified example below. I'm getting tired of doing the formula I've been using because I'm always adding rows to it and i have to manually add them each time.


Column A Column B
1 Product A
2 Price $5.00
3 Mix 50.0%
4
5 Product B
6 Price $3.99
7 Mix 20.0%
8
9 Product C
10 Price $2.99
11 Mix 30.0%

$4.20

formula =(B2*B3)+(B6*B7)+(B10*B11)+ (blah * blah) + (yuck * yuck)+(this s*cks * this s*cks)
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
If you considered restricting your data, this wuld be much easier...
[Table="width:, class:grid"][tr][td] [/td][td]
A​
[/td][td]
B​
[/td][td]
C​
[/td][td]
D​
[/td][/tr]
[tr][td]
1​
[/td][td][/td][td]Price[/td][td]Mic[/td][td][/td][/tr]

[tr][td]
2​
[/td][td]Prod A[/td][td]
$5.00​
[/td][td]
50.00%​
[/td][td]
4.195​
[/td][/tr]

[tr][td]
3​
[/td][td]Prod B[/td][td]
$3.99​
[/td][td]
20.00%​
[/td][td][/td][/tr]

[tr][td]
4​
[/td][td]Prod C[/td][td]
$2.99​
[/td][td]
30.00%​
[/td][td][/td][/tr]
[/table]

D2=SUMPRODUCT(B2:B4*C2:C4)
 
Upvote 0
Yes, but it's an existing file that would be too much work to restructure. I would have to rework the entire model if I did that. I know there's a way to do it, I just can't find it.
 
Upvote 0
Maybe in the short term.

Anyway, try this...
[Table="width:, class:grid"][tr][td] [/td][td]
I​
[/td][td]
J​
[/td][td]
K​
[/td][/tr]
[tr][td]
1​
[/td][td]Product A[/td][td][/td][td][/td][/tr]

[tr][td]
2​
[/td][td]Price[/td][td]
$5.00​
[/td][td]
4.195​
[/td][/tr]

[tr][td]
3​
[/td][td]Mix[/td][td]
50.00%​
[/td][td][/td][/tr]

[tr][td]
4​
[/td][td][/td][td][/td][td][/td][/tr]

[tr][td]
5​
[/td][td]Product B[/td][td][/td][td][/td][/tr]

[tr][td]
6​
[/td][td]Price[/td][td]
$3.99​
[/td][td][/td][/tr]

[tr][td]
7​
[/td][td]Mix[/td][td]
20.00%​
[/td][td][/td][/tr]

[tr][td]
8​
[/td][td][/td][td][/td][td][/td][/tr]

[tr][td]
9​
[/td][td]Product C[/td][td][/td][td][/td][/tr]

[tr][td]
10​
[/td][td]Price[/td][td]
$2.99​
[/td][td][/td][/tr]

[tr][td]
11​
[/td][td]Mix[/td][td]
30.00%​
[/td][td][/td][/tr]
[/table]

K2=SUMPRODUCT(J2:J10*J3:J11)
Note the range offsets
 
Upvote 0
Thanks FDibbins. What you have would work perfect. However, I should have specified there is more data on rows under each product than just price and mix. There's costs, costs %, etc., I guess I simplified my example too much.
Need something that would specify to look at Price and Mix. Sorry, that's my bad. I wasn't thinking it would be as simple as what you said so I didn't specify much more than that.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,184
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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