Sum Product

  • Thread starter Thread starter flds
  • Start date Start date
F

flds

Hi

I have a problem creating a formula, can someone help.

I have a Column A with duplicate codes, in Column B with values for
each code.
I need to Sum the values of similar codes and enter into Column C same
row where the first unique occurrence appear in Column A.

Example
Code, Count, Result
AC, 1, 3
AC, 2,
ACU, 1, 9
ACU, 2,
ACU, 4,
ACU, 2,
AFU, 1, 5
AFU, 4,
AFU, 4,

I would appreciate if someone helps me with this formula.

Thanks in advance

FLDS
 
flds,

In C2, enter

=IF(COUNTIF($A$1:A2,A2)=1,SUMPRODUCT(($A$2:$A$1000=A2)*($B$2:$B$1000)),"")

then copy down to match column A. Increase the 1000 if you have more than 1000 rows of data.

HTH,
Bernie
MS Excel MVP
 
Here's another one. Assuming your data starts on row 2.

=IF(A2<>A1,SUMIF(A$2:A$10,A2,B$2:B$10),"")

BTW, your results should be 3,9,9
 
Back
Top