+ Reply to Thread
Results 1 to 38 of 38

Faster way to VLOOKUP huge set of data

  1. #1
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Faster way to VLOOKUP huge set of data

    Hello Guys,

    In a workbook, I have a sheet with huge set of data around 7 Lacs. I have only two columns in that sheet. Lets say this workbook as WK-A

    This huge data is used by me on daily basis for VLOOKUP. Now the issue is my VLOOKUP takes lot of time and also opening that WK-A takes lot of time.

    There's no formula on WK-A, it just contains the plain text data.

    Can anyone suggest faster way to VLOOKUP these huge data???


    Regards,
    Paresh J
    Click on "* Add Reputation" as a way to say thanks

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Faster way to VLOOKUP huge set of data

    I am not sure but i think Index and Match function is best
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  3. #3
    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
    52,929

    Re: Faster way to VLOOKUP huge set of data

    7 lacs = what - 7 000? 70 000?

    vlookup should not take that much time to run, what do you mean by
    Now the issue is my VLOOKUP takes lot of time and also opening that WK-A takes lot of time.
    What does your vlookup formula look like?
    If you END HOME, where does your cursor end up? If it is not in the last cell of your 2nd row, you have some extra, unnecessary formatting or data in that sheet that you can probably delete
    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

  4. #4
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: Faster way to VLOOKUP huge set of data

    Hi FDibbins,

    I mean 7 lacs rows of data. I don't have any formatting to my data in my workbook. Also, when i do END HOME, i get to the last row of the 2nd column.

    My formula looks like :
    Please Login or Register  to view this content.
    Regards,
    Paresh J

  5. #5
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Faster way to VLOOKUP huge set of data

    Do you have more than 700,000 rows of data?
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  6. #6
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: Faster way to VLOOKUP huge set of data

    Yes, More than 700,000 data. My VLOOKUP operation is taking time. Any solution to this???

  7. #7
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Faster way to VLOOKUP huge set of data

    Vlookup is faster than Index/ Match. I'm wondering if you have volatile formulas that are being updated when the workbook is being opened or when each vlookup formula returns a value. Since you are searching data from another workbook, then vlookup has to open that workbook (if not already open).

  8. #8
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: Faster way to VLOOKUP huge set of data

    Hi abousetta,

    I don't have any formulas in that workbook. And even i am not opening the workbook. I have the full path of other workbook in the VLOOKUP formula. Check my formula in post #4.


    Regards,
    Paresh J

  9. #9
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Faster way to VLOOKUP huge set of data

    For vlookup to work the workbook has to be open. If not, Excel will open it. Try running the same formula with the workbook open already.

  10. #10
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: Faster way to VLOOKUP huge set of data

    I have already done the same. But no major change in time.

  11. #11
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Faster way to VLOOKUP huge set of data

    I'd have to see your files because vlookup is pretty fast. Try one last thing. Turn calculations to manual >> Double click on the cell with this formula >> hit Enter and see what happens. If it's faster then there are other formulas in your current workbook that are recalculating and slowing down the whole process.

  12. #12
    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
    52,929

    Re: Faster way to VLOOKUP huge set of data

    For vlookup to work the workbook has to be open
    Not really, vlookup works just fine on closed workbooks

  13. #13
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: Faster way to VLOOKUP huge set of data

    Hi abousetta,

    Sorry, but i can't share the file. It is very confidential.
    But I am not doing VLOOKUP in single cell in second workbook. I have some 30000+ records which i am trying to get the data from first workbook. And this is taking time.

    And my main concern is data in the first workbook is getting increased every month. In next couple of months it will cross 1000000 records(i.e 10 Lacs). What has to be done then?

    Any solution???


    Regards,
    Paresh J

  14. #14
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Faster way to VLOOKUP huge set of data

    Quote Originally Posted by FDibbins View Post
    Not really, vlookup works just fine on closed workbooks
    I stand corrected.

  15. #15
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: Faster way to VLOOKUP huge set of data

    @FDibbins,

    Absolutely, It works with closed workbooks too. I have checked in both ways. But not much help.

  16. #16
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Faster way to VLOOKUP huge set of data

    Quote Originally Posted by pareshj View Post
    Hi abousetta,

    Sorry, but i can't share the file. It is very confidential.
    But I am not doing VLOOKUP in single cell in second workbook. I have some 30000+ records which i am trying to get the data from first workbook. And this is taking time.

    And my main concern is data in the first workbook is getting increased every month. In next couple of months it will cross 1000000 records(i.e 10 Lacs). What has to be done then?

    Any solution???


    Regards,
    Paresh J
    I really can't tell without seeing the workbooks, but it seems that you need to either split the workbook into multiple workbooks or invest in more robust hardware.

    EDIT: You also might want to install Office as 64-bit installation so that you can tap into more than 2GB of memory (if that's the limiting factor)

  17. #17
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Faster way to VLOOKUP huge set of data

    ----

    double post

    Excuse me.

    ----------------
    Last edited by canapone; 10-24-2014 at 02:55 AM.
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  18. #18
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Faster way to VLOOKUP huge set of data

    Hi,

    an attempt: could you sort your data in ascending order?

    Can you keep your data sorted by column A in:

    'D:\Data\ABC.xlsx'!A2:B715263

    I do not know if it's convenient.

    Cheers

  19. #19
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: Faster way to VLOOKUP huge set of data

    @abousetta:

    Memory is one limiting factor and I agree to you completely. But i have to manage in the same resource somehow.

  20. #20
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Faster way to VLOOKUP huge set of data

    Hi again

    the idea is to use a different strategy by using a binary search for vlookups


    Please Login or Register  to view this content.

    Formula needs sorted data

    Cheers

    Edit: one comma was missing in <>lookup
    Last edited by canapone; 10-24-2014 at 03:13 AM.

  21. #21
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: Faster way to VLOOKUP huge set of data

    @canapone:

    Doing two LOOKUP operations will take time. Dont you think??

    Sorting the data is difficult lookup column is text. IT contains numbers with length of 8 digits and those who are not are prefixed with zero's. Hence sorting these data is not possible.

  22. #22
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Faster way to VLOOKUP huge set of data

    Hi,

    thanks for providing feedback: if you can't conveniently sort your data, this strategy does not make sense.

    Doing two LOOKUP operations will take time. Dont you think??
    No, I don't.

    VLOOKUP(...FALSE) does a linear search

    VLOOKUP(...TRUE) does a binary search

    For a formula doing two binary searches on sorted data is much faster than doing one linear search - i.e. vlookup(...false)- with any data larger than 100 rows.

    I'm not sure about potential problems with external references or closed workbooks using LOOKUP.

    I would need to make some tests on some real sample: easy I'm totally (or partially) wrong.

    Cheers
    Last edited by canapone; 10-24-2014 at 03:43 AM.

  23. #23
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: Faster way to VLOOKUP huge set of data

    So guys........ Whats the solution....... what should I do??

  24. #24
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: Faster way to VLOOKUP huge set of data

    I've noticed for large numbers of VLOOKUPs, (over a million at a time), referencing a closed workbook can take a LONG time if the file being referenced has a lot of data and/or is stored on a network/remote hard drive. If you open the workbook and calculate, it should not take nearly as long.
    You should hit F5, because chances are I've edited this post at least 5 times.
    Example of Array Formulas
    Quote Originally Posted by Jacc View Post
    Sorry, your description makes no sense. I just made some formula that looks interesting cause I had nothing else to do.
    Click the * below on any post that helped you.

  25. #25
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: Faster way to VLOOKUP huge set of data

    @Speshul,

    Both files are on my local disk and in same folder. I have checked the both ways by closed as well as open workbook but does not make much of difference.

  26. #26
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: Faster way to VLOOKUP huge set of data

    Maybe it is just a network bottleneck then, nevermind! I'm not sure.

  27. #27
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Faster way to VLOOKUP huge set of data

    I don't understand why sorting is difficult because the data is text. What difference does that make?
    Remember what the dormouse said
    Feed your head

  28. #28
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: Faster way to VLOOKUP huge set of data

    @romperstomper,

    Is it possible to sort data like this:

    00023451
    00589874
    00000015

  29. #29
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Faster way to VLOOKUP huge set of data

    Yes. It should sort correctly either as text or as numbers since they're formatted to have the same number of characters.

  30. #30
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: Faster way to VLOOKUP huge set of data

    But if i sort it as text, it will not give me desired output and same cannot be converted to numbers as it would un necessary increase steps from converting text to numbers and then sort the numbers and then convert to text again.

  31. #31
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Faster way to VLOOKUP huge set of data

    Quote Originally Posted by pareshj View Post
    But if i sort it as text, it will not give me desired output
    In what sense?

  32. #32
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: Faster way to VLOOKUP huge set of data

    Will it give output like this:

    00000015
    00001258
    00025892

  33. #33
    Forum Contributor
    Join Date
    10-16-2014
    Location
    Center Line, Michigan, United States
    MS-Off Ver
    MS Office 2013
    Posts
    139

    Re: Faster way to VLOOKUP huge set of data

    Hello pareshj,

    It sounds like you have a lot of data! Once you cross 1048576 rows of data, Excel will not be able to fit any more. If you have Microsoft Office, your best bet would be to use Microsoft Access. Connecting two tables of data like that is a simple operation, and would run much more quickly.

  34. #34
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: Faster way to VLOOKUP huge set of data

    @Loganeb,

    Yes, this is what i am looking for now.

  35. #35
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Faster way to VLOOKUP huge set of data

    Quote Originally Posted by pareshj View Post
    Will it give output like this:

    00000015
    00001258
    00025892
    Yes - you could of course try it...

  36. #36
    Valued Forum Contributor
    Join Date
    10-14-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2019
    Posts
    353

    Re: Faster way to VLOOKUP huge set of data

    VLOOKUP takes less than one second on 1.000.000 records
    But if you have a lot of formulas in your workbook it can be slow, especially with array-formulas
    I have attached a test workbook
    When you open it you should first click on button: Generate 1.000.000 records
    This will take 1 minute
    Then you click on button: Remove Duplicates
    This will take 15 seconds
    Then you click on button: Sort Data
    This will take 2 seconds
    Now the file will be 35 Mb big
    If you select a value in cell: F3 it will do the Vlookups (in column: L) within a second
    In cell G3 I put a UDF that does a Binary Search which is quicker
    Hope it will work............
    Attached Files Attached Files
    Kind regards,
    Piet Bom

  37. #37
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,723

    Re: Faster way to VLOOKUP huge set of data

    I think the best strategy is to sort your data, then you can use VLOOKUP with a 4th parameter of TRUE, which uses a binary search algorithm rather than a sequential search. If you are specifically looking for an exact match, then use COUNTIF to see if it is there, like this:

    =IF(COUNTIF('D:\Data\ABC.xlsx'!A:A,A2)>0,VLOOKUP(A2, 'D:\Data\ABC.xlsx'!A:B,2,TRUE),"not present")

    Hope this helps.

    Pete

  38. #38
    Forum Contributor
    Join Date
    12-23-2003
    Posts
    179

    Re: Faster way to VLOOKUP huge set of data

    @pareshj

    Are you able to sort the data in ascending order and keep it that way?

+ 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] making a formula run faster in a huge spreadsheet
    By ammartino44 in forum Excel General
    Replies: 3
    Last Post: 10-02-2014, 07:43 PM
  2. Faster way to categorize data (Faster than nested-if)
    By excel1985 in forum Excel General
    Replies: 6
    Last Post: 03-05-2014, 07:00 AM
  3. Faster way to categorize data (Faster than nested-if)
    By excel1985 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-05-2014, 01:56 AM
  4. Vlookup a HUGE database
    By djvice in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-02-2009, 11:28 PM
  5. Which is faster: VLOOKUP-worksheet or VB-array VLOOKUP?
    By erikhs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-06-2006, 01:25 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