The VLOOKUP function is, IMHO, one of the most used functions in Excel. Even so, spelling mistakes and extra spaces can throw it off completely. Here’s my simple solution for dealing with extra spaces.
N.B. Intentional extra spaces have been put before, in the middle, and after each name:
You can use:
entered as Ctrl+Shift+Enter
Now you might only know one name (e.g. John or Doe) but not the other name (ie. partial match). Then you can use a little semi-fuzzy logic to get the answer:
N.B. The above formula assumes that you are only looking up one word (e.g. no spaces).
If you are looking for a partial match with more than one word (e.g. Joh D) then use this formula:
entered as Ctrl+Shift+Enter
If you are having problems with spelling mistakes, etc. then you need to get really fuzzy. Alan has provided some awesome code for doing Fuzzy-VLookup including Soundex and Metaphone similarities.
If your boss is against using non-Microsoft add-ins or vba macros/functions then you can rest assured that MS has jumped on the bandwagon and now has its own version of Fuzzy matching for VLookup. You can find the add-in here, but be warned that it only works on tables and only officially with Excel 2010. Debra has created a page on this topic and one of the comments posted is that it also works on Excel 2007. Haven’t tried it except on Excel 2010 so can’t comment.
One of the greatest limitations of VLookup is that is only looks up in one direction (to the right) of any said value. Looking at the example below, if you wanted to use an account number to find out the rest of the details of a purchase you woud not be able to do so with the traditional vlookup formula since the account numbers are not the first column in the lookup table.
This tip is actually two in one:
Part 1. If you only wanted to know one piece of information that is related to your lookup value then you can use a combination of Choose and VLookup:
this tricks vlookup into switching the columns around and so finds the account number in Column B and returns the associated value from Column A. This technique is detailed here (http://www.myonlinetraininghub.com/e…t-using-choose).
Part 2. Often this is not enough and you would like to be build a complete retrieval system for the information in the VLookup table as you would with a traditional VLookup formula. This can be accomplished by taking the above formula one step further by creating a nested VLookup formula where the inner VLOOKUP will provide the lookup value for the outer VLOOKUP. If anyone knows of any references for this I will be happy to post it as I actually thought of this by myself (not saying I was the first, but I haven’t seen anyone else use this technique before).