Wednesday, January 7, 2009
So today I was given 2 lists and I needed to find out what they had in common and what there differences were. The basic gist of VLOOKUP is that it will take a value and look through a huge table to see if it closely or exactly matches any values in the table.
So how do you do it?
Let's take a simple example; we are going to see how many of our favorite foods are actually fruits. So in column 1 we will have a list of fruits and in column 2 we will have a list of our favorite foods.
We need to know right the function to take the value in column B and search column A to see if it exists. Remember this is a simple example just to get the concept down, I promise this comes in handy when you have a huge dataset. When you pull up the help center article in Excel for the function this is what they give you "VLOOKUP(lookup_value,table_array,col_index_ num,range_lookup )" A bit daunting in my opinion!
Breaking it down we know that VLOOKUP is the name of the function.
Based on all of that the formula that I would put into column C row 2 would be =VLOOKUP(B2, $A$2:$A$7, 1, FALSE). The result you should see is '#NA' which means that it could not find 'pizza' in the list of fruits. Next step is to drag or copy the formula down to column 6 so it is next to each of your favorite fruits. It should look something like this.
The only other thing that you may not be familiar with is the '$' that I used in the formula. This is a way to anchor your formula so when you drag it down it doesn't automatically adjust the values. We didn't use it for B2 because we wanted it to change to C2, D2, etc. However, we wanted the range of fruits to stay the same.
Once you have the data I usually copy and do a paste special to choose just the values and manipulate however I need to. This is by no means the fastest or most eloquent way to do this type of thing, but I thought I would share it since I spent a good deal of time working on this today.
Subscribe to:
Post Comments (Atom)

6 comments:
please incorporate more red bull vodka and less excel into future postings.
Have you gotten this to work across two different sheets or even documents? For instance if column A was in 'doc1' and column B was in 'doc2' would you be able to use the same functionality?
Thanks!
JmC
why don't you less time blogging about v lookups and more time updating your profile...google CHICAGO, not ann arbor.
-patrick anthony tokarski
LESS V LOOKUP, MORE V HOOKUP
-matthew lee curd
Does VLookUp have anything to do with Twitter? I'm confused...
Cool blog McGraw....
Post a Comment