Help with a formula in Excel

rogerfoster88

New Member
Joined
May 17, 2019
Messages
18
[TABLE="width: 984"]
<tbody>[TR]
[TD="colspan: 13"]I am looking for a formula to go into G2 that finds the combined sum in column D that is adjacent to the product in column C, but for the choice of product to be dictated by the product name in F2. So the formula needs to be clever enough to change the volume if the name in F2 changes.[/TD]
[/TR]
[TR]
[TD="colspan: 6"]Description[/TD]
[TD][/TD]
[TD="colspan: 6"]Example 1[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Column C[/TD]
[TD]Column D[/TD]
[TD]Column E[/TD]
[TD]Column F[/TD]
[TD]Column G[/TD]
[TD][/TD]
[TD][/TD]
[TD]Column C[/TD]
[TD]Column D[/TD]
[TD]Column E[/TD]
[TD]Column F[/TD]
[TD]Column G[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Product[/TD]
[TD]Volume[/TD]
[TD][/TD]
[TD]Product[/TD]
[TD]Total Volume[/TD]
[TD][/TD]
[TD]1[/TD]
[TD]Product[/TD]
[TD]Volume[/TD]
[TD][/TD]
[TD]Product[/TD]
[TD]Total Volume[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Aaa[/TD]
[TD]9000[/TD]
[TD][/TD]
[TD]Product name here[/TD]
[TD]Formula here[/TD]
[TD][/TD]
[TD]2[/TD]
[TD]Aaa[/TD]
[TD]7000[/TD]
[TD][/TD]
[TD]Aaa[/TD]
[TD]7000[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Bbb[/TD]
[TD]9000[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]3[/TD]
[TD]Bbb[/TD]
[TD]9000[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Bbb[/TD]
[TD]9000[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]4[/TD]
[TD]Bbb[/TD]
[TD]9000[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Ccc[/TD]
[TD]9000[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]5[/TD]
[TD]Ccc[/TD]
[TD]9000[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Ccc[/TD]
[TD]5000[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]6[/TD]
[TD]Ccc[/TD]
[TD]5000[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 6"]Example 2[/TD]
[TD][/TD]
[TD="colspan: 6"]Example 3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Column C[/TD]
[TD]Column D[/TD]
[TD]Column E[/TD]
[TD]Column F[/TD]
[TD]Column G[/TD]
[TD][/TD]
[TD][/TD]
[TD]Column C[/TD]
[TD]Column D[/TD]
[TD]Column E[/TD]
[TD]Column F[/TD]
[TD]Column G[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Product[/TD]
[TD]Volume[/TD]
[TD][/TD]
[TD]Product[/TD]
[TD]Total Volume[/TD]
[TD][/TD]
[TD]1[/TD]
[TD]Product[/TD]
[TD]Volume[/TD]
[TD][/TD]
[TD]Product[/TD]
[TD]Total Volume[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Aaa[/TD]
[TD]7000[/TD]
[TD][/TD]
[TD]Bbb[/TD]
[TD]18000[/TD]
[TD][/TD]
[TD]2[/TD]
[TD]Aaa[/TD]
[TD]7000[/TD]
[TD][/TD]
[TD]Ccc[/TD]
[TD]14000[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Bbb[/TD]
[TD]9000[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]3[/TD]
[TD]Bbb[/TD]
[TD]9000[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Bbb[/TD]
[TD]9000[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]4[/TD]
[TD]Bbb[/TD]
[TD]9000[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Ccc[/TD]
[TD]9000[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]5[/TD]
[TD]Ccc[/TD]
[TD]9000[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Ccc[/TD]
[TD]5000[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]6[/TD]
[TD]Ccc[/TD]
[TD]5000[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 13"]I have used =Vlookup(F2,C1:G7,2,FALSE) and several iterations of it but I feel like vlookup isn't the answer for my question.[/TD]
[/TR]
[TR]
[TD="colspan: 13"]Thanks in advanced for looking into this.[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
How about


Excel 2013/2016
CDEFG
1ProductVolumeProductTotal Volume
2Aaa9000Bbb18000
3Bbb9000
4Bbb9000
5Ccc9000
6Ccc5000
Booking Data
Cell Formulas
RangeFormula
G2=SUMIF(C:C,F2,D:D)
 
Upvote 0
Oh man that worked thank you so much!

It's made me wonder if you could apply this to a 4 column rule instead of 2?

[TABLE="width: 608"]
<colgroup><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD][/TD]
[TD]Column C[/TD]
[TD]Column D[/TD]
[TD]Column E[/TD]
[TD]Column F[/TD]
[TD]Column G[/TD]
[TD]Column H[/TD]
[TD]Column I[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Product[/TD]
[TD]Volume[/TD]
[TD]Product[/TD]
[TD]Volume[/TD]
[TD] [/TD]
[TD]Product[/TD]
[TD]Total Volume[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Aaa[/TD]
[TD]9000[/TD]
[TD]Aaa[/TD]
[TD]9000[/TD]
[TD] [/TD]
[TD]Product name here[/TD]
[TD]formula here[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Bbb[/TD]
[TD]9000[/TD]
[TD]Bbb[/TD]
[TD]9000[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Bbb[/TD]
[TD]9000[/TD]
[TD]EMPTY
CELL[/TD]
[TD]
EMPTY
CELL

[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Ccc[/TD]
[TD]9000[/TD]
[TD]Ccc[/TD]
[TD]1[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Ccc[/TD]
[TD]5000[/TD]
[TD]Ccc[/TD]
[TD]5000[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Add 2 sumif together like


Excel 2013/2016
CDEFGHI
1ProductVolumeProductVolumeProductTotal Volume
2Aaa9000Aaa9000Ccc19001
3Bbb9000Bbb9000
4Bbb9000
5Ccc9000Ccc1
6Ccc5000Ccc5000
Booking Data
Cell Formulas
RangeFormula
I2=SUMIF(C:C,H2,D:D)+SUMIF(E:E,H2,F:F)
 
Upvote 0
Hi Fluff,

Thanks for your help on this, however i have come across an issue with it.

Excel 2013/2016
ProductVolumeProductVolumeProductTotal Volume
AaaAaaCcc
BbbBbb
Bbb
CccCcc
CccCcc

<colgroup><col><col><col><col><col><col><col><col></colgroup><thead>
[TH="align: center"][/TH]
[TH="align: center"]C[/TH]
[TH="align: center"]D[/TH]
[TH="align: center"]E[/TH]
[TH="align: center"]F[/TH]
[TH="align: center"]G[/TH]
[TH="align: center"]H[/TH]
[TH="align: center"]I[/TH]

</thead><tbody>
[TD="align: center"]1[/TD]

[TD="align: right"][/TD]

[TD="align: center"]2[/TD]

[TD="align: right"]9000[/TD]

[TD="align: right"]9000[/TD]
[TD="align: right"][/TD]

[TD="align: right"]19001[/TD]

[TD="align: center"]3[/TD]

[TD="align: right"]9000[/TD]

[TD="align: right"]9000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]4[/TD]

[TD="align: right"]9000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]5[/TD]

[TD="align: right"]9000[/TD]

[TD="align: right"]1[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]6[/TD]

[TD="align: right"]5000[/TD]

[TD="align: right"]5000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

</tbody>

What i forgot to mention was that C2:C6 and E2:E6 are Data Validation drop-down lists and for some reason the formula inst liking it, as when i manually type in the data for the product names the formula works.
 
Upvote 0
So what the issue seems to be is that even though i need =SUMIF(C:C,F2,D:D) i need it to only go from row 2 to 8 rather than reading the whole worksheet.
 
Upvote 0
Based on @Fluff's suggestion try:
Rich (BB code):
=SUMIF($C$2:$C$8,H2,$D$2:$D$8)+SUMIF($E$2:$E$8,H2,$F$2:$F$8)


 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,967
Messages
6,175,667
Members
452,666
Latest member
AllexDee

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