Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lära Looking Up Values | Calculating Data Like a Pro
A Fun Way to Excel

bookLooking Up Values

Svep för att visa menyn

Lookup functions solve one of the most common problems in spreadsheet work: you have data in one place and need to pull related information from another place based on a matching value.

You give the function a value to search for, tell it where to look, and tell it what to return when it finds a match. Excel handles the searching automatically, for every row, every time the data changes.

=XLOOKUP(lookup_value; lookup_array; return_array; [if_not_found])

Exact Match

An exact match requires the lookup value to correspond perfectly to something in the reference table — the default in XLOOKUP.

Approximate Match

An approximate match finds the closest value that does not exceed the lookup value, used for tiered systems like tax brackets or discount thresholds.

Note
Note

Approximate match requires the lookup array sorted ascending. An unsorted table produces wrong results silently.

In XLOOKUP, approximate match is controlled by the match_mode argument — the fourth optional argument after if_not_found. Setting it to -1 tells Excel: "if you can't find an exact match, return the next smaller value instead."

=XLOOKUP(lookup_value; lookup_array; return_array; [if_not_found]; -1)

0

-1

1

2

Exact match

Next smaller

Next larger

Wildcard

Default. Returns error if value not found exactly. Use for text categories.

If no exact match, returns result for the largest value ≤ lookup value. Use for tiered systems.

If no exact match, returns result for the smallest value ≥ lookup value.

Allows * and ? as wildcards in the lookup value for partial text matching.

VLOOKUP

VLOOKUP is still present in millions of spreadsheets and you will encounter it regularly. Its core constraint is structural: the lookup value must always sit in the first column of the table array, and it returns values by column index number. Insert a column between the lookup and return columns and that index number becomes wrong — VLOOKUP returns the wrong data without any warning. XLOOKUP references the return column directly, so it is immune to this problem.

=VLOOKUP(search_key; range; index; [is_sorted])
Note
Note

VLOOKUP still works and you will encounter it in inherited files. You need to be able to read it. But for any formula you write yourself, use XLOOKUP — it is more robust, more readable, and handles approximate matching more explicitly.

question mark

Hi

Vänligen välj det korrekta svaret

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 3. Kapitel 7

Fråga AI

expand

Fråga AI

ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

Avsnitt 3. Kapitel 7
some-alt