The basic format for VLOOKUP in Excel is =VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup]). For example, =VLOOKUP("A-100", A2:C10, 2, FALSE) searches for “A-100” in column A of the range A2:C10 and returns the value from the second column of that range. The fourth argument is optional; use FALSE for an exact match (most common) or TRUE for an approximate match (used for ranges like tax brackets).
What Is VLOOKUP and What Does It Do?
VLOOKUP stands for “Vertical Lookup.” It searches for a value in the first column of a table and returns a value from a column to the right in the same row. It is one of the most-used functions in Excel for combining data from different tables, such as matching employee IDs to names or product codes to prices.
Breaking Down the VLOOKUP Syntax
Each part of the formula has a specific role:
- lookup_value – the value you want to search for (e.g., a product code, an ID, or a cell reference like
B2). - table_array – the range of cells that contains the data. The lookup value must be in the first column of this range. Use absolute references (e.g.,
$A$2:$D$100) so the range doesn’t shift when you copy the formula. - col_index_num – the column number in the table_array from which to return a value. The first column is 1, the second is 2, and so on.
- [range_lookup] – optional; enter
FALSEfor an exact match orTRUE(or omit) for an approximate match. For most cases, useFALSEto avoid unexpected results.
How to Use VLOOKUP: Step-by-Step Example
Suppose you have a product list in cells A2:C10 with Product ID in column A, Product Name in column B, and Price in column C. You want to find the price for the product ID in cell E2.
- Click on cell F2 where you want the price to appear.
- Type
=VLOOKUP(E2, $A$2:$C$10, 3, FALSE). - Press Enter. Excel returns the price from column C for the matching product ID.
If E2 contains “P-101” and the table has P-101 in A3 with a price of 25.50 in C3, the formula returns 25.50.
Mac and Excel for the web: The function works the same, but on Mac you use Command instead of Ctrl for shortcuts. The formula syntax is identical.
Exact Match vs. Approximate Match: Which to Choose?
The fourth argument determines how Excel matches the lookup value:
- FALSE (exact match) – finds the first row where the lookup value exactly equals the value in the first column. Use this for IDs, names, or any data that must match precisely. If no match is found, VLOOKUP returns
#N/A. - TRUE (approximate match) – finds the largest value in the first column that is less than or equal to the lookup value. This requires the first column to be sorted in ascending order. Use this for tiered data like tax rates or shipping costs.
Example of approximate match: With tax rates in A2:B5 (A: income, B: rate), =VLOOKUP(45000, A2:B5, 2, TRUE) returns the rate for the row where income is the largest value ≤ 45000.
Common VLOOKUP Errors and How to Fix Them
Several #N/A errors are common and usually easy to resolve:
- #N/A – No match found: The lookup value does not exist in the first column. Check for typos, extra spaces, or numbers stored as text.
- #REF! – Column index too large: The
col_index_numis greater than the number of columns intable_array. Count the columns in your range. - #VALUE! – Wrong data type: The lookup value or column index is not valid. Ensure
col_index_numis a number. - Incorrect results with TRUE: If you use TRUE and the first column is not sorted, results are unreliable. Sort the first column or switch to FALSE.
Tip: To handle #N/A gracefully, wrap VLOOKUP in IFERROR: =IFERROR(VLOOKUP(E2, A2:C10, 3, FALSE), "Not Found").
VLOOKUP vs. XLOOKUP: What’s the Difference?
XLOOKUP (available in Excel 2021 and Microsoft 365) is a modern replacement that fixes several VLOOKUP limitations:
- XLOOKUP can search to the left (VLOOKUP only returns columns to the right).
- XLOOKUP defaults to an exact match, so you don’t need to specify FALSE.
- XLOOKUP can return multiple values or handle arrays natively.
- XLOOKUP has built-in error handling via the
[if_not_found]argument.
Example: =XLOOKUP(E2, A2:A10, C2:C10) returns the price from column C for the ID in E2. If you have Microsoft 365, XLOOKUP is often easier, but VLOOKUP remains widely used and is still supported.
Frequently Asked Questions
Can VLOOKUP return a value from a column to the left?
No. VLOOKUP can only return values from columns to the right of the first column. If you need to look to the left, use INDEX/MATCH or XLOOKUP. For example, =INDEX(A:A, MATCH(D2, B:B, 0)) returns the value in column A that matches D2 in column B.
Why is my VLOOKUP returning #N/A even though the value exists?
This usually happens when the lookup value in the table is stored as text while your lookup value is a number (or vice versa), or there are invisible spaces. Use =TRIM(A2) to remove extra spaces, or convert text to numbers with =VALUE(A2). Also check that the lookup value is in the first column of the table_array.
Do I need to sort data for VLOOKUP?
Only if you use TRUE or omit the fourth argument. For exact match (FALSE), sorting is not required. If you use approximate match, the first column must be sorted ascending.
Can I use VLOOKUP to return multiple columns?
VLOOKUP returns only one value per formula. To return multiple columns, either write separate VLOOKUP formulas for each column or use XLOOKUP with an array return, or use INDEX/MATCH. In Microsoft 365, you can also use the # spill operator if you combine functions like FILTER.
Is VLOOKUP case-sensitive?
No, VLOOKUP is not case-sensitive. It treats “APPLE” and “apple” as the same. If you need case-sensitive matching, use INDEX and MATCH with EXACT, or use XLOOKUP with the match mode argument (though XLOOKUP is also not case-sensitive by default).
What is the difference between VLOOKUP and HLOOKUP?
VLOOKUP searches vertically (down a column) while HLOOKUP searches horizontally (across a row). Use VLOOKUP when your lookup value is in a column; use HLOOKUP when it is in a row. HLOOKUP is less common because most data is organized in columns.
Related
- Nice Data Entry Software? Top Picks & How to Choose
- C Generate Random Number in Range: Full Guide
- 20 Computer Shortcut Keys That Save Time Daily
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Excel COUNTIF: Find Text From a ListTo count cells that contain any text from a list in Excel for Microsoft 365, use =SUM(COUNTIF(A2:A10,"*"&C2:C4&"*")), where…
- Excel Formula for Budget Amount RemainingIf your total budget is in B2 and the amount spent is in C2, enter =B2-C2 in another…
- Delete Left Text in Excel: Formulas and MethodsTo remove a set number of characters from the left of a cell in Excel, enter =REPLACE(A2,1,3,"") in…
- Excel COUNTIF Not Equal to Text: Formula & FixesTo count cells in Excel that do not equal a specific text value, use the formula =COUNTIF(range,"text"). For…
- What-If Analysis in Excel: How It Works and When to Use ItWhat-If Analysis in Excel is a set of tools for seeing how changing input values affects a formula’s…
- Excel VLOOKUP Multiple Values: Formulas That WorkTo return every matching row for one lookup value in Microsoft 365, use FILTER rather than VLOOKUP. With…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.