# Get sum of values in a cell based on unique values in another cell

S

#### Shorabh

Column A will contain Names
Column B will contain Different Amounts
I need Column C to contain the sum of Amounts for unique Names.

Some sample values are filled in Cell C( the way i require) in th
attachments.

Your help in this regard will be highly appreciated

+-------------------------------------------------------------------
|Filename: Example.zip
+-------------------------------------------------------------------

C

#### Claus Busch

Hi,

Am Mon, 20 Aug 2012 06:16:42 +0000 schrieb Shorabh:
Column A will contain Names
Column B will contain Different Amounts
I need Column C to contain the sum of Amounts for unique Names.

in C2:
=SUMIF(\$A\$2:\$A\$100,A2,\$B\$2:\$B\$100)
or
=SUMPRODUCT(--(\$A\$2:\$A\$100=A2),\$B\$2:\$B\$100)

Regards
Claus Busch

S

#### Spencer101

Shorabh;1604754 said:
Column A will contain Names
Column B will contain Different Amounts
I need Column C to contain the sum of Amounts for unique Names.

Some sample values are filled in Cell C( the way i require) in th
attachments.

Your help in this regard will be highly appreciated.

Hi,

Here is one way. Put the below formula into cell C2 and copy down a
needed.

*=IF(COUNTIF(A\$2:A2,A2)=1,SUMIF(A\$2:A\$63,A2,B\$2:B\$63),"")

+-------------------------------------------------------------------
+-------------------------------------------------------------------

B

#### Bruno Campanini

Shorabh formulated on Monday :
Column A will contain Names
Column B will contain Different Amounts
I need Column C to contain the sum of Amounts for unique Names.

Some sample values are filled in Cell C( the way i require) in the
attachments.

Your help in this regard will be highly appreciated.

+-------------------------------------------------------------------+
+-------------------------------------------------------------------+

_R = Range("A2:A63") in your Sheet.

In E2 down:
{=IF(ROW(A1)<=SUM(IF(LEN(_R)>0,1/COUNTIF(_R,_R))),INDEX(_R,MATCH(SMALL(IF(COUNTIF(OFFSET(_R,,,ROW(_R)-CELL("row",_R)+1),_R)=1,COUNTIF(_R,"<"&_R)),ROW(INDIRECT(ROW(A1)&":"&ROWS(_R)))),COUNTIF(_R,"<"&_R),0)),"")}
FormulaArray

In E2 down:
=SUMPRODUCT((_R=E2)*OFFSET(_R,,1))

Bruno