Calc, Use LOOKUP to get SUM of all ResultVector from SearchCriterion

I have a table of expenses for my business. One column has categories and another column has prices. I would like to make totals for expenses in each category. When I use =LOOKUP(“cups & lids”,B2:B20,F2:F20) it just returns the price of the first item that matches “cups & lids.” Can I get the SUM of everything that matches LOOKUP’s SearchCriterion?

Is there a better function for this?

Hallo

For quick Overviews about all categories you should do it with the help of Datapilot aka Pivottable in roundabout 5 clicks

You can use the the SUMIF function. See help file for “sumif” and select Mathematical Function for details.

For above used example the function I assume that your have your categories in B2:B20 and the prices in F2:F20.

Then the formula should be: =sumif(B2:B20,“cups&lids”,F2:F20)

This is exactly what I was looking for. Thank you.