Vlookup Archives - Depict Data Studio https://depictdatastudio.com/tag/vlookup/ Fri, 21 Nov 2025 22:41:55 +0000 en-US hourly 1 https://wordpress.org/?v=7.1.4 How to Use Vlookup in Microsoft Excel: Two Step-by-Step Examples for Beginners https://depictdatastudio.com/how-to-use-vlookup-in-microsoft-excel-two-step-by-step-examples-for-beginners/ https://depictdatastudio.com/how-to-use-vlookup-in-microsoft-excel-two-step-by-step-examples-for-beginners/#comments Tue, 30 Mar 2021 15:08:00 +0000 https://depictdatastudio.com/?p=13023 Vlookup is my all-time favorite function in Excel! (Well, the entire lookup family—vlookup, hlookup, index-match, and xlookup.) In this blog post, I'll walk you through what what vlookup is used for, why it's tricky and how to fill in the four pieces of the formula. In this blog post, you’ll learn what vlookup is used for; why vlookup can be tricky; how to fill in the four pieces of the formula.

The post How to Use Vlookup in Microsoft Excel: Two Step-by-Step Examples for Beginners appeared first on Depict Data Studio.

]]>
Vlookup is my all-time favorite function in Excel!

(Well, the entire lookup family—vlookup, hlookup, index-match, and xlookup.)

In this blog post, you’ll learn:

  • What vlookup is used for;
  • Why vlookup can be tricky; and
  • How to fill in the four pieces of the formula.

What Vlookup Is Used for in Excel

Vlookup helps us merge data from various tables, sheets, and files into a single table that we can use for our analyses.

Why Vlookup is Tricky for Novices

Sometimes Excel novices are hesitant to try vlookup because it requires that you fill in four different pieces of information.

Learning the Excel lingo here is truly like learning a new language. Stick with it and keep practicing, and you’ll be a fluent vlookup user in no time!

Here’s the information that we’ll need to complete: =vlookup(lookup_value,table_array,col_index_num,[range_lookup])

Let’s walk through each of the four segments of the vlookup function.

Our Fictional Scenario

I’ve got five people: Ann, Isaac, Tony, Keely, and Dan. I’ve also got two different tables of data: Favorite Color and Favorite Food.

Let’s pretend I want to create a single dataset that contains both the colors and the foods together.

In a perfect world, I’d be able to copy and paste the colors and foods together.

But in the real world, we’ve typically got different numbers of people in each of the original tables. For example, we’ve got information about Ann, Isaac, Tony, and Dan in our Favorite Color table, but we’ve only got information about Ann, Keely, and Isaac in our Favorite Food table, so a simple copy and paste isn’t possible.

Sure, with just five people, we could fill in this information by hand. But what if our dataset contains information about 50 people? Or 50,000 people? Copying and pasting could take all day, and we’d probably make a million mistakes along the way. Vlookup to the rescue!

How to Use =Vlookup() in Microsoft Excel

Here’s how to fill in each of the four pieces of the vlookup formula.

Step 1: Fill in the lookup_value

First, let’s fill in the lookup_value, which is the first piece of the vlookup function.

The lookup_value is the cell that contains the person’s name or ID number that we’re interested in. These names or ID numbers are the links that connect all the tables together.

The names or ID numbers must be located in the first column of each table–in the first column of your new combined dataset and in the first column of every single table from which you’re pulling data.

In this example, watch as I type =vlookup( into cell B8. Next, click on the cell that contains the name or ID number that you want to look up in one of your other tables. Then, insert a comma, which moves us on to the second section of the function.

So far, my function reads: =vlookup(A8,

In this example, watch as I type =vlookup( into cell B8. Next, click on the cell that contains the name or ID number that you want to look up in one of your other tables. Then, insert a comma, which moves us on to the second section of the function.

Step 2: Fill in the table_array

Second, we have to indicate the table_array.

The table array is the table or dataset from which we’re pulling data.

In this example, we want to get information from the Favorite Color table into our master table down below. The table_array for the Favorite Color table is A1:B5. In other words, that table begins in cell A1 and ends in cell B5.

My function reads: =vlookup(A8,A1:B5,

In this example, we want to get information from the Favorite Color table into our master table down below. The table_array for the Favorite Color table is A1:B5. In other words, that table begins in cell A1 and ends in cell B5.

Step 3: Fill in the col_index_num

Third, we have to indicate the col_index_num.

This column index number is the number of the column we care about. Just type in the number of the column you’re interested in.

For example, we want to know favorite colors, which are located in the second column of our Favorite Color table, so we type a 2 into the vlookup function. As usual, conclude with a comma to move on to the fourth and final segment of our function.

My function reads: =vlookup(A8,A1:B5,2,

For example, we want to know favorite colors, which are located in the second column of our Favorite Color table, so we type a 2 into the vlookup function. As usual, conclude with a comma to move on to the fourth and final segment of our function.

Step 4: Fill in the range_lookup

Fourth, we need to indicate the range_lookup..

We have to type the word true or false into the fourth and final section of our vlookup function.

A true will give us an approximate match and a false will give us the exact information we’re looking for. We obviously want precise information, so type false into the function and end with a closing parenthesis.

My completed function reads: =vlookup(A8,A1:B5,2,false)

We can see that Ann’s favorite color is blue.

Fourth, we need to indicate the range_lookup. We have to type the word true or false into the fourth and final section of our vlookup function.

A Second Vlookup Example

Let’s go through a second vlookup example to make sure the four pieces of the function make sense.

We’ll continue creating a master table that combines content from both the Favorite Color and Favorite Food tables into a single table.

First, in cell C8, type =vlookup(A8, to set the lookup_value as Ann.

First, in cell C8, type =vlookup(A8, to set the lookup_value as Ann.

Second, indicate the boundaries of the Favorite Food table that we want to pay attention to. My function now reads =vlookup(A8,D1:E4

Second, indicate the boundaries of the Favorite Food table that we want to pay attention to. My function now reads =vlookup(A8,D1:E4

Third, tell Excel which column of the Favorite Food table to focus on. The foods are listed in the second column of that mini-table, so enter a 2 into the vlookup function. My function says =vlookup(A8,D1:E4,2

Third, tell Excel which column of the Favorite Food table to focus on. The foods are listed in the second column of that mini-table, so enter a 2 into the vlookup function. My function says =vlookup(A8,D1:E4,2

Finally, type false into the function and close your parentheses. The completed function says =vlookup(A8,D1:E4,2,false) and tells us that Ann’s favorite food is pizza. 

Finally, type false into the function and close your parentheses. The completed function says =vlookup(A8,D1:E4,2,false) and tells us that Ann’s favorite food is pizza.

Vlookup takes time to sink in, so go easy on yourself if you don’t “get it” right away. I promise that the time-savings from vlookup are worth the learning curve.

The post How to Use Vlookup in Microsoft Excel: Two Step-by-Step Examples for Beginners appeared first on Depict Data Studio.

]]>
https://depictdatastudio.com/how-to-use-vlookup-in-microsoft-excel-two-step-by-step-examples-for-beginners/feed/ 4
How to Categorize Values in Your Dataset with If and Vlookup in Microsoft Excel https://depictdatastudio.com/recategorize-values-with-if-and-vlookup-microsoft-excel/ https://depictdatastudio.com/recategorize-values-with-if-and-vlookup-microsoft-excel/#comments Tue, 17 Apr 2018 15:08:27 +0000 http://annkemery.com/?p=9709 The raw dataset you're given is rarely the one you actually want for your analyses. Clean, re-code, and re-categorize until you've got the groupings you need. I like to recode my data with two techniques: =IF() and =VLOOKUP().

The post How to Categorize Values in Your Dataset with If and Vlookup in Microsoft Excel appeared first on Depict Data Studio.

]]>
Data visualization is fast and easy for me because I have a solid foundation in spreadsheet skills. I feel totally at home in spreadsheets. Nerd alert: I actually enjoyed doing taxes this year (and FINALLY finishing and getting a refund didn’t hurt, either).

I initially learned about spreadsheets in the early ’90s from my nerdy economist dad. I was approximately 4 feet tall and was supposed to be studying for a 2nd grade spelling test. My dad convinced me that learning formulas early and practicing them often would change my life. As a 2nd grader, that sounded ridiculous. As an adult, I’m so thankful for those lessons. We sat together in the home office, staring at the glowing Lotus 1-2-3 screen, and practiced averages and medians. I didn’t know what a median was. But I was promised that it would be important someday. Turns out, my nerdy dad was right. This is the same guy who got me a toolbox for my 8th birthday that same year. I asked for an American Girl doll. Go figure. But I used that hammer and screwdriver just last weekend, so… thanks, dad.

Nowadays I spend the vast majority of my time teaching others about data visualization. But all too often, my students run into roadblocks because they don’t have a solid foundation in spreadsheet skills. A graph that should take them 5 minutes to design ends up taking an hour. They haven’t been exposed to the time-saving shortcuts yet. They’re not sure how to transform their raw dataset into summary tables (which would then feed into their graphs). Data visualization feels overwhelming because the data analysis is overwhelming.

Today, let’s relieve some of those data analysis burdens! I’m going to share my favorite two techniques for categorizing values.

You might need to categorize values if:

  • You have a list of zip codes but you really just care about the states.
  • You have a list of states but you really just care about the regions where those states are located.
  • You have a list of countries but you really just care about regions of the world.
  • You have a list of ages (0, 1, 2, 3, 4, 5, etc.) but you really just care about age ranges (0-9, 10-19, 20-29, etc.).
  • You have a list of schools but you really just care about which district the school is located within.
  • You have a list of test scores (40%, 55%, 70%) but you really just want to focus on students who passed or didn’t pass the exam.
  • You have a list of body mass indices (19, 24, 29, 32, etc.) but you want to categorize the raw numbers into underweight, normal weight, overweight, and obese.
  • You have a list of languages spoken but you really want to divide people into those who speak Mandarin and those who don’t.
  • You have a list of countries where people were born but you really just want to divide people into born in U.S. and not born in U.S.
  • … and so on.

The raw dataset you’re given is rarely the one you actually want for your analyses. Clean, re-code, and re-categorize until you’ve got the groupings you need.

Recategorize Values with =IF()

There are a couple ways to categorize your values: with if or vlookup.

This first option uses if. In this example, we’ll categorize a full list of produce types (apples, bananas, carrots, or watermelon). In the video, I’m demonstrating these formulas on a PC with Excel 2016. The formulas aren’t unique to Excel, though. You can use these formulas in any spreadsheet program (like Google Sheets, which I actually use more often than Excel these days).

First, we’ll categorize the individual values as either being either an apple or other type of food. I use these simple two-category breakdowns in projects a lot. No, I’m not usually categorizing apples. That would be a fun job though–an apple analyst! But I use this same technique to handle a lot of the transformations in the bullet point list above. For example, you could use this exact approach to categorize a long list of countries into being either United States or other.

Think of if formulas as if-then statements. You have to fill in three pieces of the formula:

  1. A logical argument (a mini statement that includes the greater than symbol, less than symbol, and/or equal to symbol)
  2. What your computer should do if that mini logic statement is true
  3. What your computer should do if that mini logic statement is false

Second, we’ll categorize the individual values as being either a fruit or a vegetable. This formula is a little more complex. It’s called a nested if formula because there are if statements inside of if statements inside of if statements inside of if statements! You’ll feel like a million bucks the first time you get a nested if formula right. But nested if statements are also a lot of work… which brings us to the second option, using a lookup formula like vlookup.

Recategorize Values with =VLOOKUP()

Your second option for categorizing your values is using a lookup function like vlookup.

I use lookup functions to join tables together. You can use vlookup in all sorts of scenarios. That’s why it’s one of my all-time favorite features of spreadsheets.

In this scenario–using vlookup to categorize values–we’ll need to build a separate lookup table. In this video, I’ll show you how I have the regular table that I’m trying to fill in. That’s the table where I want to turn my apples, bananas, carrots, and watermelons into apples or others and then into apples or vegetables.

Once we’ve built our lookup table, then we can use vlookup to help those tables talk to each other. I show you how in this video.

You can use either if or vlookup to sort your values into categories. You’ll get the same result either way. If tends to work best when you’ve only got a couple of categories. Vlookup tends to work best when you’ve got lots and lots of categories. Vlookup also tends to work better when your dataset is especially messy (apple and apples and typos like appel and aple). But, to some extent, it’s also a matter of personal preference. Both techniques take a while to master, so go easy on yourself if you have to practice a few times before you’re fluent.

Download the Spreadsheets

Want to practice if and vlookup? Download the materials and practice along with me.


Download the Spreadsheets ($0)

Comment and Share Your Ideas

Share some real-life examples. What types of values have you needed to categorize in your own projects? I tried to add a ton of examples to the bullet point list above, but there are infinite ways to apply these techniques.

The post How to Categorize Values in Your Dataset with If and Vlookup in Microsoft Excel appeared first on Depict Data Studio.

]]>
https://depictdatastudio.com/recategorize-values-with-if-and-vlookup-microsoft-excel/feed/ 9