+ Reply to Thread
Results 1 to 3 of 3

Using Match and Vlookup to find the lookup range for a Vlookup

  1. #1
    Forum Contributor
    Join Date
    06-18-2015
    Location
    Milton Keynes
    MS-Off Ver
    2016
    Posts
    101

    Using Match and Vlookup to find the lookup range for a Vlookup

    Hi Guys,

    One of my colleagues is trying to programme a macro to do a vlookup.

    The problem is that the source data doesn't always have the same column headings in the same columns.

    I have looked at the below:

    Please Login or Register  to view this content.
    This is just test data. in P:Q I have numbers 1 through 10 in P and then A,B,C etc in Q.

    This mostly works, but the resulting formula is
    Please Login or Register  to view this content.
    This is the end foruma that I'm looking for, but I think that the " around the column range E:H is what is returning a #Value error.

    Can someone look at this and advise please?

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Using Match and Vlookup to find the lookup range for a Vlookup

    Can you upload an example workbook (Go Advanced>scroll down to "Manage Attachments")

    Do the headers change or change order? Give a couple small examples of how it might look and what you are looking to return.

    Sounds like something that can be done easily with INDEX and MATCH.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Contributor
    Join Date
    06-18-2015
    Location
    Milton Keynes
    MS-Off Ver
    2016
    Posts
    101

    Re: Using Match and Vlookup to find the lookup range for a Vlookup

    Hi,

    I dont have the actual data as I am working on this for a colleague and
    they are hesitant to release a copy of company data (despite being told that
    no one will have a clue what its about!)

    The problem is that the columns change order every time. We cant help this
    as the information is gathered from a customer.

    I have attached my trial spreadsheet that I mocked up to try and solve the
    problem. hopefully this will help you see where I was going in my solution.

    As for Index Match, I am familiar with Match, but never had much need to use
    Index, so I am not familiar with what it does, so I'll look into that!
    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. [SOLVED] VLOOKUP, gives #N/A error (if Range lookup=0) or wrong data (if Range lookup=empty)
    By Ebalinska in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 01-14-2016, 05:55 AM
  2. [SOLVED] Vlookup to Pivot Table, using Match function, returns error if can't find match value
    By AndrewHowarth in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-16-2015, 12:10 AM
  3. Replies: 0
    Last Post: 12-26-2013, 01:12 PM
  4. Find exact match only using LOOKUP (not VLOOKUP)?
    By paulr24 in forum Excel General
    Replies: 3
    Last Post: 01-27-2012, 03:14 PM
  5. lookup/vlookup to find if match is located
    By burlywood66 in forum Excel General
    Replies: 1
    Last Post: 05-19-2010, 01:11 PM
  6. Vlookup. Match. Lookup. Wtf?
    By samprince in forum Excel General
    Replies: 4
    Last Post: 08-16-2006, 03:05 PM
  7. [SOLVED] match,lookup or vlookup????
    By Morphyus C via OfficeKB.com in forum Excel General
    Replies: 5
    Last Post: 07-13-2005, 06:05 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