Sum if another column matches

S

sdm

I have a column A of numbers with a corresponding 2nd column B of amounts. If
the number in a cell of column A matches the number any another cells in
column A, I want to add the corresponding amount from column B into the cell
in column C. e.g.:
A B C
1 88 10 50
2 63 30 230
3 88 40 50
4 23 100 100
5 63 200 230

Stated differently:
- If there are no matches in column A, then the cell in column C gets just
the value from column B.

- If there are matching entries in column A, then I want all of the
corresponding values from column B summed into the cell in column C.

Am I making any sense? Thanks!
 
L

Lars-Åke Aspelin

I have a column A of numbers with a corresponding 2nd column B of amounts. If
the number in a cell of column A matches the number any another cells in
column A, I want to add the corresponding amount from column B into the cell
in column C. e.g.:
A B C
1 88 10 50
2 63 30 230
3 88 40 50
4 23 100 100
5 63 200 230

Stated differently:
- If there are no matches in column A, then the cell in column C gets just
the value from column B.

- If there are matching entries in column A, then I want all of the
corresponding values from column B summed into the cell in column C.

Am I making any sense? Thanks!


Try this formula in cell C1

=SUMPRODUCT((A$1:A$10=A1)*(B$1:B$10))

Copy down as far as needed

Hope this helps / Lars-Åke
 
B

Bob Phillips

=SUMIF(A:A,A1,B:B)

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top