+ Reply to Thread
Results 1 to 4 of 4

Joining two datasets together (VBA needed?)

  1. #1
    Registered User
    Join Date
    04-21-2013
    Location
    Australia
    MS-Off Ver
    MS Office 2013
    Posts
    7

    Joining two datasets together (VBA needed?)

    Hi,

    So I have two sets of data, I've attached a worksheet which has them both. The datasets have different intervals, but I need to drag "Colour" from Data2 into Data1 and associate it with the correct interval. Sometimes the intervals match up and sometimes they don't - which could be a problem, but as long as its within a small spread it's fine. The "Colour" column in Data1 is filled with my desired result, the source being Data2.

    ManyToMany_Example.xlsx

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,754

    Re: Joining two datasets together (VBA needed?)

    In G2 =VLOOKUP(B2,Data2!$B$2:$E$4,4,TRUE)

    and copy down. In your scenario presented, this works and returns the same values as you expected.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    04-21-2013
    Location
    Australia
    MS-Off Ver
    MS Office 2013
    Posts
    7

    Re: Joining two datasets together (VBA needed?)

    Thank you, this works well.

    For future use, is the True referring to a range of values, because obviously some values aren't listed in the intervals so it searches the values as a continuous range instead of discrete?

    And also, this is example data - my actual data is a lot bigger (different "shelves") - is there a way to automatically create arrays according to the Shelf, and then change the formula automatically? So the array that is searched in the vlookup is named after the same shelf that you are examining?
    Last edited by dave__1; 06-19-2014 at 11:57 PM.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,754

    Re: Joining two datasets together (VBA needed?)

    True means it is looking for an approximate match not greater than the lookup value.

    False means it will only return exact matches for the lookup value.

    For further understanding, read here: http://www.techonthenet.com/excel/formulas/vlookup.php

+ 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. Toggling between datasets
    By letangerang58 in forum Excel General
    Replies: 2
    Last Post: 05-01-2013, 10:36 AM
  2. [SOLVED] Combining two datasets
    By acencu in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-12-2012, 09:25 AM
  3. Matching IDs from 3 datasets
    By tripvanwinkel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-25-2011, 12:47 PM
  4. Excel 2007 : merge two datasets
    By unjung whang in forum Excel General
    Replies: 0
    Last Post: 02-25-2011, 05:23 PM
  5. Merger of two datasets
    By srs735@yahoo.co.in in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 10-08-2010, 12:39 PM

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