SUMIFS Question

kparadise

Board Regular
Joined
Aug 13, 2015
Messages
186
Hello,

I have a table that contains 5 different groups of items. Each of those items have a price, on a separate reference table. I am trying to determine the total price of each group using a formula.

[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A
[/TD]
[TD="align: center"]B
[/TD]
[TD="align: center"]C
[/TD]
[TD="align: center"]D
[/TD]
[TD="align: center"]E
[/TD]
[/TR]
[TR]
[TD="align: center"]1
[/TD]
[TD]ITEM 1
[/TD]
[TD]ITEM 2
[/TD]
[TD]ITEM 3
[/TD]
[TD]ITEM 4
[/TD]
[TD]TOTAL PRICE
[/TD]
[/TR]
[TR]
[TD="align: center"]2
[/TD]
[TD]apple
[/TD]
[TD]apple
[/TD]
[TD]orange
[/TD]
[TD]banana
[/TD]
[TD]22
[/TD]
[/TR]
[TR]
[TD="align: center"]3
[/TD]
[TD]orange
[/TD]
[TD]apple
[/TD]
[TD]orange
[/TD]
[TD]banana
[/TD]
[TD]18
[/TD]
[/TR]
[TR]
[TD="align: center"]4
[/TD]
[TD]orange
[/TD]
[TD]apple
[/TD]
[TD]orange
[/TD]
[TD]grape
[/TD]
[TD]17
[/TD]
[/TR]
</tbody>[/TABLE]

Reference table (this is on the same sheet. please follow the row and column headings)

[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]O
[/TD]
[TD="align: center"]P
[/TD]
[/TR]
[TR]
[TD="align: center"]8
[/TD]
[TD]Item
[/TD]
[TD]Price
[/TD]
[/TR]
[TR]
[TD="align: center"]9
[/TD]
[TD]apple
[/TD]
[TD]6
[/TD]
[/TR]
[TR]
[TD="align: center"]10
[/TD]
[TD]orange
[/TD]
[TD]5
[/TD]
[/TR]
[TR]
[TD="align: center"]11
[/TD]
[TD]banana
[/TD]
[TD]2
[/TD]
[/TR]
[TR]
[TD="align: center"]12
[/TD]
[TD]grape
[/TD]
[TD]1
[/TD]
[/TR]
</tbody>[/TABLE]

I would like to put a formula in E2, and drag it down.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
I can see how you calculate the prices for lines 3 and 4, but what about line 2, why is it 22 ?

Shouldn't it be 19 ?
Apple 6 + Apple 6 + Orange 5 + Banana 2 = 19 ?
 
Upvote 0
OK, do you only ever have 4 items per line, or could there be dozens / hundreds / thousands of items per line ?

If only ever 4, a simple multiple lookup will work.

Something like this
=vlookup(A2,O9:P12,2,false)+vlookup(B2,O9:P12,2,false) . . .
which covers it for the first two values, I'm sure you can figure out how to extend it to four items.
 
Upvote 0
I will have 10 items per line...I was hoping there was a fast SUMIFS formula, rather than doing an index/match + index/match + index/match + etc.
 
Upvote 0
I can't imagine how SUMIFS would be applied here.
I can imagine POSSIBLY using COUNTIF, but I personally would still use VLOOKUP, or, as you say, Index / Match.
 
Upvote 0
How about


Book1
ABCDEFGHIJKLMNOP
1ITEM 1ITEM 2ITEM 3ITEM 4TOTAL PRICEItemPrice
2appleappleorangebanana19apple6
3orangeappleorangebanana18orange5
4orangeappleorangegrape17banana2
5grape1
Test
Cell Formulas
RangeFormula
E2=SUMPRODUCT((A2:D2=$O$2:$O$5)*($P$2:$P$5))
 
Upvote 0
Something like this:

=SUM(IF(A2:D2=$O$9:$O$12, $P$9:$P$12, 0))

This is an array so entered with Ctrl + Shift + Enter.
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,206
Members
452,618
Latest member
Tam84

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