The most-searched function in Excel
Type the word VLOOKUP into a search engine's autocomplete and watch it finish the thought for you: VLOOKUP not working. VLOOKUP another sheet. VLOOKUP returns NA. VLOOKUP exact match. The pattern holds year after year — of all the functions in Excel's library of hundreds, this one keeps the search volume crown, because it is simultaneously the function everyone needs and the function everyone gets burned by. Nothing else comes close. There are formulas people don't know, and then there is VLOOKUP, which people know and still type wrong on Tuesdays.
The scenario is always some version of the same shape: a list of SKUs in one column, a price table on another sheet, and several hundred rows that need the right price brought across. In your head it's one motion — look it up. At the formula bar it's VLOOKUP with four arguments, two of which have famous traps, one of which gets omitted by people who don't know it has a default, and a column index that everyone counts off by one at least once in their career.
This generator is the un-burnable path. Fill in the lookup value, the table range, and the column that has the answer; choose exact or approximate; and out comes a correct VLOOKUP with the fourth argument written out, dollar signs on the range if you'll fill down, and a plain-English recap underneath — "finds SKU-233 in column A of Prices, returns column C, exact match only" — so you can check the formula against the sentence you meant. Copy, paste, done. The haunted autocomplete entries can be someone else's.
A form that writes your lookup
The tool asks for the four inputs in the order they matter to you, not the order the function wants them. What are you looking up — a value or a cell reference. Where is the table — a range on this sheet, or a range on another sheet, which the generator writes with the sheet name and dollar signs. Which column holds the answer — a number you pick from a labeled list rather than count on your fingers. And how should it match — exact, or banded approximate for tier tables.
From those fields it emits the formula with the details that separate a working lookup from a fragile one: the fourth argument always written explicitly (FALSE for exact, TRUE for banded), the range anchored with $ signs for fill-down, sheet references qualified properly, and text lookup values quoted while cell references stay bare. Alongside the formula, the recap sentence states the lookup in business language. That sentence is the feature people don't know they wanted until the first time it says "returns column C" and they realize they meant column D.
For shops on modern Excel, the generator also shows the XLOOKUP equivalent of the same inputs, because migrating the two forms in lockstep beats rewriting under deadline pressure. The XLOOKUP Formula Builder on this site is the dedicated version of that side; this page keeps the VLOOKUP flame for the enormous installed base of workbooks where it remains the lingua franca.
Generating a lookup in five fields
Enter the lookup value
A literal like SKU-233, or a cell reference like A2 for a fill-down column. The generator quotes literals and leaves references bare — the difference that produces #NAME? when hand-done wrong.
Define the table range
Type it or click it together: A2:C401, or Prices!$A$2:$C$401 for another sheet. A checkbox anchors it with dollar signs so fill-down doesn't stretch the range row by row.
Pick the return column
Choose from a list showing column letters and headers where given. The generator computes the index — counting the lookup column as 1 — and shows which letter the number lands on, killing the off-by-one before it ships.
Choose the match mode
Exact for IDs, names, SKUs — anything where close enough is wrong. Banded for sorted tier tables: commission rates, shipping weights, tax-style brackets.
Copy the formula
The output box holds the finished VLOOKUP with the recap underneath; one click copies it. The IFNA wrapper is an optional toggle for the "not found" text, quoted and closed for you.
Anatomy of the four arguments
VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup]). Four slots, and each one has a personality. lookup_value is the key you're matching — a literal or, in the overwhelmingly common fill-down case, a relative cell reference that changes per row. table_array is the rectangular range whose first column gets searched; the search column is always the first column, which is the entire reason the function can't look left. col_index_num counts columns from the left edge of that range, with the search column itself as 1 — a numbering scheme that surprises everyone exactly once and then lives in their fingers forever.
range_lookup is the argument with the reputation. FALSE means exact match only, #N/A otherwise. TRUE means approximate: return the row with the largest first-column value less than or equal to the lookup value — a binary-search-shaped behavior that demands an ascending-sorted first column and powers every banded-tier table built since the early 1990s. The trap is the default: omit the argument and Excel behaves as if you typed TRUE. On an unsorted product list, approximate mode doesn't error — it returns the price of whichever SKU happens to sort nearest below the one you asked for. Wrong answer, green checkmark, shipped.
| Argument | Role | Failure mode when wrong |
|---|---|---|
| lookup_value | The key being matched | Trailing spaces and text-stored numbers produce #N/A on data you can see |
| table_array | Range searched in its first column | Unanchored ranges stretch when filled down; whole-column refs slow recalc |
| col_index_num | Which column to return, counting from the key | Off-by-one grabs the neighboring column; insertions shift it silently |
| range_lookup | FALSE exact / TRUE banded approximate | Omitted → TRUE on unsorted data → plausible wrong answers, no error |
Two behaviors complete the picture. Text matching is case-insensitive, like the = operator, and in exact mode the lookup value can carry wildcards — "SKU-*" matches the first SKU-prefixed entry. And VLOOKUP returns the first match it encounters, top to bottom, which makes it the wrong tool for "the most recent record per customer" without a sort or a timestamp trick — a limitation the XLOOKUP comparison below addresses directly, since search-from-last is a one-argument setting there.
Two lookups, both directions of the match mode
The generator's two match modes exist for genuinely different jobs, so here is one of each, with data small enough to verify by hand. First: exact match, the classic SKU price fill.
Sheet "Prices", range A2:C4:
A B C
1 SKU Product Price
2 SKU-041 Brass fitting 8.40
3 SKU-117 Valve seat 21.75
4 SKU-233 Gasket kit 14.20
Sheet "Orders", column A holds SKUs to price.Input
Lookup value: A2 (holding SKU-233) Table: Prices!$A$2:$C$4 Return column: C (Price) Match mode: exact
Output
=VLOOKUP(A2, Prices!$A$2:$C$4, 3, FALSE) Returns 14.20. Recap: finds the value of A2 in the first column of Prices!A2:C4 and returns column C — confirmed as column 3, with the key column counting as 1. The $ anchors keep the range intact when filled down 400 rows; the FALSE keeps a missing SKU as a visible #N/A instead of a neighboring price.
Input
Tier table A2:B5, first column sorted ascending: A B 1 Monthly floor Rate 2 0 0.03 3 5000 0.05 4 15000 0.08 5 30000 0.12 Lookup values: 12400, 15000, 4999.99, 31000
Output
=VLOOKUP(D2, $A$2:$B$5, 2, TRUE) 12400 → 0.05 (clears the 5000 floor, not the 15000 floor) 15000 → 0.08 (exactly on a floor returns that band — the boundary rule) 4999.99→ 0.03 (a cent short of the floor stays in the lower band) 31000 → 0.12 And 0.50 → #N/A: below the first row's value, approximate match has nothing at-or-below to return, so it errors instead of guessing.
The banded example repays study, because it's the one place approximate match is not a trap but the feature itself — and its rules are precise. Equal-to-a-floor lands in that band. Below every floor is an error. And the whole mechanism assumes ascending order in the first column: one out-of-order row and the results above it become fiction. This is the same logic that powers tax-bracket tables and shipping-weight charts, and it is the reason the tier table, not the nested IF, is how experienced spreadsheet builders encode any thresholds that a business owner might change. The IF Formula Builder covers the branching alternative when the rule is too irregular for bands.
Failure modes worth memorizing
- #N/A on visible data. Trailing spaces (invisible in cells, visible in the formula bar), text-stored numbers on either side, and nonbreaking spaces pasted from web pages — the three horsemen. TRIM and CLEAN on the key column fix the first and third; multiply-by-1 paste special or VALUE() fixes the second.
- The silent column shift. Insert a column inside the table and col_index_num still points at position 3, which is now a different column. The formula recalculates cleanly and returns the wrong field. If your workbook screams at inserters, this is why.
- The unanchored fill-down. =VLOOKUP(A2, B2:C400, 2, FALSE) filled down shifts to B3:C401, B4:C402... and rows near the bottom start matching against a table that no longer contains their keys. $B$2:$C$400 — or the generator's anchor checkbox — is the fix.
- #REF! after deleting a column. The table shrinks below the index you asked for, and VLOOKUP says so the only way it can. Recover with undo; the formula won't self-heal.
- Duplicate keys return the first match. For a price list that's fine; for a transaction log where a customer appears repeatedly, it's wrong by design — the lookup needs a compound key (a helper column concatenating customer and date) or a different tool entirely.
- Case-sensitivity illusions. Because matching ignores case, ab-1 and AB-1 are the same key to VLOOKUP. If they're distinct products in your catalog, exact mode still won't separate them — build a key column through EXACT-compatible means instead of relying on the lookup.
- Approximate mode's sorting assumption. It's not "close is fine" — it's "largest value at or below, assuming ascending order." On unsorted data the behavior isn't random but is effectively unpredictable to a reader, which is worse. Exact mode or a properly sorted tier table; nothing in between.
- Whole-column ranges on huge sheets. VLOOKUP over A:B on a million-row sheet is optimized to the used range but still slower than a bounded range, and a workbook with thousands of such lookups recalculates at a pace people notice. Bound your ranges; your users' patience is a shared resource.
The people who look things up for a living
Procurement and inventory teams are the heartland: purchase orders with SKUs to price against vendor sheets, warehouse counts against item masters, catalog updates against last season's file. The work is periodic, high-volume, and exactly fill-down-shaped — one generated formula, several hundred rows, a deadline at four. The generator's anchored-range default exists because of this group specifically; the unanchored fill-down is their most common rework.
HR and finance run the same pattern on people and accounts: employee IDs against a directory, account codes against a chart of accounts, cost centers against department names. Their twist is privacy — the lookup table is often the sensitive artifact, and a tool that never touches the workbook, just emits a formula from typed references, is the right shape for data that shouldn't tour through third-party services. Admins assembling student gradebooks and rosters make up the third wave, arriving every September with the same energy and the same off-by-one.
And there's the permanent student population: VLOOKUP is the second formula taught in nearly every Excel course, right after SUM, and the homework due tomorrow is the same one the forums have answered since the 1990s. For them the recap line doubles as a tutor — the formula and the sentence it means, side by side, until the syntax stops being foreign.
VLOOKUP versus XLOOKUP versus INDEX/MATCH
The successor conversation is legitimate and worth having precisely, because the tradeoffs are real and version availability still decides plenty of shops.
| VLOOKUP | INDEX/MATCH | XLOOKUP | |
|---|---|---|---|
| Available since | Every Excel version, and Sheets | Every Excel version | Excel 2021/365; Sheets since 2022 |
| Default match | Approximate — the famous trap | Whatever MATCH's third arg says (0 = exact) | Exact by default |
| Search direction | Rightward only | Any direction | Any direction |
| Insert-column resilience | Breaks silently (static index) | Breaks visibly or not at all (column refs) | Unaffected (separate return range) |
| Built-in not-found text | No — wrap in IFNA | No | Yes — fourth argument |
| Search from last | No | Possible with MATCH type -1 | Yes — search_mode -1 |
| Readability to newcomers | Familiar but index-counting is opaque | Two functions, clear to the initiated | One function, plainest arguments |
Our recommendation, stated plainly: build new lookups with XLOOKUP if every consumer of the workbook is on Excel 2021, Microsoft 365, or current Google Sheets. Stay with VLOOKUP when the file travels — to a client on Excel 2016, a plant machine on 2013, a regulator who opens anything — because #NAME? in a recipient's Excel is a worse failure than any VLOOKUP quirk. INDEX/MATCH remains the correct answer in workbooks that already speak it and in the leftward-lookup cases on old versions. The generator emits VLOOKUP and shows the XLOOKUP twin, which is exactly how migrations should happen: side by side, workbook by workbook, never in one heroic Friday-night rewrite.
Copy, paste, close the tab
The generator never opens a workbook, so there's nothing to upload and nothing to leak. The fields hold references and literals you type — A2, Prices!$A$2:$C$4, SKU-233 — and the formula is assembled locally in your browser. No account, no saved history, no server-side assembly. The tool works offline after the page loads, and closing the tab ends its memory of you entirely.
That design is deliberate for lookup work specifically. The values people look up — salaries keyed by employee ID, account balances by account number, prices by confidential SKU — describe the business's nervous system. A generator that required handing over the table to explain a formula would be a bad trade. This one asks for the shape of your data, not the data, and the shape was never secret to begin with.
The questions every VLOOKUP search resolves to
Why does my VLOOKUP return #N/A when I can see the value in the table?
Ninety percent of the time it's one of three things: the lookup value has a trailing space the table version doesn't (or vice versa), one side is a number stored as text while the other is a real number, or you're in approximate mode on unsorted data. Trim, align types, and force exact match with FALSE — in that order. The generator's recap line catches reversed ranges and wrong column indexes, which cover most of the remaining ten percent.
What does the fourth argument actually do, and what happens if I leave it off?
It selects match mode: FALSE (or 0) demands an exact match; TRUE (or 1) accepts the closest value at or below the lookup, which requires the first column sorted ascending. Leave it off and Excel assumes TRUE — the default that has quietly produced wrong answers since the early 1990s. For ID, SKU, and name lookups, always write the FALSE. The generator never omits it and shows both forms so the difference stays visible.
How do I count the column index number?
Start at the lookup column and count right, with the lookup column itself as column 1. If SKU is column A and price is column C, price is column 3 — not 2, which is the count starting after the key. That off-by-one is the single most common VLOOKUP mistake after the match-mode default, and it's why the generator labels the index with the column letter it lands on.
Can VLOOKUP look to the left of the key column?
No. VLOOKUP only searches the first column of the range and only returns values to the right of it. Leftward retrieval requires INDEX with MATCH — =INDEX(A:A, MATCH(F2, B:B, 0)) — or XLOOKUP, which has no direction restriction. Rearranging the table or adding a helper copy of the key column on the left are the classic workarounds when the layout can't change.
Why does my VLOOKUP break when someone inserts a column?
The column index is a literal number, so inserting a column inside the table shifts the return column one position right while the formula still asks for position 3. Result: no error, just data from the wrong column. Anchoring the range with dollar signs prevents the range from stretching, but nothing built into VLOOKUP protects the index. XLOOKUP's separate return-range argument is the structural fix.
How do I show a blank or custom message instead of #N/A?
Wrap the lookup in IFNA: =IFNA(VLOOKUP(A2, D:E, 2, FALSE), "not found"). IFNA catches only the not-found error, unlike IFERROR which also hides #REF! and #VALUE! — errors you usually want to see. Use IFNA, not IFERROR, for lookup fallbacks.
Does VLOOKUP work the same in Google Sheets?
Yes — same name, same four arguments, same match-mode semantics, and the same approximate-by-default behavior if you omit the fourth argument. Formulas generated here paste directly into Sheets. Sheets additionally offers its own XLOOKUP since 2022 and always had ARRAYFORMULA for filling a column from one formula.
Is the generator free, and does it see my table or data?
Free, and it sees only what you type into its fields — references like D:E or a sample lookup value, never the workbook. Everything runs as client-side JavaScript in this tab: no upload, no account, no stored formulas. Close the page and it's gone.
Documentation behind the details
Sources and further reading
- Microsoft Support, VLOOKUP function(support.microsoft.com)
- Exceljet, VLOOKUP function — argument behavior and the approximate-match rules(exceljet.net)
- Exceljet, XLOOKUP function — for the successor comparison(exceljet.net)
- Microsoft Support, Excel functions by category(support.microsoft.com)
We cite primary sources (standards bodies, government agencies, official documentation) wherever they exist so you can verify every number on this page yourself.