Count unique entries

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
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.

COUNTDIFF is part of the morefunc.xll add-in, downloadable from:

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.
 
Upvote 0
Without the add-in,

(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

Range("A:A").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range("B1"), Unique:=True

Application.EnableEvents = True
End Sub

HTH,
Corticus
This message was edited by Corticus on 2002-10-21 16:22
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,375
Messages
6,119,170
Members
448,870
Latest member
max_pedreira

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top