+ Reply to Thread
Results 1 to 7 of 7

vlookup - excel slow

  1. #1
    Registered User
    Join Date
    10-14-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    98

    vlookup - excel slow

    Hello everybody

    is there a way to make an excel file quicker?

    I took this file over from another person and it has many vlookups.
    My guess is vlookup could be the reason for this.

    Example of formulas:
    =VLOOKUP($C179985,'Mapping for Salary Tracker'!$A$2:$A$48,1,FALSE)
    =IFERROR((VLOOKUP(RIGHT($A179985,7),'Mapping for Salary Tracker'!$L:$M,2,FALSE)),"-")
    =IFERROR((VLOOKUP(RIGHT($A179985,7),'Mapping for Salary Tracker'!$O:$P,2,FALSE)),"-")
    =IFERROR((VLOOKUP(RIGHT($A179985,7),'Mapping for Salary Tracker'!$S:$T,2,FALSE)),"-")
    =VLOOKUP(VALUE(A179985),Sheet2!$A:$C,3,0)

    thanks for the feedback

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: vlookup - excel slow

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).


    CROSSPOSTED: http://www.mrexcel.com/forum/excel-q...xcel-slow.html
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: vlookup - excel slow

    The first obvious suggestion is to remove the references to whole columns (e.g. $L:$M). Can you replace these with realistic ranges?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Registered User
    Join Date
    10-14-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    98

    Re: vlookup - excel slow

    Well, my range is L and M.
    I don't think I can replace it.
    Quote Originally Posted by Glenn Kennedy View Post
    The first obvious suggestion is to remove the references to whole columns (e.g. $L:$M). Can you replace these with realistic ranges?

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: vlookup - excel slow

    Do your data REALLY go down to row 1048576???? If not, you are wasting a lot of time looking at empty cells.

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

    Re: vlookup - excel slow

    1) Another thing that slows lookups down is the fourth argument is FALSE -- which means a linear search. Linear searches are much slower (especially on large data sets) than binary searches. If you can sort the data in the lookup table, then you can use TRUE for the fourth argument of VLOOKUP(), and use a binary search.

    2) Another thing that slows spreadsheets down is duplicated effort. I notice that your three middle lookups (that are probably consuming most of the computation time) are searching for the same value in three "adjacent" lookup tables. If you can put some effort into "mapping for salary tracker", you may be able to turn three slow lookups into one lookup (via match() function see discussion and example here: http://www.excelforum.com/excel-form...ows-excel.html see posts 6 and 13), which should speed up your file considerably. (especially if the cleanup of mapping for salary tracker need be performed only once).
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  7. #7
    Registered User
    Join Date
    10-14-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    98

    Re: vlookup - excel slow

    I updated my formulas according to all of the comments.

    This is what it looks like now:
    =VLOOKUP($C2,'Mapping for Salary Tracker'!$A$2:$A$48,1,FALSE)
    =IFERROR((VLOOKUP(S2,'Mapping for Salary Tracker'!$L$2:$M$141,2,FALSE)),"-")
    =IFERROR((VLOOKUP(S2,'Mapping for Salary Tracker'!$O$2:$P$46,2,FALSE)),"-")
    =IFERROR((VLOOKUP(S2,'Mapping for Salary Tracker'!$S$2:$T$20,2,FALSE)),"-")
    =VLOOKUP(VALUE(A2),Sheet2!$A:$C,3,0)

    Any other improvements ? or ideas ?

    Thanks guys


    Quote Originally Posted by MrShorty View Post
    1) Another thing that slows lookups down is the fourth argument is FALSE -- which means a linear search. Linear searches are much slower (especially on large data sets) than binary searches. If you can sort the data in the lookup table, then you can use TRUE for the fourth argument of VLOOKUP(), and use a binary search.

    2) Another thing that slows spreadsheets down is duplicated effort. I notice that your three middle lookups (that are probably consuming most of the computation time) are searching for the same value in three "adjacent" lookup tables. If you can put some effort into "mapping for salary tracker", you may be able to turn three slow lookups into one lookup (via match() function see discussion and example here: http://www.excelforum.com/excel-form...ows-excel.html see posts 6 and 13), which should speed up your file considerably. (especially if the cleanup of mapping for salary tracker need be performed only once).

+ 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. Slow saving in Excel 2003 format from Excel 2010
    By simonc2 in forum Excel General
    Replies: 0
    Last Post: 10-18-2013, 08:40 AM
  2. Macro is running real slow and makes navigating the worksheet really slow after execution.
    By MichWolverines in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-03-2013, 04:29 PM
  3. [SOLVED] slow computer (slow clipboard) breaks my macro
    By twilsonco in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-05-2013, 09:16 PM
  4. [SOLVED] Slow VLookup Code
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-20-2013, 09:18 AM
  5. I have Vlookup and autofill macro, its slow, what Im doing wrong?
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-06-2011, 10:18 PM
  6. Excel 2003 macro working very slow in Excel 2007 (xlsm format)
    By kapil in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-17-2010, 11:26 AM
  7. vlookup to .xlsm macro is incredibly slow
    By jrussell in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-23-2009, 03:43 PM
  8. Macros running slow on Excel 2003 but not on Excel 2002
    By James in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-23-2006, 09:37 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