Updated May 6, 2023
VLOOKUP Names
Vlookup is the most common function that is used in MS Excel activities. We all have used Vlookup to look up the values from the source table to the column or cell we want. But we all have faced the problem when we need to select the range of the table. And sometimes, we end up selecting the incorrect table range or column range in the lookup function. To avoid this, we have the provision of naming the range so that whenever we look up the value from that table or range, we can use the name given to that range. We named this article Vlookup Names and will show you how this works in the example below.
How to Use VLOOKUP Names?
To create a setup for Vlookup names, we need first to name the table so that only selecting or typing the name of that table will help us select the range. For this, we have some sample data below.
We have two sections, Name and Age, respectively. If we place the cursor on any cell, we will only get the cell position or vertex in the Name box. Let’s place a cursor at cell B1 first.
Now to name cell B1, let’s go to the name box and write the name we want to give to cell B1. Here we have chosen a Name.
After that, if we again place the cursor at cell B1, we can see the given name.
Examples of VLOOKUP Names
Lets us discuss the examples of Vlookup Names.
Example #1
In this example, we will see how to name the table used in the Vlookup function. This table has Owner, Quantity Sold, and Product Class columns. And besides that, we have a section where we will look up the value from the first table. For this, we have sales data as shown below.
Let’s look up the value for the owner name JOHN in cell F2 and get the quantity sold from the first table using Vlookup, as shown below.
We will then get the value of the quantity sold by John as 4159, as per the value from the first table.
Similarly, as shown below, we will look up the value for Product Class for the same owner John.
Now, once we enter, we can see the value from the first table to cell G2, as shown below.
Now to name the range for Vlookup, first select the data from cells A2 to C6. And after that, we can name the table range in any name in the Name Box, as highlighted below.
Let’s change the name to Sales_Info, as shown below.
Again we will apply the Vlookup in the second table as we did earlier. But this time, we will choose the saved table name as the lookup range. So, go to cell F2 and apply lookup, considering the owner as John again.
When we select the range, we will see it will get converted into the name saved name “Sales_Info”, as we can see below.
Once we enter, we will get the looked-up value from the first table to cell F2 for owner John.
Do the same thing to get product class as well in cell G2.
Once we enter, we will see the same value as of product class in cell G2, as shown below.
We will change the owner name here to test whether we get the correct value using Vlookup names. Let’s use the owner’s name as Sam at cell E2 and see what we get.
After putting Sam in cell E2, the value of Sam’s quantity sold and product class changed to 8486 and 210, respectively.
Example #2
Once we change the name of selected ranges, we can find all the named ranges of the workbook using the path below.
Formula menu -> Name Manager
Clicking on the Name Manager Option from the Formula tab, we will get the box with a list of names that we have changed or given to any range.
If we click the edit button, we can see the Named ranges upon selecting any listed named values.
Pros of Vlookup Names
- Vlookup names are easy to apply.
- Vlookup names save a lot of time in selecting the range.
- With the help of this, we can avoid any errors while selecting the ranges.
Things to Remember
- It is recommended to use Vlookup Names only when we need to apply Vlookup multiple times or select a huge set of lookup ranges.
- When naming the selected range, do not use spaces. Because spaces are not allowed while naming the range. Instead of space, use underscore (“_”)
- Vlookup names fix the range so the user does not get any error while executing the Vlookup function for any range.
- Do not consider the header while naming the selected range.
- We can edit or change the Vlookup names using the methods shown in example-2.
Recommended Articles
This has been a guide to VLOOKUP Names. Here we discuss How to Use VLOOKUP names, practical examples, and a downloadable Excel template. You can also go through our other suggested articles –