+ Reply to Thread
Results 1 to 4 of 4

Deleting Repeated Records based on date

  1. #1
    Registered User
    Join Date
    04-17-2010
    Location
    Brighton, UK
    MS-Off Ver
    Excel 2003
    Posts
    24

    Deleting Repeated Records based on date

    Hi All,

    I have a spreadsheet that has over a 1000 records. Some of the customer names are repeated because they have visited more than once over the past few years.

    I want to delete all of the historic data, just leaving the most recent data for each customer.

    I have attached an example spreadsheet, the ones in red are the records I want to delete, which would leave just the most recent records for each customer,

    Many thanks
    Attached Files Attached Files

  2. #2
    Administrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Deleting Repeated Records based on date

    1) Sort the data by Column A and then by Column B so the entries are grouped and in order by date
    2) In E1, put the work "KEY"
    3) In E2, put this formula and then copy down:
    =IF(COUNTIF($A$1:A2,A2)=COUNTIF(A:A,A2),"Keep","Delete")

    4) Click on E1
    5) Turn on the Data > Filter > Autofilter
    6) Use the drop down in E1 to filter for the word "Delete"
    7) Highlight all the remaining visible rows and delete them
    8) Turn off the Data > Filter > Autofilter to see the remaining rows.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    04-17-2010
    Location
    Brighton, UK
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: Deleting Repeated Records based on date

    Thanks for that, it worked perfectly!

  4. #4
    Administrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Deleting Repeated Records based on date

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1