+ Reply to Thread
Results 1 to 6 of 6

vlookup vs Index match function

Hybrid View

  1. #1
    Registered User
    Join Date
    09-19-2013
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003
    Posts
    7

    vlookup vs Index match function


    Hi Everyone,

    I have been struggling to obtain the perfect excel function formula for a large coding excel file which I am currently working on. I have been using vlookup to lookup against two separate spreadsheets using TEXT as a lookup value, if the two TEXT (Sheet 1, Column A verses Sheet 2, Column A) matched then it would return the NUMBER code from Sheet 1, Column B.

    Here is the vlookup formula that I am currently using:
    =VLOOKUP(A2,'Sheet 1'!A:C,3,FALSE)

    Although it appears to work, I have found that because the file is so large, vlookup sometimes returns the wrong NUMBER code and has a conniption and randomises the order.

    I hope this makes sense? Any assistance or tips would be greatly appreciated.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,804

    Re: vlookup vs Index match function

    The formula you are showing does not match your description. Your formula will return a value from column C of Sheet1. If you want an answer from column B then you want

    Formula: copy to clipboard
    =VLOOKUP(A2,'Sheet 1'!A:B,2,FALSE)
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    09-19-2013
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: vlookup vs Index match function

    Hi 6StringJazzer,

    Thank you for your response and correction (Yes, you're right and I have that same vlookup function in place).

    I am after an alternative function (Index (match)) that could produce a better result.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: vlookup vs Index match function

    Hi and welcome to the forum

    Given the same data and conditions, both vlookup and index/match will return the identical results, and the only reason vlookup will "sometimes returns the wrong NUMBER code and has a conniption and randomises the order" is if your data does not match. Both will return the very 1st match they find, and then stop looking after that.

    The main difference between the 2 search functions is that vlookup cannot look up/find anything to the left of the search column, whereas index/match does not have that restriction.

    For instance, if you have data in column B that you want to search for, and then return the corresponding value from column A, vlookup will give an error, but index/match wont have that same problem.

    If your vlookup is not performing as expected, check your data. Look for leading/training spaces. Test "identical" data using tests like =exact(cell-ref1, cell-ref2) etc. If you still have a problem, I would suggest you upload a sample work book, (all sensitive data removed), showing what data you are working with, a few examples of what your expected outcome is, and how you arrived at that
    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    09-19-2013
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: vlookup vs Index match function

    Hi FDibbins,

    Thank you so much your assistance, the tips and information.

    I currently work for a University and each term I have the task of coding business and occupation fields against it's relevant ANZSCO code. It is a task that requires a lot of time, patience and accuracy.

    With your generous help I was able to upload the file for your review. Please note that
    'sheet 1' is the master spreadsheet (table array) and 'sheet 2' is the working spreadsheet.

    Any further tips would be greatly appreciated.
    Attached Files Attached Files

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: vlookup vs Index match function

    INDEX & MATCH works in this way

    =INDEX(Sheet1!B:B,MATCH(A2,Sheet1!A:A,0))

    As i can see gives same results as your VLOOKUP.

    Can you tell us 1-2 wrong results that these formulas give to you?
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

+ 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. VLOOKUP / INDEX / MATCH Function??
    By liverpoolphil in forum Excel General
    Replies: 2
    Last Post: 10-08-2009, 09:30 AM
  2. Function Vlookup, Match or Index?
    By Patrick Young in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-03-2005, 10:05 PM
  3. Function Vlookup, Match or Index?
    By Patrick Young in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-03-2005, 10:05 PM
  4. Function Vlookup, Match or Index?
    By Patrick Young in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-03-2005, 07:05 PM
  5. Function Vlookup, Match or Index?
    By Patrick Young in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-03-2005, 07: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