sum cells compare cells

K

KenB

How do I sum values for a column where column 1 matches column 2 cells. The
sum value is in column 3. Example:
col1 col2 col3
9B 9b 15
AA BB 7
dd dd 9
24 Total sum where values are =.
Also, do the same totals on another sheet without repeating col1. In other
words sheet2 has only cols 2 & col3. I am sure this is simple. But I am new
to Excel. Thanks.
 
D

Domenic

KenB said:
How do I sum values for a column where column 1 matches column 2 cells. The
sum value is in column 3. Example:
col1 col2 col3
9B 9b 15
AA BB 7
dd dd 9
24 Total sum where values are =.
Try...

=SUMPRODUCT(--(A1:A3=B1:B3),C1:C3)

Also, do the same totals on another sheet without repeating col1. In other
words sheet2 has only cols 2 & col3. I am sure this is simple. But I am new
to Excel.

Can you elaborate?
 
B

Bob Phillips

=SUMPRODUCT(--(A1:A20=B1:B20),C1:C20)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
K

KenB

The sumproduct did not work. column 1 contains text correct answers, column2
contains answers to match to column 2, column 3 contains values that I want
to sum for the entire columns if col1 =col2. example: column total = sum of
all col3 values where col1 =col2. Each col has several rows. The 2nd part was
col2 & col3 are on other sheets but the correct answers(col1) are the same.
Thanks
 
D

Domenic

If I now understand you correctly, assuming that Sheet2!A2:B4 contains...

9b 15
BB 7
dd 9

....and Sheet1!A2:A4 contains...

9B
AA
dd

....try the following formula...

=SUMPRODUCT(SUMIF(Sheet2!$A$2:$A$4,Sheet1!A2:A4,Sheet2!$B$2:$B$4))

If this is not what you're looking for, can you elaborate?
 

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