ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Counting unique entries in a field (https://www.excelbanter.com/excel-worksheet-functions/207390-counting-unique-entries-field.html)

Jeff Whitesel

Counting unique entries in a field
 
I have a spreadsheet that is 6 columns by 58000 rows. In this spreadsheet I filter data. However I want to count the number of unique entries in a list (that are not the same). See example:

ORDER RDATE RTIME PHL SQA# FDATE
XHGB 8/18/08 5:00 JW F15031 8/18/08
XWBC 8/18/08 5:05 JW F15031 8/18/08
XHCT 8/19/08 7:05 LW S15033 8/19/08
XALT 8/20/08 11:24 FS W13055 8/20/08

I am counting the number of unique entries by the SQA# field (which should be 3). What is the best way to pull this data for 58000 entries if sorting by the SQA#? Thanks

N Harkawat

Counting unique entries in a field
 
Use Pivot table.

"Jeff Whitesel" wrote:

I have a spreadsheet that is 6 columns by 58000 rows. In this spreadsheet I filter data. However I want to count the number of unique entries in a list (that are not the same). See example:

ORDER RDATE RTIME PHL SQA# FDATE
XHGB 8/18/08 5:00 JW F15031 8/18/08
XWBC 8/18/08 5:05 JW F15031 8/18/08
XHCT 8/19/08 7:05 LW S15033 8/19/08
XALT 8/20/08 11:24 FS W13055 8/20/08

I am counting the number of unique entries by the SQA# field (which should be 3). What is the best way to pull this data for 58000 entries if sorting by the SQA#? Thanks


TomPl

Counting unique entries in a field
 
Maybe not the best solution, but you could use <Data<Filter<Advanced
Filter to copy a list of unique values to a different location. Then you
could count the new list.

Tom

Spiky

Counting unique entries in a field
 
Another way would be to download "morefunc" UDFs and install it. (just
Google it) Use their function COUNTDIFF to give the number of unique
entries.

ShaneDevenshire

Counting unique entries in a field
 
Hi,

The formula to do this is
=SUMPRODUCT(1/COUNTIF(A1:A58000,A1:58000))

Adjust the references for the column containing your data.

If this helps, please click the Yes button.

--
Thanks,
Shane Devenshire


"Jeff Whitesel" wrote:

I have a spreadsheet that is 6 columns by 58000 rows. In this spreadsheet I filter data. However I want to count the number of unique entries in a list (that are not the same). See example:

ORDER RDATE RTIME PHL SQA# FDATE
XHGB 8/18/08 5:00 JW F15031 8/18/08
XWBC 8/18/08 5:05 JW F15031 8/18/08
XHCT 8/19/08 7:05 LW S15033 8/19/08
XALT 8/20/08 11:24 FS W13055 8/20/08

I am counting the number of unique entries by the SQA# field (which should be 3). What is the best way to pull this data for 58000 entries if sorting by the SQA#? Thanks


JMB

Counting unique entries in a field
 
You could use
=Sumproduct((E1:E58000<"")/Countif(E1:E58000, E1:E58000))

But a user defined function would be faster for a range that size. Here is
a UDF supplied by Charles Williams
http://msdn.microsoft.com/en-us/library/aa730921.aspx


Public Function COUNTU(theRange As Range) As Variant
Dim colUniques As New Collection
Dim vArr As Variant
Dim vCell As Variant
Dim vLcell As Variant
Dim oRng As Range

Set oRng = Intersect(theRange, theRange.Parent.UsedRange)
vArr = oRng
On Error Resume Next
For Each vCell In vArr
If vCell < vLcell Then
If Len(CStr(vCell)) 0 Then
colUniques.Add vCell, CStr(vCell)
End If
End If
vLcell = vCell
Next vCell

COUNTU = colUniques.Count
End Function


"Jeff Whitesel" wrote:

I have a spreadsheet that is 6 columns by 58000 rows. In this spreadsheet I filter data. However I want to count the number of unique entries in a list (that are not the same). See example:

ORDER RDATE RTIME PHL SQA# FDATE
XHGB 8/18/08 5:00 JW F15031 8/18/08
XWBC 8/18/08 5:05 JW F15031 8/18/08
XHCT 8/19/08 7:05 LW S15033 8/19/08
XALT 8/20/08 11:24 FS W13055 8/20/08

I am counting the number of unique entries by the SQA# field (which should be 3). What is the best way to pull this data for 58000 entries if sorting by the SQA#? Thanks



All times are GMT +1. The time now is 04:03 AM.

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