+ Reply to Thread
Results 1 to 4 of 4

Filtering out Duplicate Records while Retaining Most RECENT Entry

  1. #1
    Registered User
    Join Date
    08-22-2011
    Location
    Harrisburg, PA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Filtering out Duplicate Records while Retaining Most RECENT Entry

    Hello all,

    Not sure if this is possible to do, but thought I would inquire. I have a large file (about 900 entries) with customers' first and last names and a history of ALL the orders that they have placed with us (Each unique order is an entry in the file). I want to filter the list down so that we have only one entry for the customer: their most RECENT order with us. Is there some function or formula I can use to do this? The only thing I can think to do is eyeball each customer and manually figure out which entry is their most recent order.

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Filtering out Duplicate Records while Retaining Most RECENT Entry

    For sake of discussion, I will assume customers are identified using a unique ID.

    If your data were in the range of A1:D900, and column-A is the customer ID, then possibly this approach may work for you.

    Make sure to work with a back up copy of the data.

    First, sort the entire data range based on date in ascending order.
    In a helper column, say column-E, enter this formula:

    =IF(COUNTIF($A$2:A2,A2)<>MAX(COUNTIF($A$2:$A$900,A2)),"",ROW())

    Copy the formula down the column.

    The formula counts the maximum number of times the unique ID appears in the list and compares it against the current incremental count.
    If the current count is less than then maximum occurrences then the formula returns a blank or the row number if current count equals the max.
    You could substitute ROW() for anything, like a text string of "most recent".

    Apply auto-filter to show blanks and delete the visible rows to retain only the most recent activity.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Registered User
    Join Date
    08-22-2011
    Location
    Harrisburg, PA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Filtering out Duplicate Records while Retaining Most RECENT Entry

    Thanks, Palmetto. I will try it out at work on Tuesday and let you know if it worked. Greatly appreciated.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Filtering out Duplicate Records while Retaining Most RECENT Entry

    assuming id in column a and dates in say col d sort the lot descending on column d
    then advanced filter col a on unique values
    or do the sort then use the remove duplicates feature in excel 2007 this assumes you date the entries!
    Last edited by martindwilson; 12-31-2011 at 10:22 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ 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