Formula to count unique values

RobinK

New Member
Joined
May 9, 2003
Messages
16
Is there a formula I can put in a cell to count the number of uniqe values/records in a column?

I know I can go thru the Advance Filter process to derive a unique list and then count the list but I was wondering if there is a formula I could use instead?
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
How about using COUNTIF workshhet function?
 
Upvote 0
You mean like countif A2<>A1? But what would the formula look likeI want to count a column range?
 
Upvote 0
The following formula was taken from Chip Pearsons website at this address: -

http://www.cpearson.com/excel/duplicat.htm

=SUM(IF(FREQUENCY(IF(LEN(Range1)>0,MATCH(Range1,Range1,0),""),
IF(LEN(Range1)>0,MATCH(Range1,Range1,0),""))>0,1))

The majority of the site is worth a look, it's saved me loads of time in the past and will probably continue to do so.

This assumes that you have given the range you want to check the name "Range1".

It also has to be entered as an array formula so after entering it press Ctrl & Shift & Enter together instead of just pressing enter.

Regards

Nick
 
Upvote 0
RobinK said:
Is there a formula I can put in a cell to count the number of uniqe values/records in a column?

I know I can go thru the Advance Filter process to derive a unique list and then count the list but I was wondering if there is a formula I could use instead?

=SUMPRODUCT((Range<>"")/(COUNTIF(Range,Range&"")))

Or, the faster...

=COUNTDIFF(Range)

if you don't have formula-blanks in Range. This function requires the morefunc add-in.
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,718
Members
448,986
Latest member
andreguerra

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