ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Remove duplicate rows based on 1 specific criterion (https://www.excelbanter.com/excel-discussion-misc-queries/107616-remove-duplicate-rows-based-1-specific-criterion.html)

Sweepea

Remove duplicate rows based on 1 specific criterion
 
Question:

A B
Apple 1/1/2004
Apple 2/1/2005 (to be deleted)
Orange 1/1/2004
Orange 2/1/2005(to be deleted)
Orange 3/1/2006(to be deleted)

I want to delete the duplicate rows based on column A. The rows to keep will
be the one with earliest date in column B.

Appreciate any help. Thank you.

Peo Sjoblom

Remove duplicate rows based on 1 specific criterion
 
datafilteradvanced filter, you need headers for both columns, then use a
formula as criteria

Assuming that the dates are in order first to last, assume the first fruit
is in A4 and the criteria range is F1:F2, leave F1 blank and put

=COUNTIF($A$4:A4,A4)=1

in F2

then apply the filter



--


Regards,

Peo Sjoblom

Excel 95 - Excel 2007
Northwest Excel Solutions
www.nwexcelsolutions.com
(remove ^^ from email)


"Sweepea" wrote in message
...
Question:

A B
Apple 1/1/2004
Apple 2/1/2005 (to be deleted)
Orange 1/1/2004
Orange 2/1/2005(to be deleted)
Orange 3/1/2006(to be deleted)

I want to delete the duplicate rows based on column A. The rows to keep
will
be the one with earliest date in column B.

Appreciate any help. Thank you.




Sweepea

Remove duplicate rows based on 1 specific criterion
 
Hi Peo,

I am sorry I can't quite get it. Please advise further.

I set it up this way and apply the filter but nothing happened.

Fruit Date
apple 1/1/04 TRUE (=COUNTIF($A$4:A4,A4)=1)
orange 1/1/04
apple 2/1/05
orange 2/1/05
orange 3/1/06

To reiterate, I want my final list to have

apple 1/1/04
orange 1/1/04

Thank you again.



Swee.



"Peo Sjoblom" wrote:

datafilteradvanced filter, you need headers for both columns, then use a
formula as criteria

Assuming that the dates are in order first to last, assume the first fruit
is in A4 and the criteria range is F1:F2, leave F1 blank and put

=COUNTIF($A$4:A4,A4)=1

in F2

then apply the filter



--


Regards,

Peo Sjoblom

Excel 95 - Excel 2007
Northwest Excel Solutions
www.nwexcelsolutions.com
(remove ^^ from email)


"Sweepea" wrote in message
...
Question:

A B
Apple 1/1/2004
Apple 2/1/2005 (to be deleted)
Orange 1/1/2004
Orange 2/1/2005(to be deleted)
Orange 3/1/2006(to be deleted)

I want to delete the duplicate rows based on column A. The rows to keep
will
be the one with earliest date in column B.

Appreciate any help. Thank you.





Sweepea

Remove duplicate rows based on 1 specific criterion
 
I couldn't eliminate one of the lines for apple. This is the result set I get:

Fruit Date
apple 1/1/04 TRUE
orange 1/1/04
apple 2/1/05





"Sweepea" wrote:

Hi Peo,

I am sorry I can't quite get it. Please advise further.

I set it up this way and apply the filter but nothing happened.

Fruit Date
apple 1/1/04 TRUE (=COUNTIF($A$4:A4,A4)=1)
orange 1/1/04
apple 2/1/05
orange 2/1/05
orange 3/1/06

To reiterate, I want my final list to have

apple 1/1/04
orange 1/1/04

Thank you again.



Swee.



"Peo Sjoblom" wrote:

datafilteradvanced filter, you need headers for both columns, then use a
formula as criteria

Assuming that the dates are in order first to last, assume the first fruit
is in A4 and the criteria range is F1:F2, leave F1 blank and put

=COUNTIF($A$4:A4,A4)=1

in F2

then apply the filter



--


Regards,

Peo Sjoblom

Excel 95 - Excel 2007
Northwest Excel Solutions
www.nwexcelsolutions.com
(remove ^^ from email)


"Sweepea" wrote in message
...
Question:

A B
Apple 1/1/2004
Apple 2/1/2005 (to be deleted)
Orange 1/1/2004
Orange 2/1/2005(to be deleted)
Orange 3/1/2006(to be deleted)

I want to delete the duplicate rows based on column A. The rows to keep
will
be the one with earliest date in column B.

Appreciate any help. Thank you.





Dave Peterson

Remove duplicate rows based on 1 specific criterion
 
How about just selecting column A and using data|filter|Advanced filter and
checking the box for unique records only.

Then copy the visible data to a new sheet.

This would depend on column B being in nice order so the top most "Apple" is
kept.

I'd sort the data by column A (ascending), then column B (ascending).

Debra Dalgleish explains it in more detail:
http://www.contextures.com/xladvfilter01.html#FilterUR

Sweepea wrote:

Question:

A B
Apple 1/1/2004
Apple 2/1/2005 (to be deleted)
Orange 1/1/2004
Orange 2/1/2005(to be deleted)
Orange 3/1/2006(to be deleted)

I want to delete the duplicate rows based on column A. The rows to keep will
be the one with earliest date in column B.

Appreciate any help. Thank you.


--

Dave Peterson

Sweepea

Remove duplicate rows based on 1 specific criterion
 
Thank you so much, Dave! This works!!



"Dave Peterson" wrote:

How about just selecting column A and using data|filter|Advanced filter and
checking the box for unique records only.

Then copy the visible data to a new sheet.

This would depend on column B being in nice order so the top most "Apple" is
kept.

I'd sort the data by column A (ascending), then column B (ascending).

Debra Dalgleish explains it in more detail:
http://www.contextures.com/xladvfilter01.html#FilterUR

Sweepea wrote:

Question:

A B
Apple 1/1/2004
Apple 2/1/2005 (to be deleted)
Orange 1/1/2004
Orange 2/1/2005(to be deleted)
Orange 3/1/2006(to be deleted)

I want to delete the duplicate rows based on column A. The rows to keep will
be the one with earliest date in column B.

Appreciate any help. Thank you.


--

Dave Peterson



All times are GMT +1. The time now is 04:27 AM.

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