I'm using numbers to categorize items in a list, each with a $ amount.

Column A has a number, 1-15, depending on the item in column B. Column C has the cost of the item in column B.

I want to find the total cost of all the items with the number 1, same for number 2, and so on.


3 Answers 3


Use a Pivot Table - this tool is designed to solve just such tasks



You could try query() in this way:

=QUERY(B2:C,"select B, sum(C) where B is not null group by B label B 'item'")



Assuming your data is in A2:C with a header row on top of it in row 1, use query() like this:

=query(A1:C, "select A, sum(C) where A is not null group by A", 1)

The 1 specifies the number of header rows.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.