Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting unique values in a range 1

Status
Not open for further replies.

jluft

Technical User
Joined
May 4, 2004
Messages
74
Location
US
all,

wondering if there is a FUNCTION (not vba) in excel that retruns a value representative of the unique values exisitng in a range....i know how to do this in vba but would prefer a function which is why i ask

for example, in the range containing the following array of #s (1,2,3,4,1,2,3,4) it would only return 4 because it does not count the duplicates twice (only unique instances of a value)....thanks a lot
 

For numbers:

=SUM(IF(FREQUENCY(A1:A10,A1:A10)>0,1))

For numbers and text:

=SUM(IF(FREQUENCY(MATCH(A1:A10,A1:A10,0),MATCH(A1:A10,A1:A10,0)>0,1))

Software: XL2002 on Win2K
Humanware: Older than dirt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top