+ Reply to Thread
Results 1 to 6 of 6

Vlookup & Hlookup combining separate workboo

  1. #1
    Registered User
    Join Date
    03-01-2010
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003
    Posts
    1

    Smile Vlookup & Hlookup combining separate workboo

    Hi everyone,
    I've searched the site and although I found several similar posts I couldn't quite see one that could help me.
    I have data in two separate tabs (Location 1 & Location 2) of a workbook and I need to combine into a third bringing in the information in the various columns for each person. As you can see from my attachment the column positions change in each location and I have no control over this as I download this information and this is how it comes out.
    I probably get lots more information than I need but in my combined sheet I only need to have a few columns with consisent headings.
    Is there a way I can bring in this information using a persons reference id and also looking at the information contained in each column even though the column positions change?
    I would greatly appreciate any tips
    Attached Files Attached Files

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Vlookup & Hlookup combining separate workboo

    Hello Amak30,

    welcome to the forum.

    You can use a combination of INDEX and MATCH instead of VLookup. With Vlookup you need to know the column number, but with Index/Match, the Match part can find the correct column, as long as the column titles are consistent in your three sheets.

    Try this in D2 of the Combined sheet and copy down and across.

    Please Login or Register  to view this content.
    regards

    edit: see attached. Just one formula for all columns whereas JeanRage's suggestion would need tweaking in every column, which you don't want.
    Attached Files Attached Files
    Last edited by teylyn; 03-01-2010 at 02:12 AM.

  3. #3
    Valued Forum Contributor JeanRage's Avatar
    Join Date
    03-02-2009
    Location
    Nice, France
    MS-Off Ver
    Excel 2003
    Posts
    705

    Re: Vlookup & Hlookup combining separate workboo

    Hi,

    See attached sample ... as a starting point ..

    HTH
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    01-24-2009
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2003, 2007
    Posts
    61

    Re: Vlookup & Hlookup combining separate workboo

    its just a slight modification of the others suggestions, and i tried to give the solution for all the cells

    you may put this first in d2 then drag the formula across other cells,

    Please Login or Register  to view this content.
    Last edited by navwelch; 03-01-2010 at 02:58 AM.

  5. #5
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Vlookup & Hlookup combining separate workboo

    navwelch,

    there's two issues I have with your suggestion

    - it is not necessary to run a full fledged INDEX/MATCH to find if the formula bombs or not. A simple Match on the search term will do and will cost less resources. It can be safely assumed that the second MATCH will return a valid result if all column names are aligned (if they are not, then there's a fundamental flaw in the setup.)

    - a test for ISERROR() will effectively mask every error, instead of just identifying the #N/A, thus preventing any successful troubleshooting should the cell references be off (resulting in #REF!) or should a data type conflict exist (resulting in #VALUE!). Therefore it is better to test just for #N/A, so the error can be boiled down to the search value not being present in the list.
    Last edited by teylyn; 03-02-2010 at 06:59 PM.

  6. #6
    Registered User
    Join Date
    01-24-2009
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2003, 2007
    Posts
    61

    Re: Vlookup & Hlookup combining separate workboo

    thanks teylyn for the telling me the better usage of isna than iserror..

+ 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