+ Reply to Thread
Results 1 to 6 of 6

Which method is faster, VLOOKUP or MATCH & INDEX?

  1. #1
    Registered User
    Join Date
    10-06-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    35

    Which method is faster, VLOOKUP or MATCH & INDEX?

    I have come up with 2 ways of filling in a table with data from another sheet that gets filled via data connections.
    Do you think one of them will be less work for the CPU to process than the other?

    Setup: There is 1 column with IDs manually entered, which are the anchors for finding data on the other sheet. The formula's goal is to fill out 4 other columns.

    Method 1:
    =VLOOKUP(E5,ItemList!D5:L1400,3,FALSE)
    One of these filled down for each of the 4 columns

    Method 2:
    Add a column (F) to find the row number on the other sheet of the matching ID
    =MATCH(E5,ItemList!D5:D1400,0)+ROW(ItemList!D5:D1400)-1
    And fill the 4 columns out with a reference like this
    =INDIRECT("ItemList!E"&F5)


    TL;DR - Is 4000 VLOOKUPs faster or slower than 1000 MATCHes + 1000 ROWs + 4000 INDIRECT references?

    I would initially guess vlookups are fewer operations, but they're probably heftier. What do you think?
    Last edited by Jimmyjazz; 11-21-2013 at 05:33 AM. Reason: got nagged to give detail in title

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Which method is faster?

    Can you post a sample book?

    I don't understand the purpose of the Row function added to the match

    I would suggest this modification to your 2nd method..

    In column F, put
    =MATCH(E5,ItemList!D$5:D$1400,0)
    And fill the 4 columns with
    =INDEX(ItemList!E$5:E$1400,$F5)

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,821

    Re: Which method is faster?

    Some of it depends on exactly how the spreadsheet is working. I would guess that the match-indirect combination will, in the long run, be more processor work, mainly because indirect is a volatile function. A volatile function is forced to calculate with each calculate event, whether anything really changed or not. With the VLOOKUP() option, when you change the inputs to one of the vlookup() functions, only that incidence of the function calculates. With the match-indirect combination, when you change the inputs to the match function, not only does that match+indirect combination recalculate, but every one of the 3999 other incidences of the indirect function recalculates.

    Anytime you are worried about processor time, you would generally want to avoid any of the volatile functions like indirect or offset.

    You might consider using INDEX() instead of INDIRECT().
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Registered User
    Join Date
    10-06-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Which method is faster?

    Oh sorry, the ROW is just something I read online. The range does not start at A1, and match gives the relative row instead of absolute. I don't really understand it, but it works.

    Good info about the calculations.

    So the new question is: 4000 vlookups or Jonmo1's solution for 1000 rows?

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Which method is faster?

    Quote Originally Posted by Jimmyjazz View Post
    The range does not start at A1, and match gives the relative row instead of absolute.
    That's why the INDEX refers to the same rows as the match.

    Quote Originally Posted by Jimmyjazz View Post
    So the new question is: 4000 vlookups or Jonmo1's solution for 1000 rows?
    The Index/Match will outperform the vlookups by far.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Which method is faster?

    There is calculation timer code here:

    http://msdn2.microsoft.com/en-us/library/aa730921.aspx

    Run some tests and compare the results.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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] More efficient (faster) sub-String method?
    By Bytor47 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-12-2013, 08:40 AM
  2. Faster Search Method
    By boylejob in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-24-2010, 08:35 PM
  3. Which method is more efficent/faster?
    By foxguy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-02-2010, 02:53 AM
  4. faster find method
    By Baapi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-21-2007, 11:08 AM
  5. Which method is faster
    By matpoh in forum Excel General
    Replies: 2
    Last Post: 10-21-2005, 10:12 AM

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