Count Unique Records

J

Jon Dow

I have the following table (Excel 2007)

Month Broker #
December 32350
December 32350
December 24715
January 24715
January 24715
January 44063

(table is a1:b7)
I want to search for a month and then count the unique records in column B.
So for the month of January, it would return 2 since one of the 3 records is
a duplicate. Any ideas?
 
T

Teethless mama

Try this:

=SUM(N(FREQUENCY(IF(A2:A7="January",B2:B7),B2:B7)>0))

ctrl+shift+enter, not just enter
 
T

T. Valko

Try this:

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

If there will be no empty cells in column B:

D2 = January

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

If there might be empty cells in column B:

=COUNT(1/FREQUENCY(IF((A2:A7=D2)*(B2:B7<>""),MATCH(B2:B7,B2:B7,0)),ROW(A2:A7)-MIN(ROW(A2:A7))+1))

Biff
 
J

Jon Dow

Wow that's great. Thanks. This Forum ROCKS!!

Teethless mama said:
Try this:

=SUM(N(FREQUENCY(IF(A2:A7="January",B2:B7),B2:B7)>0))

ctrl+shift+enter, not just enter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top