# Count unique entries

#### frankerrington

##### New Member
A column has 26,000 entries. Many are repeats. I'd like to count just the unique occurrences

### Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

##### MrExcel MVP
On 2002-10-21 16:06, frankerrington wrote:
A column has 26,000 entries. Many are repeats. I'd like to count just the unique occurrences

In ascending order of preference...

If there are no formula generated blanks among your entries, use:

=COUNTDIFF(Range)

where Range refers to the range that houses those 26K entries.

http://longre.free.fr/english/index.html

A costly alternative is the following array-formula...

=SUM(IF(LEN(Range),1/COUNTIF(Range,Range)))

To array-enter a formula, you need to hit control+shift+enter at the same time, not just enter.

#### Corticus

##### Well-known Member

(I was already done with my solution when the first one popped up, so here's mine too)

I set up a sheet as follows:
CountUnique.xls
ABCD
1AAUnique
2CC10
3DD
4FF
5FS
6SE
7EW
8WR
9DT
10FG
11D
12E
13W
14R
15T
16F
17G
18D
19D
Sheet1

Then put the following code behind the sheet:
Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False

Application.EnableEvents = True
End Sub

HTH,
Corticus
This message was edited by Corticus on 2002-10-21 16:22

#### frankerrington

##### New Member
Got it! Thanks for all your help!

#### Mark W.

##### MrExcel MVP
On 2002-10-21 16:06, frankerrington wrote:
A column has 26,000 entries. Many are repeats. I'd like to count just the unique occurrences

If your column (e.g., A:A) consists only of numeric values you could employ the following array formula...

{=COUNT(IF(FREQUENCY(A:A,A:A),1))}

Note: Array formulas must be entered using the Control+Shift+Enter key combination. The outermost braces, { }, are not entered by you -- they're supplied by Excel in recognition of a properly entered array formula. For more on array formulas see the Excel Help topic for "About array formulas and how to enter them".
This message was edited by Mark W. on 2002-10-21 16:54

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,168,037
Messages
5,856,967
Members
431,843
Latest member
Malahhai

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back