Solved

Removing Duplicates From A List

Posted on 2014-01-29
6
228 Views
Last Modified: 2014-01-30
I have a list that i need to remove all Duplicates, if I find any,

example
List
1
1
2
3
3
4
5
5

Goal
2
4

I have open office calc and I have Notepadd++

Thank you in advance.
0
Comment
Question by:U_S_A
6 Comments
 
LVL 23

Accepted Solution

by:
NBVC earned 500 total points
ID: 39819297
Assuming data in is A2 down.. then in B2 add a helper formula:

=COUNTIF($A$2:$A$3;A2)=1

copied down

Then Select A1:B (last row) and go to Data|Filter|Autofilter.

Filter column B by 0 (False)

Select those rows, right click and delete rows.

Then remove the filter and delete column B
0
 
LVL 11

Expert Comment

by:Angelp1ay
ID: 39819298
Just add a count column next to your list in Excel with the formula:
=COUNTIF(A:A,A2)

Open in new window

Column with Counts
Then apply filters and select only 1 in the count column:
FilterResultExample.xlsx
0
 
LVL 2

Expert Comment

by:bearblack
ID: 39819353
Dim Rw As Double, WS As Worksheet

Sub Keep_Unique()

    Set WS = Sheets("Sheet1")
    
    Rw = WS.Cells(Rows.Count, 1).End(xlUp).Row

    WS.Cells(1, 1).Value = "Values"
    WS.Range(WS.Cells(2, 2), WS.Cells(Rw, 2)).FormulaR1C1 "=IF(OR(RC[-1]=R[-1]C[-1],RC[-1]=R[1]C[-1]),1,0)"
    WS.Range(WS.Cells(1, 1), WS.Cells(1, 2)).AutoFilter Field:=2, Criteria1:=1
    WS.Range(WS.Cells(2, 1), WS.Cells(Rw, 2)).SpecialCells(xlCellTypeVisible).EntireRow.Delete
    WS.Range(WS.Cells(1, 1), WS.Cells(Rw, 2)).AutoFilter
    WS.Columns(2).Delete
    
End Sub

Open in new window

End Sub
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 2

Expert Comment

by:bearblack
ID: 39819368
Sub Keep_Unique()

    Set WS = Sheets("Sheet1")
    
    Rw = WS.Cells(Rows.Count, 1).End(xlUp).Row

    WS.Cells(1, 1).Value = "Values"
    WS.Range(WS.Cells(1, 1), WS.Cells(Rw, 1)).Sort Key1:=WS.Cells(1, 1), Order1:=xlAscending, Header:=xlYes
    WS.Range(WS.Cells(2, 2), WS.Cells(Rw, 2)).FormulaR1C1 = "=IF(OR(RC[-1]=R[-1]C[-1],RC[-1]=R[1]C[-1]),1,0)"
    WS.Range(WS.Cells(1, 1), WS.Cells(1, 2)).AutoFilter Field:=2, Criteria1:=1
    WS.Range(WS.Cells(2, 1), WS.Cells(Rw, 2)).SpecialCells(xlCellTypeVisible).EntireRow.Delete
    WS.Range(WS.Cells(1, 1), WS.Cells(Rw, 2)).AutoFilter
    WS.Columns(2).Delete
    
End Sub

Open in new window

Forgot the line to properly sort
0
 
LVL 22

Expert Comment

by:Dreamboat
ID: 39819407
bearblack, does OO really support VBA? Now I have to go look...

I am assuming OO does not have the remove duplicates feature like Excel 2007 has.

Looks like it's got something, which is described here:

http://www.wikihow.com/Remove-Duplicates-in-Open-Office-Calc
0
 
LVL 2

Expert Comment

by:bearblack
ID: 39819453
Sorry -- Missed the OO part thanks for the catch
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now