Vlookup function: Syntax and usage in Excel

The Vlookup function is a function that searches for values ​​to return other values ​​in an existing worksheet. The Vlookup function is one of the most used functions in Excel , applying to many practical tasks such as calculating electricity charges based on electricity numbers, giving academic results based on average score, taking data on place of birth, gender Employee calculation based on employee name or code ...

Although the applicability is very high, many people still do not understand the nature of this function like? Syntax like? How to use this function? So please refer to the following article of Download.com.vn to better understand:

The syntax of the Vlookup function

Syntax:

= VLOOKUP (lookup_value, table_array, col_index_num, [range_lookup])

Quick explanation: VLOOKUP (The value you want to look up, the range in which you want to find the value, the number of columns in the range containing the return value, Exact or Relative return results - expressed as 0 / FALSE or 1 / TRUE)

Explain each value:

  • Lookup_value: The value used to look up and search - this should be a data that is not duplicated, the ability to search is accurate. For example: employee code, student code, goods code, account code, asset code ...
  • Table_array: The lookup table or range containing lookup values, remember that the lookup value (Lookup_value) must always be in the first column of this table. The search data area should be in absolute address form (marked with $ in front of the row and column by pressing F4) so ​​that when copied, the formula will still work properly.
  • Col_index_num: The order of the column to retrieve data on the lookup value table. Counts from the left of the region to the column to retrieve data to see what column it is.
  • Range_lookup: Range of search, you can leave 1 or True equivalent to return relative data (great practice in returning data from how many to how many houses), 0 or False equivalent. returns absolute data.

How to use the Vlookup function in Excel?

1. How to find relative Vlookup

Relative searching with the Vlookup function is a way of finding relative data based on the difference between the first column data of the search area. To find relative results that return true results, your original data table (which is your Table_array table ) is required to sort in ascending order.

Example 1: Please classify students in the list below, based on the table of rules of grading by:

Vlookup function: Syntax and usage in Excel

To classify academic performance for a student list, use the formula:

=VLOOKUP(C4,$C$11:$D$15,2,1)

Then press Enter , then scroll down to the remaining cells you will get the results as shown below:

Vlookup function: Syntax and usage in Excel

2. How to find absolute Vlookup

Example 2: Based on the employee code table below, fill in their Qualifications and Hometown .

Vlookup function: Syntax and usage in Excel

To fill in the Employee Information field of cell E23 use the following formula:

=VLOOKUP(A23,$A$29:$C$34,2,0)

And here is the result:

Vlookup function: Syntax and usage in Excel

Also fill in the Level for F23, use the following formula:

=VLOOKUP(A23,$A$29:$C$34,3,0)

And this will be the result that will be obtained:

Vlookup function: Syntax and usage in Excel

How to use the advanced Vlookup function

In addition to the simple usage as above, you can customize to have a more flexible Vlookup function, especially in cases where the search data table is too wide and the column counting becomes ... tiring.

Vlookup function combines Match

The MATCH function looks for a specified value in a range of cells, then returns the relative position of that value in this range. For example, if the range A1: A3 contains values ​​5, 10 and 15, the formula = MATCH (10, A1: A3,0) will return the number 2, because 10 is the second value in the range A1: A3. The syntax of the Match function is as follows:

= MATCH (lookup value, lookup array, [match type])

So, where does the Match function apply to Vlookup? Please tell you it is in the value Col_index_num - the column to get data. Putting it into a specific example will make it easier for you to imagine. 

Example: Given the following data table:

Vlookup function: Syntax and usage in Excel

Need to filter the data by month for each employee in the main table (the month column in the main table may vary). Specifically, the spreadsheet will look like this:

Vlookup function: Syntax and usage in Excel

The formula used in the lesson:

= VLOOKUP (A3; $ A $ 14: $ G $ 20; MATCH ($ B $ 2; $ A $ 13: $ G $ 13; 0) ; 0)

The Match function will help you count the number of columns to be retrieved in the lookup data table (side table) of the Vlookup function. So, just change the Month data in cell B2 , you will have the exact data for each corresponding month. In the following example, I change the month column data in the Main Table and the result is: 

VlookUp function in combination with LEFT, RIGHT, MID functions

Also one of the most used functions, Left / Right and Mid can combine with Vlookup and make miracles in search. 

Example: For the following table, fill in the blank data based on the sub tables below:

Vlookup function: Syntax and usage in Excel

The input data to fill in the data is described as follows: The first 2 characters of the Employee descriptor code for the job position, the middle character in the gender description, the characters at the end of the description for the multiplier tablets work. Based on that, we will fill in the formula for calculating each column as follows:

CV position = VLOOKUP ( LEFT (C3; 2) ; $ B $ 22: $ C $ 24; 2; 0)
Workplace = VLOOKUP ( RIGHT (C3; LEN (C3) -5) ; $ E $ 22: $ F $ 23; 2; 0)
Sex = VLOOKUP ( MID (C3; 4; 1) ; $ E $ 27: $ F $ 28; 2; 0)

And this is the result:

Vlookup function: Syntax and usage in Excel

What is the #NA error in Vlookup function? How to correct a #NA error

The #NA error stands for Not Available Error which means the corresponding value cannot be found. It is possible that in this case you have used absolute search and the data you are looking for is not in the range containing the lookup value ( Table_array ).

There are many reasons for this: it is possible that the lookup value ( Lookup_value ) in the main table and sub-table (in the above example) is different with only one space (space), the data cannot be found. or you get the wrong part of the Table_array area so that the data to be searched ( Lookup_value ) is not in the first column of the Table_array ...

So, depending on the specific case, you need to fix the #NA error in Vlookup function properly, just remember only one thing: the data to be searched should be absolutely right with the first column of the table containing the lookup value. If absolute searching is used (Range_lookup = 0) .

So you already know how to use the Vlookup function. In the process of using Excel you can also use the Index function to return values ​​in an array or the Max and Min functions for the largest and smallest values.

When you master the syntax, how to use functions in Excel, you will learn Excel effectively, much faster. In addition, there are many other useful functions, Download.com.vn will introduce to you in the following articles.

I wish you successful implementation!

Sign up and earn $1000 a day ⋙

IObit Malware Fighter 11 Review 2024

IObit Malware Fighter 11 Review 2024

When your computer gets attacked by a virus or malware, you’ll certainly such for a powerful antivirus to fight back. Well, IObit Malware Fighter is exactly what you need. From its name alone, you can be certain that you are getting the tough protection your computer needs.

How To Find Quality And Fast Internet In Montreal

How To Find Quality And Fast Internet In Montreal

Montreal, a city brimming with culture, history, and Poutine (a famous Canadian dish), deserves an internet connection that can keep up. Whether you’re a streamer glued to Twitch, a workaholic juggling video conferences, or a casual web surfer, a reliable and fast internet plan is essential.

Google Drive for desktop will be discontinued in March 2018

Google Drive for desktop will be discontinued in March 2018

Google Drive for desktop will be discontinued in March 2018, Google has officially announced that it will stop supporting Google Drive for desktop and then the company will remove the application.

Simple ways to fix AirDrop not working error

Simple ways to fix AirDrop not working error

Simple ways to fix AirDrop not working error, AirDrop not working on iPhone, iPad, Mac what to do? This article will provide you with simple ways

TOP best computer screen recording software 2024

TOP best computer screen recording software 2024

TOP best computer screen recording software 2024, Which is the best lightweight, free, high-quality computer screen recording software? Let's find out the top with WebTech360

What is an email address? How to get an email address?

What is an email address? How to get an email address?

What is an email address? How to get an email address?, What is an email address? What is email address entry? This article will answer all your related questions

Every WhatsApp shortcut for computer you need to know

Every WhatsApp shortcut for computer you need to know

Every WhatsApp shortcut for your computer you need to know, WhatsApp is one of the most popular free messaging apps today. The keyboard shortcuts below will help

Unlocking Baccarats Social Thrills: Tedbets Global Gaming Hub

Unlocking Baccarats Social Thrills: Tedbets Global Gaming Hub

Discover the vibrant social scene of baccarat on Tedbet, where players worldwide connect, chat, and enjoy the excitement of live dealer games.

Summary of how to find videos on TikTok

Summary of how to find videos on TikTok

Summary of how to find videos on TikTok, Finding videos on TikTok is not difficult. Let's learn together how to find the original video on TikTok or find the Tik Tok clip you want to watch

Improved mouse sensitivity for Free Fire on BlueStacks

Improved mouse sensitivity for Free Fire on BlueStacks

Improved mouse sensitivity for Free Fire on BlueStacks, BlueStacks has made important improvements for Free Fire gamers. Please upgrade BlueStacks 4.230.10

Huang you: Butter Camera sparkling photo editing app

Huang you: Butter Camera sparkling photo editing app

Huang you: Sparkling photo editing application Butter Camera, Huang you (黄油 相机) is an extremely hot Chinese editing application today, here we would like to invite you

Tips for using Chrome Web Store you need to know

Tips for using Chrome Web Store you need to know

Tips for using Chrome Web Store you need to know, Chrome Web Store or Chrome Web Store offers a selection of apps, extensions and stylish browser wallpapers

What is CapCut? Is it safe to use CapCut?

What is CapCut? Is it safe to use CapCut?

What is CapCut? Is it safe to use CapCut?, What is CapCut? Is music on CapCut copyrighted? Let's find out with WebTech360 what you need to know about CapCut!

Why is buying TikTok coins cheaper on PC?

Why is buying TikTok coins cheaper on PC?

Why is it cheaper to buy TikTok coins on PC?, TikTok gives users the option to exchange real money for coins in the app. However, buying TikTok coins on PC is cheap

How much Internet capacity does Zoom use?

How much Internet capacity does Zoom use?

How much Internet capacity does Zoom use?, Zoom is an indispensable remote online learning and working software during the epidemic, but it can be extremely bandwidth-consuming.

EmuOS: Relive your childhood with legendary games of the past

EmuOS: Relive your childhood with legendary games of the past

EmuOS: Relive your childhood with legendary games of the past, EmuOS is a Web interface that simulates basic Windows 3.1, 95, 98, NT operating systems that provide a lot

TOP best ways to open and read PDF files on your computer

TOP best ways to open and read PDF files on your computer

TOP best ways to open and read PDF files on your computer. How to open PDF files on your computer is not too difficult. In fact, you have many ways to read PDF files. Join WebTech360

Iris in Free Fire: Skills, weapons, skill combos

Iris in Free Fire: Skills, weapons, skill combos

Iris in Free Fire: Skills, weapons, skill combos, Iris is the newest female character in Free Fire OB35, with the ability to break the meta. Here's everything you need to know

What should I do if Netflix is ​​hacked?

What should I do if Netflix is ​​hacked?

What should I do if my Netflix account is hacked? What should I do if my Netflix account is hacked? Here's what you need to know when your Netflix account is hacked.

Tips for using LDPlayer you may not know

Tips for using LDPlayer you may not know

Tips for using LDPlayer you may not know. LDPlayer is one of the most popular Android emulators on computers today. This article will provide it to you