+ Reply to Thread
Results 1 to 8 of 8

Merging Data Using VLookup !!! Please help

  1. #1
    Registered User
    Join Date
    12-24-2012
    Location
    Dubai
    MS-Off Ver
    Excel 2010
    Posts
    5

    Merging Data Using VLookup !!! Please help

    Hi,

    I've got this file (attached) where I want to merge the data matching TITLE ID with another sheet. I need to move tempo/TempoID from sheet 1 to music. But it's not working properly.

    Can some one please help me with this.

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Contributor Legend Rubber's Avatar
    Join Date
    09-21-2012
    Location
    Tillsonburg, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    392

    Re: Merging Data Using VLookup !!! Please help

    testing_vlookup (2).xlsx
    Does this work?
    Use version (2)
    Attached Files Attached Files
    Last edited by Legend Rubber; 12-24-2012 at 09:15 AM. Reason: had it backwards

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Merging Data Using VLookup !!! Please help

    hi ghaffar3, welcome to the forum. try this in C3 of "Music" sheet:
    =IF(ISNA(VLOOKUP($B3,Sheet1!$B$3:C$102,COLUMN(C2)-1,0)),"",VLOOKUP($B3,Sheet1!$B$3:C$102,COLUMN(C2)-1,0))

    or in Excel 2007 & above:
    =IFERROR(VLOOKUP($B3,Sheet1!$B$3:C$102,COLUMN(C2)-1,0),"")

    copy below & across

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  4. #4
    Registered User
    Join Date
    12-24-2012
    Location
    Dubai
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Merging Data Using VLookup !!! Please help

    @Legend Rubber : I need to copy the tempo and tempo ID columns from sheet1 to the music sheet.

    @benishiryo: Mate, this isn't working there seems to be no action, the cell remains empty after I copy/pasted it.

  5. #5
    Registered User
    Join Date
    12-24-2012
    Location
    Dubai
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Merging Data Using VLookup !!! Please help

    @ Legend Rubber: Yeah it's working properly. I had to change the span in the name manager.. After I did that it worked perfectly both ways. From Music to Sheet1 and vice versa.

    @Benishiryo: Yes, this is working perfectly. I didn't notice it at first as the first match was down the lane. Thanks for reminding me about it. Sometimes I'm in just a hurry to see the result that I don't watch out for small things'. Will take care next time...

    Thanks both of you..

  6. #6
    Registered User
    Join Date
    12-24-2012
    Location
    Dubai
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Merging Data Using VLookup !!! Please help

    @Benishiryo, As I'm new to excel, if you can please help me understand this formula. Can you please break this down and help me understand it. It would be of benefit to others as well who stumble across.

    Thanks mate.. I appreciate both of your efforts in helping others. A great inspiration to teach..

  7. #7
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Merging Data Using VLookup !!! Please help

    you're very welcome, ghaffar3. there are 4 parts to the VLOOKUP;
    lookup_value
    both list should have a common value to look up for. in your case, it's the title ID

    table array
    this is a range that should contain at least 2 columns. the 1st one must be the column where the lookup_value can be found. the other (might not be 2nd column) should be the column where your desired results are. in your case the 1st column where title ID can be found is Sheet1!B3:B102. what you need to return is the tempo, which is in Sheet1!C3:C102. so the very least your formula should include is:
    Sheet1!B3:C102
    i hope you are familiar with the dollar signs (absolute & relative cell referencing). the table array are usually fixed in the columns & rows, because it's a fixed place you would want to look up in. but i intentionally omitted the dollar sign for column C because copying from Music!C3 to Music!D3 will then return me column D (where the tempo ID is):
    Sheet1!$B$3:D$102
    i saw that you had a Named Range "Tempo". it doesnt work because the 1st column is not where the lookup_value is found. but it is also not advisable to put the whole of Sheet1!$B:$D. it will work no doubt. but looking up 1 million over rows is Excel slows things down.

    col_index_num
    wherever we start our table_array is column 1. counting from there, this number decides which column of the table array we want to return. since Sheet1!B3:B102 is 1, tempo is in Sheet1!C3:C102, so it's 2. tempo ID in Sheet1!D3:D102 is 3. my personal preference is to try use just 1 formula, so instead of typing 2 types of formula (one to return 2 for tempo, 2nd to return 3 for tempo id), i used the COLUMN formula. COLUMN returns the column number of the cell reference. COLUMN(A1) or COLUMN (A1000) returns me 1 because it's in column 1. so if i put COLUMN (C3) or anywhere in C, it'll return me 3. i'm looking for tempo, so i need to return 2. i can just deduct 1 from it.
    COLUMN(C2)-1

    range_lookup
    FALSE or 0 means you are looking for an exact match. i suggest you just stick to this for now.

    hope that helps. the ISNA or IFERROR is simply to show other values instead of #N/A when the value cannot be found.

  8. #8
    Registered User
    Join Date
    12-24-2012
    Location
    Dubai
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Merging Data Using VLookup !!! Please help

    Yes that's great information. Thank you for your time to get it all on here.

    It' greatly appreciated. Now I understand that formula completely.

    Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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