ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Get sum of values in a cell based on unique values in another cell (https://www.excelbanter.com/excel-worksheet-functions/446887-get-sum-values-cell-based-unique-values-another-cell.html)

Shorabh

Get sum of values in a cell based on unique values in another cell
 
1 Attachment(s)
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.

Claus Busch

Get sum of values in a cell based on unique values in another cell
 
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
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2

Spencer101

Quote:

Originally Posted by Shorabh (Post 1604754)
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.

Hi,

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

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

Bruno Campanini[_2_]

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




All times are GMT +1. The time now is 09:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com