+ Reply to Thread
Results 1 to 3 of 3

Vlookup and duplicates

  1. #1
    Registered User
    Join Date
    10-19-2022
    Location
    Scottsdale, AZ
    MS-Off Ver
    365 Pro
    Posts
    7

    Vlookup and duplicates

    I have 2 spreadsheets, both with customer demographic information in them. The first is a "master" list that contains all customers and their corresponding information (Spreadsheet A) *each customer was assigned a unique id when created*. The second is a daily report that is run containing updated information for some of the customers (Spreadsheet B) this report is run daily and added to itself, or the previous day's report, so spreadsheet B is actually a compilation of daily reports that are run. Since spreadsheet B is compounding, it will have duplicate entries of customers and thier unique ID.
    After I add the report data to spreadsheet B, I use vlookup to search spreadsheet A for any customers that appear on spreadsheet B. Vlookup will then populate spreadsheet A with the information for that corresponding customer. The issue is, since the report is compounding and added to daily, the customers show up multiple times. I would like for vlookup to reference the most recent addition of any duplicate found if possible rather than the first instance it comes across in the column.

    Hopefully that makes some sense, its confusing for me reading it back.

    The VLOOKUP formula I am using is: =IFERROR(VLOOKUP(B47,Source!$A:$M,6,FALSE),"Not Found")

    The sample attachment shows the general layout
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Vlookup and duplicates

    The sample file does not seem to reflect your description. Your formula returns one date from the Source sheet which doesn't exist in the sample. Whilst I can rename the sheet, there are no duplicated entries. Please provide a file that has relevant sheets and data, together with some expected results.



    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file and a mocked up solution.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    05-03-2021
    Location
    Nashville
    MS-Off Ver
    MS Office 365
    Posts
    184

    Re: Vlookup and duplicates

    Arejay,

    Based on your description I created a sample doc of what you are looking for.

    Sheet A is a dynamic table based on the compiled data of "Sample Duplicate Data"

    I did 2 helper columns to get a true "max if" formula
    Sample Duplicate Data Column L
    combined J and K to get date AND time.

    Column M is your new "unique lookup" It is dynamic and will always take the most recent data as dates and times increase
    Cell M2 copied down
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Remove "AMY" from the bottom of the list, Sheet A will indicate the new "most recent" data.
    Sheet A is a Index and Match lookup based on the Unique ID.
    In Cell B2 Copy down and across.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    NOTE: you will have to reformate dates and times to read as dates and times but you now have a dynamic table to look up the most recent entry per Unique ID.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VLOOKUP with duplicates
    By clammastak in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-27-2015, 08:22 PM
  2. SUM VLOOKUP duplicates?
    By AndromedusO in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-06-2014, 12:25 PM
  3. Vlookup with duplicates
    By harrisj_ in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-07-2014, 10:19 AM
  4. VLOOKUP for duplicates
    By mattdh12 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-29-2013, 09:14 AM
  5. [SOLVED] vlookup duplicates
    By par0016 in forum Excel General
    Replies: 5
    Last Post: 06-08-2012, 09:51 AM
  6. Vlookup with duplicates
    By MattP299 in forum Excel General
    Replies: 1
    Last Post: 12-19-2011, 05:22 PM
  7. Vlookup with duplicates
    By jorgetb in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 07-12-2010, 05:45 AM

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