Sumif criteria "equal"

  • Thread starter Thread starter KB
  • Start date Start date
K

KB

Hello, I want to search column A, if the values in column A are equal, I
want to sum the corresponding values in column D. I've tried the following
formula and it does not work:

=SUMIF(A5:A100,"=",D5:D100)

Could someone offer a suggestion for the correct "criteria" value?

Thanks
 
If the cells are equal to what?

If you want to get a subtotal of each column A value, use a Pivot Table
(Data > Pivot Table in Excel 2003) and drop your column A label into the row
field and column d in the Data field.
 
In addition to Sean's answer, you can pop this in an empty column (in row 5,
then autofill)

=sumproduct((A$5:A$100=A5)*1,(D$5:D$100)*1)

The problem is that for each matching value, you will get the same total
again. Example:
Column A Column D Result
"Cat" 10 14
"Dog" 6 6
"Cat" 4 14
"Fish" 2 2

So you can't really subtotal the result column in any meaningful way, unless
you copy/paste special/ values, then remove duplicate rows.
 
Back
Top