#1   Report Post  
Arturo
 
Posts: n/a
Default Unique Records

If I have a list of numbers
1
2
3
2
1
2

How would I generate a list unique records?
I.e.
2 of 1
3 of 2
1 of 3

  #2   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

Use datafilteradvanced filter, copy to another location and unique records
only, if you want to count the list use countif on the whole list with the
unique list as criteria

Whole list is A2:A400, unique list is H2:H40, in I2 put

=COUNTIF($A$2:$A$400,H2)

copy down as long as needed

Regards,

Peo Sjoblom


"Arturo" wrote:

If I have a list of numbers
1
2
3
2
1
2

How would I generate a list unique records?
I.e.
2 of 1
3 of 2
1 of 3

  #3   Report Post  
Ron de Bruin
 
Posts: n/a
Default

Hi Arturo

I like to add this to Peo's reply

You can also use a Pivot table
http://www.contextures.com/tiptech.html


Or with a macro this
With your data in Column A, it copy a Unique list in C
and count the Unique items in D

Sub Test()
UniqueList
CountUniqueItems
End Sub


Sub UniqueList()
'Cell A1 is a header
With Sheets("sheet1")
.Range("A1", .Cells(Rows.Count, "A").End(xlUp)) _
.AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=.Range("C1"), _
CriteriaRange:="", Unique:=True
End With
End Sub

Sub CountUniqueItems()
Dim cell As Range
With Sheets("sheet1")
For Each cell In .Range("C2", .Cells(Rows.Count, "C").End(xlUp))
cell.Offset(0, 1) = Application.WorksheetFunction.CountIf _
(.Range("A2", .Cells(Rows.Count, "A").End(xlUp)), cell.Value)
Next
End With
End Sub

Sub Test()
UniqueList
CountUniqueItems
End Sub



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Peo Sjoblom" wrote in message ...
Use datafilteradvanced filter, copy to another location and unique records
only, if you want to count the list use countif on the whole list with the
unique list as criteria

Whole list is A2:A400, unique list is H2:H40, in I2 put

=COUNTIF($A$2:$A$400,H2)

copy down as long as needed

Regards,

Peo Sjoblom


"Arturo" wrote:

If I have a list of numbers
1
2
3
2
1
2

How would I generate a list unique records?
I.e.
2 of 1
3 of 2
1 of 3



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding Unique Values in Column Kirk P. Excel Discussion (Misc queries) 1 January 25th 05 02:01 PM
find rows for unique data in 1 column and different data in other. Dot Majewski Excel Discussion (Misc queries) 1 January 21st 05 12:23 AM
In column A I have duplicate records. How do I tag an unique reco. Tian Excel Discussion (Misc queries) 2 January 13th 05 07:37 PM
UNIQUE GERRYM Excel Worksheet Functions 1 November 11th 04 05:15 PM
unique records Pyotr Excel Worksheet Functions 1 November 4th 04 02:59 PM


All times are GMT +1. The time now is 06:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"