VLOOKUP is a spreadsheet function that searches for a value in the first column of a range and returns the value from a specified column in the same row. Among office applications, it is one of the most widely used formulas in Microsoft Excel, Google Sheets and LibreOffice Calc, where it joins data from separate tables by a shared key such as a product code, employee ID or invoice number.
The “V” stands for vertical, because the function scans down a column; its sibling HLOOKUP scans across a row. VLOOKUP remains essential knowledge for anyone who maintains spreadsheets, even though newer functions such as XLOOKUP and the INDEX and MATCH combination now overcome most of its limitations.
How the VLOOKUP function works
VLOOKUP works by taking a lookup value, locating it in the leftmost column of a table array, moving across that row by a given number of columns and returning the cell found there. The full syntax is =VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup]), and the same argument order applies in Google Sheets and LibreOffice Calc, where the last argument is sometimes called the sort order.
The table below explains each argument and its typical values.
| Argument | Meaning | Typical value |
|---|---|---|
| lookup_value | The value to find | A cell reference such as A2 |
| table_array | The range to search, key column first | An absolute range such as $E$2:$H$500 |
| col_index_num | Column number to return, counted from 1 | An integer such as 3 |
| range_lookup | Match mode: approximate or exact | FALSE for exact match |
With exact match (FALSE or 0), VLOOKUP returns the first row whose key equals the lookup value, or the #N/A error if none exists. With approximate match (TRUE or omitted), it assumes the first column is sorted in ascending order and returns the last row whose key is less than or equal to the lookup value, which is useful for brackets such as tax rates or discount tiers.
Exact match and approximate match in practice
Choosing the match mode is the single most consequential decision in a VLOOKUP formula. Because approximate match is the default when the fourth argument is omitted, many incorrect results come from formulas that silently use a mode the author never intended.
This table compares the two modes on the points that matter for correct results.
| Aspect | Exact match | Approximate match |
|---|---|---|
| Argument value | FALSE or 0 | TRUE, 1 or omitted |
| Sorting required | No | Yes, ascending by key column |
| Result when key is missing | #N/A error | Nearest lower key |
| Search method | Linear scan | Binary search, much faster on large ranges |
| Typical use | Codes, IDs, names | Grade bands, price tiers, commission levels |
The speed difference is real on large data sets: a binary search over 100,000 sorted rows needs about 17 comparisons, while a linear scan may need tens of thousands. Some advanced users exploit this with a double approximate lookup that checks for an exact hit, but the technique depends on perfectly sorted data and is easy to break.
VLOOKUP compared with XLOOKUP and INDEX and MATCH
VLOOKUP has well-known structural limits, and the alternatives exist mainly to remove them. Its biggest constraint is that the key column must be the leftmost column of the range, so it cannot return values to the left of the key, and its column number is a hard-coded integer that breaks when someone inserts or deletes a column.
| Feature | VLOOKUP | INDEX and MATCH | XLOOKUP |
|---|---|---|---|
| Return column left of key | Not possible | Possible | Possible |
| Robust to inserted columns | No, index is fixed | Yes | Yes |
| Default match mode | Approximate | Exact with 0 in MATCH | Exact |
| Built-in not-found value | No, needs IFERROR or IFNA | No, needs IFERROR or IFNA | Yes, fourth argument |
| Search from the last row | No | Only with workarounds | Yes, search mode argument |
| Availability | All spreadsheet programs | All spreadsheet programs | Excel in Microsoft 365, Excel 2021 and later, Google Sheets, recent LibreOffice |
For new work in Microsoft 365 or Google Sheets, XLOOKUP is usually the better default. VLOOKUP still makes sense when a workbook must open in older Excel versions, when colleagues already understand it, or when a simple left-to-right lookup is all that is required. For relationships across many tables, a pivot table or Power Query merge is often more maintainable than hundreds of lookup formulas.
Common VLOOKUP errors and how to fix them
Most VLOOKUP problems come from data that looks identical but is not, or from ranges that shift when formulas are copied. The #N/A error is not always a fault: with exact match it correctly signals that the key does not exist, so the first diagnostic step is to confirm whether a match should exist at all.
| Symptom | Likely cause | Fix |
|---|---|---|
#N/A although the key is visible | Number stored as text, or the reverse | Convert types with VALUE or TEXT, or clean the source |
#N/A for some rows only | Leading or trailing spaces | Wrap keys in TRIM or clean the data |
| Wrong value returned | Approximate match on unsorted data | Set the fourth argument to FALSE |
#REF! error | Column index exceeds range width | Correct col_index_num or widen the range |
| Results break after copying down | Relative table_array reference | Make the range absolute with $ signs |
| Results wrong after inserting a column | Hard-coded column number | Use MATCH for the index, or switch to XLOOKUP |
Two further pitfalls deserve attention. VLOOKUP is not case-sensitive, so “abc” and “ABC” are treated as the same key, and it always returns the first match only when duplicates exist. If keys can repeat, deduplicate the lookup table first or use a filtering function that returns every match.
Good practice for reliable lookups
Reliable VLOOKUP formulas depend as much on disciplined data structure as on the formula itself. Lookup tables work best when they are stored as structured tables with one row per key, consistent data types and no merged cells.
- Always state the fourth argument explicitly, normally
FALSE, so the match mode is visible to anyone reading the formula. - Use structured table references or named ranges so that the lookup range grows automatically with new rows.
- Wrap results in IFNA rather than IFERROR when only missing keys should be handled, so genuine formula errors stay visible.
- Keep lookup tables on a dedicated sheet and protect them from accidental edits.
- Avoid whole-column ranges in very large workbooks, because they can slow recalculation noticeably.
The idea in brief
VLOOKUP lets a spreadsheet look something up in a list for you. You give it a value, such as a product code. It finds that code in the first column of a table. Then it reads the answer from another column in the same row.
It works like finding a name in a phone book and reading the number next to it. The main thing to remember is to ask for an exact match. Otherwise the spreadsheet may quietly return a nearby entry instead.
A practical scenario
An accounts assistant at a wholesale distributor receives a monthly export of 3,200 order lines that contains product codes but no prices. The current price list, with about 850 products, sits on a separate sheet with the product code in column A and the unit price in column D.
In the order sheet, the assistant enters =IFNA(VLOOKUP(B2, Prices!$A$2:$D$851, 4, FALSE), "Check code") and copies it down all 3,200 rows. Within seconds every line shows its unit price, and 14 lines display “Check code” because they reference discontinued products.
A second formula multiplies price by quantity, and the monthly invoicing preparation that previously took most of a day by manual searching is finished in under an hour, with the discontinued items flagged for the sales team to review.