Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
0 of .
Results for:
P. 1
Excel Lookup Functions Explained

# Excel Lookup Functions Explained

Ratings:

4.0

(1)
|Views: 1,479|Likes:

Published by: shwetakarsh on Nov 05, 2008

### Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

09/24/2011

pdf

text

original

Excel Lookup Functions Explained
Excel’s VLOOKUP Function: How to Use It and How to Nest It

The VLOOKUP function is a handy one to know when you want Excel to lookupa value in one place and insert it in another. For example, let’s say you have alist of all of your customers on a sheet named “Accounts” and an invoice onanother sheet named “Invoice”. When you type in their account number onthe Invoice, you want Excel to fill in the name of the customer and theiraddress (and this information is included for all customers on the Accountssheet). A VLOOKUP will do this for you.Make a small sample workbook to try this out. Name Sheet One “Invoice” andname Sheet Two “Accounts”. On the Accounts sheet, put three columns of data. Column A would be Account Numbers, Column B would be CustomerName, and Column C would be Address. Add at least five pretend customers,so you have enough to play with. On the Invoice sheet, just add these fivecolumn headings in cells A1:E1 – Date, Product Ordered, Account #, CustomerName, Address -but don’t put any data in there yet. (In reality, this sheetwould be an actual invoice which included sections for you to add orderinginfo for any products they buy, etc. But for this example, let’s keep it simple.)Now, before we try the VLOOKUP, the best thing to do is name the range of data that includes the info you want to pull over from the Accounts sheet. Youcan do VLOOKUPs without naming the range, but then you MUST be sure touse absolute cell references. So, I find naming the range a much easier way todo it. Highlight all the data on the Accounts sheet and name it
Customers
(don’t include the column headings in the named range – just the data). If youdon’t know how to name ranges, read this TechTrax article I wrote on how todo that.http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=281 Now that you have your data and have named the range, let’s look at buildinga simple VLOOKUP formula. Assume we will be typing account numbers intocell C2 and wanting the customer’s name and address to be filled into D2 andE2. The best way to learn new formulas is to use the Insert Function button .In Excel 97 and 2000, it's a button on your Standard Toolbar. In Excel2002/2003, it's on your Formula Bar. On the Invoice sheet, click into cell D2and click on the
fx
button.

(The picture above shows how this box looks in Excel 97/2000. In 2002/2003it’s slightly different, but I think you can figure it out.)If you know what type of function you are looking for, you can select thecategory and all the functions within that category will be listed. However, if you don't know what category you need, you can select "All" in the categorylist and all of Excel's functions will be listed. Notice as you click on anyfunction name, Excel displays a description of what that function does belowthe boxes. For this exercise, select the "Lookup & Reference" category andscroll down to select the VLOOKUP function. Note that it tells you that thisfunction “searches for a value in the leftmost column of a table and returns avalue from the same row in that table based on what column in that row youspecify.” Click OK.Once you click OK, you will get the wizard which helps you with your VLOOKUPformula. Now, because we will be typing an Account # in cell C2, that is thevalue we must put in the first box of this wizard which will tell Excel to look forwhatever is in C2 in the leftmost column of our lookup table (which we createdon the Accounts sheet and named "Customers"). So, enter C2 into the topbox.Click into the next box where it says "Table_array". Notice at the bottom of this box, it tells you what each box you click inside needs. This is where weneed to identify our table so Excel knows where to look. So, in this box,simply type
Customers
. (If you didn’t name the range, you will have to putthe absolute reference including the sheet name here … this is why it’s easierto just name the range.)Click into the third box. This one wants to know the number of the column wewant returned. Remember that what you entered in the first box in this wizardmust ALWAYS be in the first column of your lookup table. So, in our table, theAccount # is in the first column and the Customer Name is in the secondcolumn. Since the customer name is what we want to put here, just type a
2
to let Excel know we want what is in the second column.

Notice the last box is labeled "Range_lookup" and it is the only label that isnot bold. Whenever a label in this wizard is not bold, that means this"argument" of the function is not required. However, if you do not enteranything in this box, Excel will apply the default. If you read the instructionsat the bottom of this box, you will see that the default for this box is "true"which will find the "closest match", whereas "false" will find an "exactmatch". Since we want an exact match, type
false
in this box. This is what itshould look like if you have entered all the info correctly:Click OK and you will see that cell D2 now shows
#N/A
, which simply meansthat there is no value yet in C2, so the information is "not available". Look inyour formula bar and you will see the formula is
=VLOOKUP(C2,Customers,2,FALSE)
. As you get more used to usingfunctions, you won't have to use the wizard as much if you take the time tolook at the formulas and start to understand how they work.Now click into cell E2 and add a VLOOKUP formula which will find the Addressin our table. The formula will be exactly the same, except the"Col_index_num" will be
3
instead of 2 because we want to return the address,which is in the third column of our table. Once you have added this, youshould see another #N/A in cell E2. The formula will be
=VLOOKUP(C2,Customers,3,FALSE)
.
NOTE:
All other information in the second VLOOKUP formula will be exactlythe same as the first one. We are still looking for the value that will be placedin
C2
. We are still looking in the table named
Customers
. And we still want
false
for an exact match. The ONLY thing that is different is we are now goingto pull the information from Column
3
instead of 2.Move to cell C2 and type in one of the Account numbers you have in yourAccounts sheet and you will see Excel fills in the Customer Name and Addressfor that account number However, if you type a number that does not exist

## Activity (18)

You've already reviewed this. Edit your review.