Database

PatrickTT

New Member
Joined
Oct 7, 2020
Messages
19
Office Version
  1. 365
Platform
  1. Windows
If I need to sum the values of each ingredient, and some ingredients are sourced from multiple suppliers, what is the easiest way to do this?

IngredientSupplierVolume
TomatoesJohnson & sons200
TomatoesMD supplies150
OrangesMD supplies10
ApplesTom's Fresh fruit & Veg20
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Please show us what you want the expected output (of your example above) to look like.
 
Upvote 0
Please don't mark a post as the solution if a solution has not been found yet!

One way would be to copy over the Ingredient column to another range, and then use the "Remove Duplicate" functionality to remove all duplicates.

Then, use a SUMIF formula to get the sum of each ingredient.
See: MS Excel: How to use the SUMIF Function (WS)
 
Upvote 0
Solution
An alternative means is with Power Query

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Volume", Int64.Type}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Ingredient"}, {{"Total", each List.Sum([Volume]), type nullable number}})
in
    #"Grouped Rows"
Book8
ABCDEF
1IngredientSupplierVolumeIngredientTotal
2TomatoesJohnson & sons200Tomatoes350
3TomatoesMD supplies150Oranges10
4OrangesMD supplies10Apples20
5ApplesTom's Fresh fruit & Veg20
Sheet1
 
Upvote 0
Please don't mark a post as the solution if a solution has not been found yet!

One way would be to copy over the Ingredient column to another range, and then use the "Remove Duplicate" functionality to remove all duplicates.

Then, use a SUMIF formula to get the sum of each ingredient.
See: MS Excel: How to use the SUMIF Function (WS)
Thanks, this worked perfectly! (PS didn't realise I had marked it as solved...)
 
Upvote 0
You are welcome.
Glad we were able to help!
 
Upvote 0

Forum statistics

Threads
1,215,563
Messages
6,125,568
Members
449,237
Latest member
Chase S

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