Help with a formula in Excel

rogerfoster88

New Member
Joined
May 17, 2019
Messages
18
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.
DescriptionExample 1
Column CColumn DColumn EColumn FColumn GColumn CColumn DColumn EColumn FColumn G
1ProductVolumeProductTotal Volume1ProductVolumeProductTotal Volume
2Aaa9000Product name hereFormula here2Aaa7000Aaa7000
3Bbb90003Bbb9000
4Bbb90004Bbb9000
5Ccc90005Ccc9000
6Ccc50006Ccc5000
Example 2Example 3
Column CColumn DColumn EColumn FColumn GColumn CColumn DColumn EColumn FColumn G
1ProductVolumeProductTotal Volume1ProductVolumeProductTotal Volume
2Aaa7000Bbb180002Aaa7000Ccc14000
3Bbb90003Bbb9000
4Bbb90004Bbb9000
5Ccc90005Ccc9000
6Ccc50006Ccc5000
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.
Thanks in advanced for looking into this.

<tbody>
</tbody>
 

Some videos you may like

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
46,339
Office Version
  1. 365
Platform
  1. Windows
How about

<b>Excel 2013/2016</b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>C</th><th>D</th><th>E</th><th>F</th><th>G</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">1</td><td style=";">Product</td><td style=";">Volume</td><td style="text-align: right;;"></td><td style=";">Product</td><td style=";">Total Volume</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">2</td><td style=";">Aaa</td><td style="text-align: right;;">9000</td><td style="text-align: right;;"></td><td style=";">Bbb</td><td style="text-align: right;;">18000</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">3</td><td style=";">Bbb</td><td style="text-align: right;;">9000</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">4</td><td style=";">Bbb</td><td style="text-align: right;;">9000</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">5</td><td style=";">Ccc</td><td style="text-align: right;;">9000</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">6</td><td style=";">Ccc</td><td style="text-align: right;;">5000</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr></tbody></table><p style="width:9.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">Booking Data</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: rgb(255,255,255)" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">G2</th><td style="text-align:left">=SUMIF(<font color="Blue">C:C,F2,D:D</font>)</td></tr></tbody></table></td></tr></table><br />
 

rogerfoster88

New Member
Joined
May 17, 2019
Messages
18
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?

Column CColumn DColumn EColumn FColumn GColumn HColumn I
1ProductVolumeProductVolume ProductTotal Volume
2Aaa9000Aaa9000 Product name hereformula here
3Bbb9000Bbb9000
4Bbb9000EMPTY
CELL

EMPTY
CELL

5Ccc9000Ccc1
6Ccc5000Ccc5000

<colgroup><col><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
46,339
Office Version
  1. 365
Platform
  1. Windows
Add 2 sumif together like

<b>Excel 2013/2016</b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /><col /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>C</th><th>D</th><th>E</th><th>F</th><th>G</th><th>H</th><th>I</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">1</td><td style=";">Product</td><td style=";">Volume</td><td style=";">Product</td><td style=";">Volume</td><td style="text-align: right;;"></td><td style=";">Product</td><td style=";">Total Volume</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">2</td><td style=";">Aaa</td><td style="text-align: right;;">9000</td><td style=";">Aaa</td><td style="text-align: right;;">9000</td><td style="text-align: right;;"></td><td style=";">Ccc</td><td style="text-align: right;;">19001</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">3</td><td style=";">Bbb</td><td style="text-align: right;;">9000</td><td style=";">Bbb</td><td style="text-align: right;;">9000</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">4</td><td style=";">Bbb</td><td style="text-align: right;;">9000</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">5</td><td style=";">Ccc</td><td style="text-align: right;;">9000</td><td style=";">Ccc</td><td style="text-align: right;;">1</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">6</td><td style=";">Ccc</td><td style="text-align: right;;">5000</td><td style=";">Ccc</td><td style="text-align: right;;">5000</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr></tbody></table><p style="width:9.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">Booking Data</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: rgb(255,255,255)" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">I2</th><td style="text-align:left">=SUMIF(<font color="Blue">C:C,H2,D:D</font>)+SUMIF(<font color="Blue">E:E,H2,F:F</font>)</td></tr></tbody></table></td></tr></table><br />
 

rogerfoster88

New Member
Joined
May 17, 2019
Messages
18

ADVERTISEMENT

Hi Fluff,

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

Excel 2013/2016
CDEFGHI
1ProductVolumeProductVolumeProductTotal Volume
2Aaa9000Aaa9000Ccc19001
3Bbb9000Bbb9000
4Bbb9000
5Ccc9000Ccc1
6Ccc5000Ccc5000

<colgroup><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</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.
 

rogerfoster88

New Member
Joined
May 17, 2019
Messages
18

ADVERTISEMENT

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.
 

JackDanIce

Well-known Member
Joined
Feb 3, 2010
Messages
9,684
Office Version
  1. 365
Platform
  1. Windows
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:

Watch MrExcel Video

Forum statistics

Threads
1,109,009
Messages
5,526,258
Members
409,689
Latest member
martin_br

This Week's Hot Topics

Top