Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 80
Default count unique in one column based on two other columns

Consider the following data:

Year Code1 Code2
A B C
2008 123 08-22
2007 123 07-15
2008 123 08-56
2008 456 08-71
2007 456 07-02
2008 123 08-56

I want to return the count of unique entries for 2008 based on Code1=123
(ans=2; 08-22 and 08-56)

I understand, and am using, the {=COUNT(1/FREQUENCY........} array formula
with named ranges for Cols B & C but cannot seem to add that extra column for
the year.

thx,


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 20
Default count unique in one column based on two other columns

On 18 nov, 21:44, casey wrote:
Consider the following data:

Year * * * Code1 * Code2 * * *
* *A * * * * * B * * * * * C
2008 * * * 123 * * * 08-22
2007 * * * 123 * * * 07-15
2008 * * * 123 * * * 08-56
2008 * * * 456 * * * 08-71
2007 * * * 456 * * * 07-02
2008 * * * 123 * * * 08-56

I want to return the count of unique entries for 2008 based on Code1=123
(ans=2; 08-22 and 08-56)

I understand, and am using, the {=COUNT(1/FREQUENCY........} array formula
with named ranges for Cols B & C but cannot seem to add that extra column for
the year. *

thx,


Hello,

What about creating an intermediate column containing a formula that
concatenates the year and Code1 ?
Then you can count the number of entries of this new data.

HTH




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default count unique in one column based on two other columns

Assuming no empty cells in the range.

A10 = 2008
B10 = 123

Array entered** :

=COUNT(1/FREQUENCY(IF(A2:A7=A10,IF(B2:B7=B10,MATCH(C2:C7,C2 :C7,0))),ROW(C2:C7)-MIN(ROW(C2:C7))+1))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

--
Biff
Microsoft Excel MVP


"casey" wrote in message
...
Consider the following data:

Year Code1 Code2
A B C
2008 123 08-22
2007 123 07-15
2008 123 08-56
2008 456 08-71
2007 456 07-02
2008 123 08-56

I want to return the count of unique entries for 2008 based on Code1=123
(ans=2; 08-22 and 08-56)

I understand, and am using, the {=COUNT(1/FREQUENCY........} array formula
with named ranges for Cols B & C but cannot seem to add that extra column
for
the year.

thx,




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 80
Default count unique in one column based on two other columns

Biff,
Worked perfectly. Thanks as always.
casey

New1,
I'm sure yours would work but since i was most familiary with the
"COUNT(1/FREQUENCY..." formula, I used Biff's instead. Thanks, too, for your
response.
casey

"T. Valko" wrote:

Assuming no empty cells in the range.

A10 = 2008
B10 = 123

Array entered** :

=COUNT(1/FREQUENCY(IF(A2:A7=A10,IF(B2:B7=B10,MATCH(C2:C7,C2 :C7,0))),ROW(C2:C7)-MIN(ROW(C2:C7))+1))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

--
Biff
Microsoft Excel MVP


"casey" wrote in message
...
Consider the following data:

Year Code1 Code2
A B C
2008 123 08-22
2007 123 07-15
2008 123 08-56
2008 456 08-71
2007 456 07-02
2008 123 08-56

I want to return the count of unique entries for 2008 based on Code1=123
(ans=2; 08-22 and 08-56)

I understand, and am using, the {=COUNT(1/FREQUENCY........} array formula
with named ranges for Cols B & C but cannot seem to add that extra column
for
the year.

thx,





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default count unique in one column based on two other columns

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"casey" wrote in message
...
Biff,
Worked perfectly. Thanks as always.
casey

New1,
I'm sure yours would work but since i was most familiary with the
"COUNT(1/FREQUENCY..." formula, I used Biff's instead. Thanks, too, for
your
response.
casey

"T. Valko" wrote:

Assuming no empty cells in the range.

A10 = 2008
B10 = 123

Array entered** :

=COUNT(1/FREQUENCY(IF(A2:A7=A10,IF(B2:B7=B10,MATCH(C2:C7,C2 :C7,0))),ROW(C2:C7)-MIN(ROW(C2:C7))+1))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

--
Biff
Microsoft Excel MVP


"casey" wrote in message
...
Consider the following data:

Year Code1 Code2
A B C
2008 123 08-22
2007 123 07-15
2008 123 08-56
2008 456 08-71
2007 456 07-02
2008 123 08-56

I want to return the count of unique entries for 2008 based on
Code1=123
(ans=2; 08-22 and 08-56)

I understand, and am using, the {=COUNT(1/FREQUENCY........} array
formula
with named ranges for Cols B & C but cannot seem to add that extra
column
for
the year.

thx,









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 instances based on two columns [email protected] Excel Worksheet Functions 9 May 27th 07 01:49 AM
Count Unique records based on the Criteria in another colum Rajat Excel Worksheet Functions 1 December 1st 06 12:46 AM
Count Unique records based on the Criteria in another colum Rajat Excel Worksheet Functions 0 November 30th 06 03:43 AM
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


All times are GMT +1. The time now is 07:17 PM.

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

About Us

"It's about Microsoft Excel"