Is there a macro which will sum cells

[Closed]
Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
Hi all

I wonder if you could help. I have a long grocery list which although I can sort alphabetically I am finding it difficult to sum similar grouped ingredients together. Is there a macro that could look up each ingredient in the list, find if the ingredient exists further down the list and add the quantites together? I don't know how to replace the ingredient name in the formula without manually overwritting it say from bacon to cheese, so it still takes ages to add all quantities of the same ingredient together.

Any help would be great.
Thanks
Nina

1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
How one can say that cheese and milk belong to same group or different ?

Any ways lets say if you have a sheet like this
Grocery Type -----Grocery-------------Cost 
dairy-----------------milk-----------------10 
dairy----------------- cheese------------20 
meat-----------------chicken-----------12 
dairy----------------- egg-----------------2 
meat-----------------beef---------------20 



Now to find cost of dairy products you can have this formula
=SUMIF(A:A,"=dairy ",C:C)