0

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.

1

3 Answers 3

0

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

PivotTable

0

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'")

query

0

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.

2
  • OP said"I want to find the total cost of all the items", so I preferred (and I think it is better) to use column B and not A in the query, so that items appear in the result instead of numbers
    – Daniele
    Aug 16 at 8:14
  • Hmm... the OP also said "find the total cost of all the items with the number 1, same for number 2, and so on." Aug 16 at 8:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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