+ Reply to Thread
Results 1 to 4 of 4

Merging two data sets using approximate matches

Hybrid View

  1. #1
    Registered User
    Join Date
    06-28-2006
    Posts
    46

    Question Merging two data sets using approximate matches

    Hello Everyone!

    I have two sets of data, with identical structures.

    Set 1:

    fruit | expiry | price
    pear | 2014/06/11 | 2.56
    pear | 2014/06/19 | 2.14
    apple | 2014/06/05 | 1.12
    pear | 2014/06/23 | 2.33
    apple | 2014/06/02 | 1.13


    Set 2:

    fruit | expiry | price
    pear | 2014/06/12 | 2.56
    pear | 2014/06/21 | 2.14
    apple | 2014/06/06 | 1.12
    pear | 2014/06/24 | 2.33
    apple | 2014/06/04 | 1.13

    fruits and price do always match.

    the expiry date is either one or two days late for the second data set, and I am trying to match the records into one,

    example: list 1 pear | 2014/06/11 | 2.56 and pear | 2014/06/12 | 2.56 are a match

    and I am trying to get Excel to merge them into: pear | 2014/06/11 | 2014/06/12 | 2.56

    any idea on how to proceed with VBA?

    For the above two sets, the output should be:

    fruit | expiry1 | expiry 2 | price
    pear | 2014/06/11 | 2014/06/12 | 2.56
    pear | 2014/06/19 | 2014/06/21 | 2.14
    apple | 2014/06/05 | 2014/06/06 | 1.12
    pear | 2014/06/23 | 2014/06/24 | 2.33
    apple | 2014/06/02 | 2014/06/04 | 1.13

    Thanks!

  2. #2
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Merging two data sets using approximate matches

    Where is the data for the two sets? Same sheet -- different range, different sheets -- same range, or something else?
    Where do you want the results?
    Will the rows in the two data sets always match one-for-one?
    Acts 4:12
    Salvation is found in no one else, for there is no other name under heaven given to mankind by which we must be saved.

  3. #3
    Registered User
    Join Date
    06-28-2006
    Posts
    46

    Re: Merging two data sets using approximate matches

    Hello Natefarm!

    The data is on the same sheet, the range should be the entire columns (example: A:A, B:B etc.).

    The results can be on a separate sheet.

    fruit will always match 1:1

    expiry will always match with a margin of -2 to +2 days

    price are also theoretically 1:1 matches.

  4. #4
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Merging two data sets using approximate matches

    The data is on the same sheet, the range should be the entire columns (example: A:A, B:B etc.).
    If that's the case, then how can there be two sets of data? Is it all mixed together? Sorry -- I'm not understanding.

+ 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. Find Row Matches on Six Criteria between data sets in two different worksheets
    By jake diamond in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-24-2014, 04:45 PM
  2. Finding matches on six criteria in two data sets on two different worksheets
    By jake diamond in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 01-23-2014, 10:22 PM
  3. Vlookup Multiple Sheets, Approximate Matches
    By maxymab in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-28-2013, 09:50 PM
  4. Merging two sets of data
    By hongkongrubbish in forum Excel General
    Replies: 4
    Last Post: 10-07-2011, 03:40 AM
  5. Replies: 5
    Last Post: 02-08-2011, 09:07 AM

Tags for this Thread

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