Jon von der Heyden
MrExcel MVP, Moderator
- Joined
- Apr 6, 2004
- Messages
- 10,910
- Office Version
- 365
- Platform
- Windows
I'm all about index match match, to the point i try to use it for everything and just like many people use vba...
VLOOKUP and INDEX/MATCH constructs are of the most over used functions. They are amazing when used properly but I frequently get requests from people to review their spreadsheets and work out why they are so darn slow. A typical culprit is excessive use of linear search lookups rather than binary search lookups, and usually around 80% of the time with small tweaks they can be substituted for binary search lookups.
In my course I illustrate the efficiency of binary over linear. I have a list of 15000 social security numbers (fake ones) and we do a VLOOKUP against a table of 100000 ssn's with associated names, DOB etc. I set Excel to manual calc mode and when I hit recalc I get the class to count how many seconds until calc is completed, usually around 35-42 seconds.
Then I sort the table and use a binary search VLOOKUP (a double-jointed one to emulate #N/A behaviour of linear search VLOOKUP). Again the class counts the recalc time, only this time it's done in less than 1 second.
More on binary/linear search: Extract a number from a text string with LOOKUP Jon von der Heyden