Solved

Removing Duplicates From A List

Posted on 2014-01-29
6
234 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

734 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