ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Counting Unique Values (https://www.excelbanter.com/excel-discussion-misc-queries/138528-counting-unique-values.html)

Paul Ferro

Counting Unique Values
 
I have a constant situation where I need to count the unique account #'s in
a column. For example, I might have a column that looks like this:

123155
684768
684768
165465
068589
068589
068589
015646

There are 8 account numbers listed, but only 5 unique numbers. What I have
been doing thus far is sorting the column (for example column A) then
putting the following formula all the way down column B:

if(a2=a1,"",a2)
if(a3=a2,"",a3)
etc...

Then, I can count all of the values in column B and it will give me the
unique account #'s.

Is there a better way to do this?

Thanks,
Paul



JMB

Counting Unique Values
 
If the data is in A1:A8, and there can be blank cells, try
=SUMPRODUCT((A1:A8<"")/COUNTIF(A1:A8,A1:A8&""))

If no blank cells, you could just try:
=SUMPRODUCT(1/COUNTIF(A1:A8,A1:A8))



"Paul Ferro" wrote:

I have a constant situation where I need to count the unique account #'s in
a column. For example, I might have a column that looks like this:

123155
684768
684768
165465
068589
068589
068589
015646

There are 8 account numbers listed, but only 5 unique numbers. What I have
been doing thus far is sorting the column (for example column A) then
putting the following formula all the way down column B:

if(a2=a1,"",a2)
if(a3=a2,"",a3)
etc...

Then, I can count all of the values in column B and it will give me the
unique account #'s.

Is there a better way to do this?

Thanks,
Paul





All times are GMT +1. The time now is 04:54 PM.

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