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.

A
B
C
D
E
1
ITEM 1
ITEM 2
ITEM 3
ITEM 4
TOTAL PRICE
2
apple
apple
orange
banana
22
3
orange
apple
orange
banana
18
4
orange
apple
orange
grape
17

<tbody>
</tbody>

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

O
P
8
Item
Price
9
apple
6
10
orange
5
11
banana
2
12
grape
1

<tbody>
</tbody>

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

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
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,214,649
Messages
6,120,728
Members
448,987
Latest member
marion_davis

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