Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 229
Default Sum unique values based on criteria

Hi all
The following is my data
Name Code amount
John Red 3,700
Smith Red 3,700
Apple Brown 2,100
Orange Brown 2,100
James Green 37,500
Hick Green 37,500
Asish Yellow 2,100
David Yellow 2,100
Gomes Yellow 2,100
Lorry 3,700
Jain 3,700

I want to sum all the amounts for unique code values. e.g.
red+brown+green+yellow = 3700 +2100 +37500 + 2100 = 45400.
My data is not sorted on code.
For code = "", i can get the sum using sumproduct.
Any suggestions
Regards
Sreedhar
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Sum unique values based on criteria

One way:

=SUMIF(B2:B12,"<",C2:C12)

Hope this helps.

Pete

On Apr 28, 11:32*am, yshridhar
wrote:
Hi all
The following is my data
Name * *Code * *amount
John * *Red * * *3,700
Smith * Red * * *3,700
Apple * Brown * *2,100
Orange *Brown * *2,100
James * Green * *37,500
Hick * *Green * *37,500
Asish * Yellow * 2,100
David * Yellow * 2,100
Gomes * Yellow * 2,100
Lorry * * * * * *3,700
Jain * * * * * * 3,700

I want to sum all the amounts for unique code values. *e.g.
red+brown+green+yellow = 3700 +2100 +37500 + 2100 = 45400.
My data is not sorted on code.
For code = "", i can get the sum using sumproduct.
Any suggestions
Regards
Sreedhar


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 265
Default Sum unique values based on criteria

Assuming that A2:C12 contains the data, try the following formula that
needs to be confirmed with CONTROL+SHIFT+ENTER...

=SUM(IF(FREQUENCY(IF(B2:B12<"",MATCH("~"&B2:B12,B 2:B12&"",0)),ROW(B2:B12
)-ROW(B2)+1),C2:C12))

Hope this helps!

In article ,
yshridhar wrote:

Hi all
The following is my data
Name Code amount
John Red 3,700
Smith Red 3,700
Apple Brown 2,100
Orange Brown 2,100
James Green 37,500
Hick Green 37,500
Asish Yellow 2,100
David Yellow 2,100
Gomes Yellow 2,100
Lorry 3,700
Jain 3,700

I want to sum all the amounts for unique code values. e.g.
red+brown+green+yellow = 3700 +2100 +37500 + 2100 = 45400.
My data is not sorted on code.
For code = "", i can get the sum using sumproduct.
Any suggestions
Regards
Sreedhar

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Sum unique values based on criteria

Try this:

=SUMPRODUCT((Code<"")/COUNTIF(Code,Code&"")*amount)


"yshridhar" wrote:

Hi all
The following is my data
Name Code amount
John Red 3,700
Smith Red 3,700
Apple Brown 2,100
Orange Brown 2,100
James Green 37,500
Hick Green 37,500
Asish Yellow 2,100
David Yellow 2,100
Gomes Yellow 2,100
Lorry 3,700
Jain 3,700

I want to sum all the amounts for unique code values. e.g.
red+brown+green+yellow = 3700 +2100 +37500 + 2100 = 45400.
My data is not sorted on code.
For code = "", i can get the sum using sumproduct.
Any suggestions
Regards
Sreedhar

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 229
Default Sum unique values based on criteria

Thanks Mama. It works like a charm.
Regards
Sreedhar

"Teethless mama" wrote:

Try this:

=SUMPRODUCT((Code<"")/COUNTIF(Code,Code&"")*amount)


"yshridhar" wrote:

Hi all
The following is my data
Name Code amount
John Red 3,700
Smith Red 3,700
Apple Brown 2,100
Orange Brown 2,100
James Green 37,500
Hick Green 37,500
Asish Yellow 2,100
David Yellow 2,100
Gomes Yellow 2,100
Lorry 3,700
Jain 3,700

I want to sum all the amounts for unique code values. e.g.
red+brown+green+yellow = 3700 +2100 +37500 + 2100 = 45400.
My data is not sorted on code.
For code = "", i can get the sum using sumproduct.
Any suggestions
Regards
Sreedhar

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count Unique records based on the Criteria in another colum Ron Coderre Excel Worksheet Functions 0 November 29th 06 06:28 PM
Count unique values based on multiple criteria Nip Excel Discussion (Misc queries) 2 November 2nd 06 03:41 AM
how to count unique values in excel based on multiple criteria IDBUGM Excel Worksheet Functions 3 March 15th 06 04:00 PM
Count unique values and create list based on these values vipa2000 Excel Worksheet Functions 7 August 5th 05 01:17 AM
how to count unique values in excel based on criteria Jorge Excel Worksheet Functions 2 April 13th 05 02:56 PM


All times are GMT +1. The time now is 01:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"