View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bruno Campanini[_2_] Bruno Campanini[_2_] is offline
external usenet poster
 
Posts: 74
Default Get sum of values in a cell based on unique values in another cell

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.


+-------------------------------------------------------------------+
Filename: Example.zip |
Download: http://www.excelbanter.com/attachment.php?attachmentid=548|

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


_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(O FFSET(_R,,,ROW(_R)-CELL("row",_R)+1),_R)=1,COUNTIF(_R,"<"&_R)),ROW(IN DIRECT(ROW(A1)&":"&ROWS(_R)))),COUNTIF(_R,"<"&_R), 0)),"")}
FormulaArray

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

Bruno