ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Removing duplicate rows (https://www.excelbanter.com/excel-discussion-misc-queries/163356-removing-duplicate-rows.html)

Jase4now

Removing duplicate rows
 
I need to remove entire rows if the cells in a particular column are the same.

I just want to keep one of the rows. I tried "UNIQUE RECORDS" in the
advanced filterin the DATA MENU, but it doesn't seem to work. I still have
all the duplicates.

Jase

Gary''s Student

Removing duplicate rows
 
Say we are interested in column B have have made sure there is a label cell
on the top:

item
dog
dog
hat
bat
hat
spat
bat

we want to drop the rows with duplicate dogs, etc.

In another column, say column C, put a label in C1 and in C2 enter:
1
In C3 enter:
=COUNTIF(B$2:$B3,B3) and copy down

We see:

item counts
dog 1
dog 2
hat 1
bat 1
hat 2
spat 1
bat 2

Use autofilter on column C to view only the 1's (first instance of any
duplicate):

item counts
dog 1
hat 1
bat 1
spat 1

Copy these visible rows and paste elsewhere.

--
Gary''s Student - gsnu200751


"Jase4now" wrote:

I need to remove entire rows if the cells in a particular column are the same.

I just want to keep one of the rows. I tried "UNIQUE RECORDS" in the
advanced filterin the DATA MENU, but it doesn't seem to work. I still have
all the duplicates.

Jase


Jase4now

Removing duplicate rows
 
This doesn't help. I need to DELETE or REMOVE, not hide the information.

"Gary''s Student" wrote:

Say we are interested in column B have have made sure there is a label cell
on the top:

item
dog
dog
hat
bat
hat
spat
bat

we want to drop the rows with duplicate dogs, etc.

In another column, say column C, put a label in C1 and in C2 enter:
1
In C3 enter:
=COUNTIF(B$2:$B3,B3) and copy down

We see:

item counts
dog 1
dog 2
hat 1
bat 1
hat 2
spat 1
bat 2

Use autofilter on column C to view only the 1's (first instance of any
duplicate):

item counts
dog 1
hat 1
bat 1
spat 1

Copy these visible rows and paste elsewhere.

--
Gary''s Student - gsnu200751


"Jase4now" wrote:

I need to remove entire rows if the cells in a particular column are the same.

I just want to keep one of the rows. I tried "UNIQUE RECORDS" in the
advanced filterin the DATA MENU, but it doesn't seem to work. I still have
all the duplicates.

Jase


Gary''s Student

Removing duplicate rows
 
I understand... The paste will not paste the hidden rows. They will be
removed.
--
Gary''s Student - gsnu200751


"Jase4now" wrote:

This doesn't help. I need to DELETE or REMOVE, not hide the information.

"Gary''s Student" wrote:

Say we are interested in column B have have made sure there is a label cell
on the top:

item
dog
dog
hat
bat
hat
spat
bat

we want to drop the rows with duplicate dogs, etc.

In another column, say column C, put a label in C1 and in C2 enter:
1
In C3 enter:
=COUNTIF(B$2:$B3,B3) and copy down

We see:

item counts
dog 1
dog 2
hat 1
bat 1
hat 2
spat 1
bat 2

Use autofilter on column C to view only the 1's (first instance of any
duplicate):

item counts
dog 1
hat 1
bat 1
spat 1

Copy these visible rows and paste elsewhere.

--
Gary''s Student - gsnu200751


"Jase4now" wrote:

I need to remove entire rows if the cells in a particular column are the same.

I just want to keep one of the rows. I tried "UNIQUE RECORDS" in the
advanced filterin the DATA MENU, but it doesn't seem to work. I still have
all the duplicates.

Jase



All times are GMT +1. The time now is 08:31 PM.

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