Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 299
Default 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.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default 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.




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default 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.




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining Totals on Successive Rows Based on Two Criterion razorsharpe Excel Discussion (Misc queries) 1 August 18th 06 03:24 PM
Delete rows that don't meet specific criterion SITCFanTN New Users to Excel 5 June 5th 06 12:34 PM
Hide/Delete entire rows based in the content of one cell Clueless Excel Discussion (Misc queries) 2 October 3rd 05 02:40 PM
Insert duplicate rows based on numeric value in column Nu2Excel Excel Discussion (Misc queries) 2 September 24th 05 04:31 PM
Showing Duplicate Rows EaglesNest Excel Discussion (Misc queries) 4 March 26th 05 05:21 PM


All times are GMT +1. The time now is 09:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"