100% found this document useful (1 vote)
220 views5 pages

VLookup Tutorial

VLOOKUP is an Excel function that retrieves data from a database or list based on a supplied unique identifier. The document demonstrates using VLOOKUP to build an invoice template that looks up item descriptions and prices from a product database based on the item codes entered. It shows naming the product database range, entering a sample item code, and writing the VLOOKUP formula in the corresponding cell to return the description from the database.

Uploaded by

Angel Lawson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
220 views5 pages

VLookup Tutorial

VLOOKUP is an Excel function that retrieves data from a database or list based on a supplied unique identifier. The document demonstrates using VLOOKUP to build an invoice template that looks up item descriptions and prices from a product database based on the item codes entered. It shows naming the product database range, entering a sample item code, and writing the VLOOKUP formula in the corresponding cell to return the description from the database.

Uploaded by

Angel Lawson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Using VLOOKUP in Excel

{Modified tutorial from http://www.howtogeek.com/howto/13780/using-vlookup-in-excel/}

VLOOKUP is one of Excel’s most useful functions, and it’s also one of the least
understood. In this article, we demystify VLOOKUP by way of a real-life example. We’ll
create a usable Invoice Template for a fictitious company.

So what is VLOOKUP? Well, of course it’s an Excel function. This article will assume that
the reader already has a passing understanding of Excel functions, and can use basic
functions such as SUM, AVERAGE, and TODAY. In its most common usage, VLOOKUP is
a database function, meaning that it works with database tables – or more simply, lists of
things in an Excel worksheet. What sort of things? Well, any sort of thing. You may have
a worksheet that contains a list of employees, or products, or customers, or CDs in your CD
collection, or stars in the night sky. It doesn’t really matter.

Here’s an example of a list, or database. In this case it’s a list of products that our fictitious
company sells:

Usually lists like this have some sort of unique identifier for each item in the list. In this
case, the unique identifier is in the “Item Code” column. Note: For the VLOOKUP function
to work with a database/list, that list must have a column containing the unique identifier
(or “key”, or “ID”), andthat column must be the first column in the table. Our sample
database above satisfies this criterion.

The hardest part of using VLOOKUP is understanding exactly what it’s for. So let’s see if we
can get that clear first:

VLOOKUP retrieves information from a database/list based on a supplied instance


of the unique identifier.

Put another way, if you put the VLOOKUP function into a cell and pass it one of the unique
identifiers from your database, it will return you one of the pieces of information associated
with that unique identifier. In the example above, you would pass VLOOKUP an item code,
and it would return to you either the corresponding item’s description, its price, or its
availability (its “In stock” quantity). Which of these pieces of information will it pass you
back? Well, you get to decide this when you’re creating the formula.

If all you need is one piece of information from the database, it would be a lot of trouble to
go to to construct a formula with a VLOOKUP function in it. Typically you would use this
sort of functionality in a reusable spreadsheet, such as a template. Each time someone
enters a valid item code, the system would retrieve all the necessary information about the
corresponding item.

Let’s create an example of this: An Invoice Template that we can reuse over and over in
our fictitious company.

First we start Excel…

…and we create ourselves a blank invoice:

This is how it’s going to work: The person using the invoice template will fill in a series of
item codes in column “A”, and the system will retrieve each item’s description and price,
which will be used to calculate the line total for each item (assuming we enter a valid
quantity).

For the purposes of keeping this example simple, we will locate the product database on a
separate sheet in the same workbook:

In reality, it’s more likely that the product database would be located in a separate
workbook. It makes little difference to the VLOOKUP function, which doesn’t really care if
the database is located on the same sheet, a different sheet, or a completely different
workbook.

After typing the data above, select the range A1:D7 and name it ProdData (no spaces,
remember to press Enter after typing the name).

Range named (you will have your data typed in)


In order to test the VLOOKUP formula we’re about to write, we first enter a valid item code
into cell A11:

Next, we move the active cell to the cell in which we want information retrieved from the
database by VLOOKUP to be stored. Interestingly, this is the step that most people get
wrong. To explain further: We are about to create a VLOOKUP formula that will retrieve
the description that corresponds to the item code in cell A11. Where do we want this
description put when we get it? In cell B11, of course. So that’s where we write the
VLOOKUP formula – in cell B11.

Select cell B11:

At this stage we type the vlookup function:

=vlookup(A11,ProdData,2,False)

This will return the value: Refrigerator

Explanation

 The cell address (A11) contains the lookup value


 ProdData identifies the lookup range (A1:D7 on sheet 2)
 2 is the index column which hold the expected value. The referenced value is always
in Index 1. This means that the price is in Index 3 and the quantity in stock is in
Index 4.
 {Do not worry about the last entry “false”; just use it every time}
This is what you see when you start to type the formula:

Each section is represented as shown below:

=vlookup(A11,ProdData,2,False)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy