Sei sulla pagina 1di 11

From Free Document Downloads at TheSmallBusinessOwnersManual.

com
VLOOKUP: Article Text for Business Edge, March 2006
By Joe Kennedy, TheSmallBusinessOwnersManual.com
VLOOKUP and its sister function HLOOKUP are the closest Excel comes to a database lookup, which is often desir
spreadsheets need to refer to tables of changing information. VLOOKUP returns cell data from tables arranged verti
example below), while HLOOKUP returns cell data from tables arranged in a horizontal fashion.

The good news is that this function can save huge amounts of time in repetitive and error-prone tasks. But watch ou
easy to spot and values can change without warning.

The purpose of this article is to introduce the function and stimulate thinking about where it can be applied. I encour
study this article and experiment carefully before using it for production purposes.

VLOOKUP is at its best when you must refer to table values that sometimes change. Examples might include a tabl
employee pay rates, or a product price chart. Our article is limited to a simple example since this is an introductory d
to best demonstrate the range, not depth of the function.

Let’s get right to an example with a company that sells the items seen on the feb.pricetable tab in the sample spreads
tsbom.com/docdownloads/docs/BusinessEdgeExcelVLookupArticle.xls.

Manual lookup of these prices every time an estimate, purchase order, invoice or management report is prepared is a
consuming and error prone activity. So once the feb.pricetable tab is entered we can employ VLOOKUP in other sp
such as invoice60201, invoice60202, etc to return the information we need.

Let’s say that a customer orders 11 TS118300’s and 14 TS118400’s. Rather than type-in all of the information need
we can use VLOOKUP to help. The format for VLOOKUP is:
VLOOKUP(Value, Table, Column Number, Exact match True or False)
Where:
Value – is a reference to a row where we want Excel to lookup and return additional information. In this cas
Model Number to lookup the Description and Sell Price in other parts of the row.

Table – is simply the table where the data resides. It is important to note that the “Value” (above) must be in
the Table and nowhere else. Further be sure the Table is sorted in ascending order or unexpected results ma
table above, Column A is sorted in ascending order and Excel respects this even though we are using string v

Column Number – tells Excel which column number to return as the result. For example, when we want the
ask for the fourth Column, or Column D.
Exact Match True or False – This tells Excel if we demand an exact match to our lookup request, or if otherw
value is OK. The default value is False, meaning that Excel will return a value even if no exact match is fou
since this can cause problems. In our example, like most accounting work, we will demand an exact match;
simply won’t do.

In the invoice tabs (such as invoice60201) cell B10 is the item description, and VLOOKUP returns the information w
the formula
=VLOOKUP(A10,feb.pricetable!$A$3:$D$7,2,TRUE)

This simply says to take the Model Number in cell A10, go to the price Table, look up the row for Model TS118300,
value in Column 2, which is the Description for a model TS118300 – a “300GB SCSI DRIVE.”

Moving right to cell C10, we need the Sell Price for this same model number, which VLOOKUP provides when we
formula =VLOOKUP(A10,feb.pricetable!$A$3:$D$7,4,TRUE). This is the same as the previous formula, except n
value from Column 4, not Column 2. Again, in both cases the TRUE switch is used since we can’t tolerate a close m
exact.
We must still enter the Quantity of Units in Column D of the invoice, but then everything else is automatic. So of th
this simple invoice, we only need to enter the Model Number and Quantity.

In the next row, row 11 of the invoice60201 tab, we are selling Model TS118400, so the VLOOKUP formulas are th
we are now concerned with row 11 and not row 10. So the formulas in row 11 change to:

=VLOOKUP(A11,feb.pricetable!$A$3:$D$7,2,TRUE) and
=VLOOKUP(A11,feb.pricetable!$A$3:$D$7,4,TRUE).

You can see that these formulas are now easy to copy and adjust and we are getting some real utility in this simple ex

But caution is needed. The most likely cause of problems would be if the new prices for March are entered on top of
February Table values. In this case, all of the underlying invoices would be immediately and without warning repric
rates. Perhaps the best way to avoid this problem is to lock and protect the feb.prices tab, and to spawn new spreads
month when the adjusted prices come out. Other difficult to predict problems may occur if the index column – colum
table – is not entered in ascending order. Avoid this problem by doing a Data > Sort of the table before using VLOO
avoid allowing Excel to use an approximate match by always using the TRUE switch at the end of the formula.

Of course nothing beats experimenting with VLOOKUP to see how it may be utilized with your particular situation s

With these basics, use VLOOKUP and HLOOKUP when reference to changing table values is needed. These functi
provide faster results with fewer errors than manual lookup and entry of this same information.
Joe Kennedy is author of “The Small Business Owners Manual” (www.tsbom.com), has a degree in finance, an M
marketing, and has worked with small businesses for over 20 years. Email critique and comments are welcomed;
joe@tsbom.com
From Free Document Downloads at TheSmallBusinessOwnersManual.com

This spreadsheet is for the example sited in the Excel Tips: VLOOKUP article for Business Edge magazine, March 200

PRODUCT CATALOG AND PRICES FOR APRIL


Model Number Description Cost Sell Price
TS118200 200GB SCSI DRIVE $100.00 $119.99
TS118300 300GB SCSI DRIVE $150.00 $174.99
TS118400 400GB SCSI DRIVE $200.00 $234.99
TS118500 500GB SCSI DRIVE $250.00 $289.99

This spreadsheet is available for download at


http://tsbom.com/docdownloads/docs/BusinessEdgeExcelVLookupArticle.xls
usiness Edge magazine, March 2006, by Joe Kennedy.
From Free Document Downloads at TheSmallBusinessOwnersManual.com

This spreadsheet is for the example sited in the Excel Tips: VLOOKUP article for Business Edge magazine, March 200

INVOICE
Invoice Number
From: ABC DISK SALES 60201
Date May 26, 2011
To: BIG DISK CUSTOMER

UNITS
MODEL NUMBER DESCRIPTION SELL EXTENDED
PRICE PRICE
TS118300 300GB SCSI DRIVE $150.00 11 $1,650.00
TS118400 400GB SCSI DRIVE $200.00 14 $2,800.00

TOTAL DUE $4,450.00

This spreadsheet is available for download at


http://tsbom.com/docdownloads/docs/BusinessEdgeExcelVLookupArticle.xls
ness Edge magazine, March 2006, by Joe Kennedy
From Free Document Downloads at TheSmallBusinessOwnersManual.com

This spreadsheet is for the example sited in the Excel Tips: VLOOKUP article for Business Edge magazine, March 200

INVOICE
Invoice Number
From: ABC DISK SALES 60202
Date May 26, 2011
To: AMAZING COMPUTER COMPANY

UNITS
MODEL NUMBER DESCRIPTION SELL EXTENDED
PRICE PRICE
TS118200 200GB SCSI DRIVE $100.00 5 $500.00
TS118300 300GB SCSI DRIVE $150.00 14 $2,100.00
TS118400 400GB SCSI DRIVE $200.00 9 $1,800.00
TS118500 500GB SCSI DRIVE $250.00 8 $2,000.00

TOTAL DUE $6,400.00

This spreadsheet is available for download at


http://tsbom.com/docdownloads/docs/BusinessEdgeExcelVLookupArticle.xls
ness Edge magazine, March 2006, by Joe Kennedy
From Free Document Downloads at TheSmallBusinessOwnersManual.com

This spreadsheet is for the example sited in the Excel Tips: VLOOKUP article for Business Edge magazine, March 200

INVOICE
Invoice Number
From: ABC DISK SALES 60203
Date May 26, 2011
To: DULL COMPUTER, INC.

UNITS
MODEL NUMBER DESCRIPTION SELL EXTENDED
PRICE PRICE
TS118200 200GB SCSI DRIVE $100.00 7 $700.00
TS118500 500GB SCSI DRIVE $250.00 8 $2,000.00
TS118300 300GB SCSI DRIVE $150.00 9 $1,350.00

TOTAL DUE $4,050.00

This spreadsheet is available for download at


http://tsbom.com/docdownloads/docs/BusinessEdgeExcelVLookupArticle.xls
ness Edge magazine, March 2006, by Joe Kennedy

Potrebbero piacerti anche