VLOOKUP (Vertical Lookup) is used to search for a specific value in the first column of a table and return a value in the same row from a specified column. To use it, you need a unique identifier (like an ID number or email) and a data table where that identifier exists in the leftmost column.
What You'll Need
- Microsoft Excel (any modern version).
- A source table containing the data you want to retrieve.
- A lookup value (the piece of information you already know and are searching for).
Step-by-Step
- Identify your lookup value: Determine which cell contains the value you are searching for. For example, if you have a list of Employee IDs in column A and you want to find the name for ID "105", cell A2 might contain "105".
- Select the destination cell: Click on the cell where you want the result to appear. Type
=VLOOKUP(to begin the formula. - Define the Lookup_value: Click the cell containing the value you are searching for (e.g., A2). Follow this with a comma.
Syntax so far:=VLOOKUP(A2, - Define the Table_array: Highlight the entire range of cells that contains both the lookup value and the data you want to retrieve. Ensure the lookup value is in the very first column of this selection. If your data is on another sheet, click that sheet tab and select the range. Follow this with a comma.
Syntax so far:=VLOOKUP(A2, D2:F100, - Define the Col_index_num: Count the columns in your selected range from left to right, starting with 1 for the leftmost column. Enter the number of the column that contains the information you want to return. For example, if the ID is in column 1 and the Name is in column 2, enter
2. Follow this with a comma.
Syntax so far:=VLOOKUP(A2, D2:F100, 2, - Define the Range_lookup: This tells Excel whether you want an exact match or an approximate match.
- Enter
FALSE(or0) for an Exact Match. This is the most common choice. - Enter
TRUE(or1) for an Approximate Match (used typically for tax brackets or grade scales).
Final Syntax:=VLOOKUP(A2, D2:F100, 2, FALSE) - Enter
- Complete the formula: Close the parentheses
)and press Enter.
Common Mistakes
- Lookup value not in the first column: VLOOKUP can only look to the right. If your unique ID is in the second column and the data you want is in the first, VLOOKUP will not work.
- Incorrect Column Index: Counting the columns based on the entire spreadsheet instead of the selected range. If your range is
C1:E10, column C is index 1, not index 3. - Forgetting the FALSE argument: If you omit the range lookup or set it to TRUE when you need an exact match, Excel may return the closest match instead of the correct one, leading to inaccurate data.
- Dynamic range shifts: When dragging a VLOOKUP formula down a column, the table range shifts unless you "lock" it. Use absolute references (dollar signs) like
$D$2:$F$100to keep the table fixed.
Tips
- Use Named Ranges: Instead of highlighting
D2:F100, you can name that range "EmployeeData" in the Name Box. Your formula becomes=VLOOKUP(A2, EmployeeData, 2, FALSE), which is much easier to read. - Data Cleaning: Ensure there are no leading or trailing spaces in your lookup values or your source table. A cell containing "105 " (with a space) will not match "105".
- Combine with IFERROR: To avoid seeing
#N/Awhen a value isn't found, wrap your formula in an IFERROR function:=IFERROR(VLOOKUP(A2, D2:F100, 2, FALSE), "Not Found").
Troubleshooting
If your VLOOKUP is not returning the expected result, try these steps in order:
- Check for #N/A: This usually means the value does not exist in the first column of your range. Double-check for typos or hidden spaces.
- Verify the first column: Ensure the value you are searching for is located in the leftmost column of the
Table_arrayyou selected. - Check data types: Ensure both the lookup value and the first column of the table are the same format. If one is formatted as "Text" and the other as "Number", VLOOKUP will fail even if they look identical.
- Lock your references: If the formula works for the first row but fails as you drag it down, ensure you used
$signs to lock your table range (e.g.,$D$2:$F$100). - Confirm the Column Index: Re-count the columns in your selection to ensure the
Col_index_numpoints to the correct data column.
Frequently Asked Questions
Can VLOOKUP look to the left?
No, VLOOKUP only searches the leftmost column and returns data to the right. To look to the left, you must use the INDEX and MATCH functions together or the XLOOKUP function in newer versions of Excel.
What is the difference between TRUE and FALSE in VLOOKUP?
FALSE finds an exact match; if the value isn't found, it returns an error. TRUE finds the closest match that is less than or equal to the lookup value, which requires the first column to be sorted in ascending order.
Does VLOOKUP work across different sheets?
Yes. When defining the Table_array, simply click the tab of the other sheet and select the range. Excel will automatically add the sheet name to the syntax (e.g., Sheet2!A2:B100).
What happens if there are duplicate values in the first column?
VLOOKUP only returns the first match it encounters. It will ignore any subsequent duplicates further down the table.
Is XLOOKUP better than VLOOKUP?
XLOOKUP is more flexible because it can look both left and right, defaults to an exact match, and doesn't require a column index number. However, it is only available in Microsoft 365 and Excel 2021 or later.