Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / November 2007

Tip: Looking for answers? Try searching our database.

How can I display doubles

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Henry88th - 06 Nov 2007 15:56 GMT
Hello all,

I have a worksheet with over 15,000 lines. I would like to be able to retain
only those lines which occur two or more times and simply get rid of the
rest. Any ideas?

Your input is greatly appreciated.
Peo Sjoblom - 06 Nov 2007 16:04 GMT
You can use a filter, in a help column put this formula assuming that your
data is A2:A15001 with a header in A1 insert a new column B unless it is
already free and in B2 put

=COUNTIF($A$2:$A$15001,A2)

copy down, you can double click the lower right corner of B2 once  you put
the formula there
and it will copy down automatically

then apply autofilter and filter custom greater or equal to 2 in the help
column,
then just copy and paste the filtered result to another sheet

Signature

Regards,

Peo Sjoblom

> Hello all,
>
[quoted text clipped - 4 lines]
>
> Your input is greatly appreciated.
Don Guillett - 06 Nov 2007 16:13 GMT
One way?

Sub keepif2()
For i = 15000 to 1 step -1
If Application.CountIf(Columns(1), Cells(i, "a")) _
    < 2 Then Rows(i).Delete
Next
End Sub

Signature

Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com

> Hello all,
>
[quoted text clipped - 4 lines]
>
> Your input is greatly appreciated.
Sandy Mann - 06 Nov 2007 16:15 GMT
Us a helper column and the formula:

=COUNTIF($A$2:$A$15000,A2)>1

and copy down all 1500 rows which will return TRUE or FALSE .   Then
Autofilter on False and delete the visible rows

Signature

HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

sandymann2@mailinator.com
Replace @mailinator.com with @tiscali.co.uk

> Hello all,
>
[quoted text clipped - 4 lines]
>
> Your input is greatly appreciated.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.