Lookup Functions
IntermediateLesson 3 of 7 in Spreadsheet Formulas and Functions Course
What you will learn
- Explain what a lookup does and why it beats copying values by hand, then use XLOOKUP to return matching values from a table in any direction, control how it matches, and avoid the data problems that make a lookup fail.
- Understand how a lookup worksLearn the parts of every lookup, how a lookup table should be laid out, and which lookup functions exist in which spreadsheet programs.
- Write an exact-match XLOOKUPBuild an XLOOKUP step by step, return values from a column to the left or from a whole row, and copy the formula without breaking its ranges.
- Control matching and fix data that will not matchHandle uppercase and lowercase, numbers stored as text, extra spaces, repeated keys and partial matches with wildcards, and choose the right search direction.
- Understand how a lookup works
- Read and write the older lookup functions that appear in countless existing workbooks, set their match type deliberately, and know their limits so you can fix or replace them.
- Look up values with VLOOKUPWrite VLOOKUP with an exact match, count the column number correctly, and avoid the default approximate match, left-lookup limits and broken column numbers.
- Look up across rows with HLOOKUPUse HLOOKUP for tables whose labels run across the top row, count the row number correctly, and replace it with XLOOKUP where that is more robust.
- Look up values with VLOOKUP
- Find the position of a value with MATCH or XMATCH, turn a position into a value with INDEX, and combine them for flexible lookups that work in every version, including lookups by row and column at once.
- Find positions with MATCH and XMATCHUse MATCH and XMATCH to return where a value sits in a list, set their match types correctly, and use positions to test whether a value exists.
- Return values with INDEX and MATCHUse INDEX to fetch a value by position and combine it with MATCH or XMATCH for lookups in any direction that survive inserted columns and work in every version.
- Look up by row and column at onceFind the value where a chosen row label and column header meet, using INDEX with two MATCH functions, nested XLOOKUP or VLOOKUP with MATCH.
- Find positions with MATCH and XMATCH
- Use approximate matches to place a number or date in the right band, such as a shipping cost by weight or a discount by quantity, and set up band tables so the boundaries follow the rule you mean.
- Find the band a value falls intoBuild a band table of lower limits and use VLOOKUP, MATCH or XLOOKUP to return the rate for the band a value belongs to, including values on a boundary.
- Use next-larger matches, upper limits and datesChoose the smallest option that is large enough, write band tables with upper limits, and look up values that change on given dates.
- Find the band a value falls into
- Connect lookups to tables on other sheets and in other files, respond to values that are not found in a way that keeps real errors visible, and troubleshoot or choose the right lookup for the job.
- Look up data on another sheet or in another fileRefer to tables on other sheets and in other workbooks, use names and tables so ranges stay correct as data grows, and know what breaks the links.
- Handle values that are not foundReplace #N/A with a clear result when a value is missing, choose between if_not_found, IFNA and IFERROR, and pick a replacement that does not distort later calculations.
- Troubleshoot lookups and choose the right functionTrace a failing lookup step by step, recognize wrong results that show no error, look up with two conditions, and choose the lookup function that fits the task and the software.
- Look up data on another sheet or in another file
Lookup Functions study guide
1Look up values with XLOOKUP
An order sheet needs current prices without repeated copying. Lookups connect each order to its source record, starting with a dependable key and an aligned return range. Learn how XLOOKUP finds a value, how to copy its formula safely, and how to choose the matching behavior you need. Then check the data issues that make two apparently identical keys fail to match, and the duplicate records that can return an unintended result.
1.1 Understand how a lookup works
A lookup brings a value from a source table into the place where you need it. An order can hold a product code while a formula fetches its price. The code identifies the record; the price is the result.
Follow the three parts
The lookup value is what you search for. The lookup range contains the keys to search. The return range contains the answers, in the same order as the keys. Finding the third key means returning the third answer. The answer need not be next to the key, but it must belong to the same record.
Use this product list in A1:D6:
| Code | Product | Category | Price |
|---|---|---|---|
| P-101 | Desk lamp | Lighting | 24.90 |
| P-102 | Office chair | Furniture | 149.00 |
| P-103 | Monitor stand | Accessories | 32.50 |
| P-104 | Whiteboard | Supplies | 58.00 |
| P-105 | Cable tray | Accessories | 18.75 |
If G2 holds "P-103", search A2:A6. It is the third key, so take the third price in D2:D6: 32.50. Row 1 holds headers and is left out of both ranges.
Keep a dependable source
A price list gives you one source of truth. Change a source price and the formulas show that new price after recalculation. A price copied by hand does not update. The formula also depends on its source: deleting a referenced source sheet breaks the reference and produces #REF!.
Choose unique keys, such as product codes or employee numbers. Two people can share a name, so a name alone may not identify the right person. If a key appears twice, an ordinary lookup returns one matching record, usually the first from the top. It does not add the records or warn that the key is repeated.
Build a table with one header row, one record per row, and one kind of information per column. Avoid merged cells and blank rows inside the list. Keep key types consistent: a numeric key and the same digits stored as text may look alike but fail to match.
Choose the kind of match
An exact match requires the key to equal the lookup value. Ordinary lookups ignore uppercase and lowercase. Exact matching suits IDs and codes because a nearby code belongs to another record.
An approximate match uses the exact key if present; otherwise it selects the next smaller or next larger key, according to the chosen mode. This suits bands, such as the shipping cost for a parcel whose weight falls between two limits. Approximate does not mean picking whichever number is closest.
Check the available functions
| Function | Useful job |
|---|---|
| XLOOKUP | Return values from a separate range in either direction |
| VLOOKUP / HLOOKUP | Read existing tables by a column or row number |
| INDEX with MATCH | Flexible lookups, including older Excel workbooks |
| MATCH / XMATCH | Return a position in a list |
XLOOKUP and XMATCH are available in Excel for Microsoft 365, Excel 2021 and 2024, Excel for the web, Google Sheets, and LibreOffice Calc 24.8 onward. Excel 2019 and earlier need VLOOKUP, HLOOKUP, or INDEX with MATCH. The formulas here use English function names and commas between arguments.
Key Takeaways
- A lookup searches a key range and returns the corresponding value from a return range.
- Use unique, consistently stored keys and one record per row.
- Exact matches suit identifiers; approximate matches suit bands.
- Choose functions supported by the software that will open the workbook.
1.2 Write an exact-match XLOOKUP
XLOOKUP lets you point directly at the keys and answers. You do not need to count how many columns separate them, and exact matching is the default.
Build the first formula
The full syntax is:
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
The first three arguments identify what to find, where to search, and where to take the answer. Square brackets in syntax help mark optional arguments; do not type those brackets into a working formula.
Using the product list in A1:D6, put "P-103" in G2 and build the result in another cell:
- Type
=XLOOKUP(and selectG2. - Add a comma and select
A2:A6, the product codes. - Add a comma and select
D2:D6, the prices. - Type
)and press Enter.
The completed formula is =XLOOKUP(G2, A2:A6, D2:D6). It finds "P-103" at position 3 and returns 32.50 from position 3 of the price range. With no optional arguments, it searches first to last and shows #N/A if no exact key exists.
You can also type the key directly: =XLOOKUP("P-103", A2:A6, D2:D6). Text constants need straight double quotes; a cell reference such as G2 does not. A numeric lookup value is entered without quotes.
Align the ranges
For a vertical lookup, select the same rows in both arrays. A2:A6 and D2:D6 both contain five cells. Selecting A1:A6 with D2:D6 includes an extra header on one side and produces #VALUE! in Excel. Equal length is necessary, and the first key must also correspond to the first answer.
The return column can be on either side. =XLOOKUP("Whiteboard", B2:B6, A2:A6) searches product names and returns "P-104" from the column on the left. The positions still line up because both ranges begin in row 2.
Copy without moving the table
Use =XLOOKUP(G2, $A$2:$A$6, $D$2:$D$6) when filling down an order list. The dollar signs lock the source ranges. One row down, the input becomes G3 while both source arrays stay fixed.
Without those locks, copying shifts the source to A3:A7 and D3:D7. The first product then falls out of the searched range. A formula can work in its first row and fail only after it is copied.
Return several fields or search a row
=XLOOKUP(G2, A2:A6, B2:D6) returns the matching product, category, and price. For "P-103", Excel fills three neighboring cells with "Monitor stand", "Accessories", and 32.50. This spill needs empty destination cells. Occupied cells block it and cause #SPILL!; keep the result outside an Excel table when it needs to spill.
Horizontal data works too. With "Jan", "Feb", and "Mar" in B1:D1 and sales 4200, 3850, and 4600 in B2:D2, =XLOOKUP("Feb", B1:D1, B2:D2) returns 3850. Here the arrays line up by column and must cover the same number of columns.
Key Takeaways
- The first three XLOOKUP arguments are the value, keys, and answers.
- XLOOKUP defaults to exact matching and first-to-last search.
- Keep arrays aligned and lock source ranges before copying.
- Separate arrays allow left lookups and horizontal lookups.
- A multi-column return spills into neighboring cells and needs room.
1.3 Control matching and fix data that will not match
A lookup can fail even when a key looks right, or return the wrong record without showing an error. Check what is stored in the cells, then choose matching and search settings that fit the question.
Check the characters and data type
Ordinary exact matches ignore case: "p-103" finds "P-103". When capitals distinguish codes, Excel can use =XLOOKUP(TRUE, EXACT(A2:A6, G2), D2:D6). EXACT compares each code with G2 and returns TRUE only for the same characters and capitals. XLOOKUP then finds that TRUE.
The number 1001 differs from the text "1001". Left alignment and Excel's green warning triangle can suggest text digits, but check the stored type before changing data. When the keys are numbers and G2 holds text digits, =XLOOKUP(VALUE(G2), A2:A50, D2:D50) converts the input to a number.
Identifiers such as "00123" must stay text when every character matters. Numeric conversion loses the leading zeros. Excel also keeps only 15 significant digits in numeric input, so long card or account identifiers need text storage before entry. G2&"" turns a number into text, but it cannot recover zeros or digits already lost. Make the stored keys and the lookup value agree.
A trailing space changes "P-103" into "P-103 ". =LEN(G2) then returns 6 instead of 5. =XLOOKUP(TRIM(G2), A2:A6, D2:D6) removes ordinary spaces around the input. If the unwanted spaces are in the source keys, clean those keys too. TRIM does not remove every kind of imported whitespace.
Choose the first or last record
XLOOKUP normally returns the first match. In a log containing "P-101" at 22.50, "P-102" at 145.00, and "P-101" at 24.90 in A2:B4, a default lookup of "P-101" returns 22.50.
=XLOOKUP("P-101", A2:A4, B2:B4, "Not found", 0, -1) returns 24.90. The fifth argument, 0, keeps exact matching. The sixth, -1, searches last to first. That last matching record is the latest only when the log is ordered from oldest to newest.
Find part of a text value
Set match_mode to 2 to enable wildcards:
| Pattern character | Meaning |
|---|---|
* | Any number of characters |
? | Exactly one character |
~* or ~? | A literal asterisk or question mark |
=XLOOKUP("*chair*", B2:B6, D2:D6, "None", 2) finds "Office chair" and returns 149.00. Default exact mode treats * and ? as ordinary characters. Wildcard mode returns one matching item, not a list of all matches. The broad pattern "P-10?" fits every code in the product list and therefore returns the first.
Keep search mode separate from match mode
Match mode controls what qualifies; search mode controls how the list is searched. Default search mode 1 scans first to last and works on unsorted data. Search modes 2 and -2 use binary search for large lists and require ascending and descending order respectively. An incorrect sort order can produce a wrong result without an error.
Key Takeaways
- Ordinary exact matches ignore case; EXACT can enforce case in Excel.
- Match the stored data types and preserve meaningful leading zeros.
- Check spaces with LEN and clean the side that contains them.
- Search mode -1 returns the last matching record.
- Wildcard match mode 2 enables
*,?, and~. - Binary search requires the stated sort order.
2Use VLOOKUP and HLOOKUP
Existing workbooks often use VLOOKUP and HLOOKUP to fetch values by a field number. Read those formulas from the edge of their selected table, with exact matching set deliberately. Work through vertical and horizontal layouts, then see how inserted columns or rows can leave a typed index pointing at the wrong field. Knowing these rules helps you maintain a working formula and decide when a direct-range lookup is easier to keep correct.
2.1 Look up values with VLOOKUP
VLOOKUP appears in many existing workbooks. It searches the leftmost column of a selected table and returns a field from the same row. Its two main traps are an omitted match setting and a column number counted from the wrong starting point.
Read the arguments
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
The table includes both the searched column and the answer column. Count the first column of that table as 1. In the product list A2:D6, Code is 1, Product 2, Category 3, and Price 4.
With "P-103" in G2, =VLOOKUP(G2, $A$2:$D$6, 4, FALSE) returns 32.50. VLOOKUP finds the code in column A, stays on that record's row, and takes the fourth field. Absolute references keep the table fixed when the formula is filled down.
If the table is B2:D6, its first field is Product. Price is now field 3, even though it is still worksheet column D. =VLOOKUP("Whiteboard", B2:D6, 3, FALSE) returns 58.00. The worksheet's column letters do not supply the index.
Enter the match type deliberately
| Fourth argument | Behavior |
|---|---|
| FALSE or 0 | Exact match |
| TRUE or 1 | Exact or next smaller match |
| Omitted | Same approximate behavior as TRUE |
For IDs and codes, enter FALSE. Omitting it does not ask for an exact match. With sorted keys "P-101" through "P-105", the mistyped code "P-1035" can return the price 32.50 for "P-103". The formula looks successful even though the requested code is absent. Approximate matching needs the key column sorted ascending; unsorted data can give an incorrect row without warning.
Exact text matching ignores case and accepts wildcards. For example, =VLOOKUP("*stand*", B2:D6, 3, FALSE) returns 32.50 for "Monitor stand". Repeated keys return the first match, and text-versus-number differences or extra spaces can still cause #N/A.
Understand the direction and the index
VLOOKUP returns its first column or a column to the right. It cannot search the names in column B and return the codes in column A with an ordinary table range. Use XLOOKUP or INDEX with MATCH for that left lookup.
A typed index can become stale after a structural change. Insert a new column before Category and the table expands, but 4 still means its fourth field. Price is now fifth, so the formula may return "Accessories" instead of 32.50. A direct return-column reference avoids this, or let MATCH find the header:
=VLOOKUP(G2, $A$1:$D$6, MATCH("Price", $A$1:$D$1, 0), FALSE)
MATCH returns the position of "Price" within the table's full header width. As references adjust to an inserted column, it finds the new position.
Use errors to locate the fault
#N/A means no exact match, or no suitable lower key for an approximate match. #REF! occurs if the column index exceeds the table width: index 5 cannot fit A2:D6. #VALUE! occurs when the column index is below 1. Check the table and index before treating an error as a missing product.
Key Takeaways
- VLOOKUP searches the first table column and returns the same row.
- Count columns from the table edge, starting at 1.
- Enter FALSE for codes: leaving it out selects approximate matching.
- A typed column index can return the wrong field after insertion.
- Use XLOOKUP or INDEX with MATCH when the answer is to the left.
2.2 Look up across rows with HLOOKUP
HLOOKUP searches across the top row of a table. It is useful when months, years, or other labels run from left to right, with a separate measure on each row below.
Read a horizontal table
=HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])
The first row of table_array holds the searched labels. Count that row as 1, including it in the return-row numbering. Consider a report in B1:D4, with measure names in column A:
| Measure | Jan | Feb | Mar |
|---|---|---|---|
| Sales | 4200 | 3850 | 4600 |
| Costs | 2900 | 3100 | 3050 |
| Visitors | 1250 | 1180 | 1320 |
The months are worksheet row 1; sales, costs, and visitors are rows 2, 3, and 4. =HLOOKUP("Feb", B1:D4, 3, FALSE) finds the February column and takes the third row of the selected table. The result is the February cost, 3100.
Count inside the selected range
The row index belongs to the table, not the worksheet. Move this entire table so the months begin in worksheet row 5. Months are still table row 1, sales row 2, and costs row 3. The table range becomes B5:D8, and =HLOOKUP("Feb", B5:D8, 3, FALSE) still returns 3100. Using worksheet row 7 as the index would exceed the four-row table and cause #REF!.
When copying a formula that searches the same report, lock its table, for example $B$1:$D$4. A changing input cell can remain relative.
Set matching and read errors
Use FALSE for an exact header such as "Feb". TRUE, or leaving the argument out, selects approximate matching and requires the top row to be sorted ascending. A normal calendar sequence of month names is not alphabetical order, so it is unsafe to rely on that default for this report.
HLOOKUP returns #N/A when an exact label is missing. An index larger than the table's height produces #REF!; an index below 1 produces #VALUE!. A typed index can also select a valid but unintended row, giving a wrong number without an error.
Point at the answer row with XLOOKUP
=XLOOKUP("Feb", B1:D1, B3:D3) searches the month labels and returns directly from the costs row. The arrays span the same columns. If a row is inserted above costs, the return reference adjusts to the costs cells. HLOOKUP's typed 3 still selects the third table row and may now select a different measure.
| Shape of source | Older function | Direct-range option |
|---|---|---|
| Keys run downward | VLOOKUP | XLOOKUP over columns |
| Keys run across the top | HLOOKUP | XLOOKUP over rows |
A horizontal report can be convenient for reading. For a new source list that will grow, one record per row usually works better with filters, spreadsheet tables, and PivotTables. Choose the lookup according to the source's layout.
Key Takeaways
- HLOOKUP searches the first table row.
- Count return rows from the top of the table, including its header row.
- Use FALSE for exact labels and lock the table when copying.
- A direct XLOOKUP return-row reference handles row insertion more reliably.
3Combine INDEX with MATCH and use XMATCH
A lookup can be built in two stages: locate the key, then retrieve the value at that position. MATCH and XMATCH perform the first stage; INDEX performs the second. Work from positions in a simple list to row and column positions in a grid. The same separation supports left lookups and workbooks shared with older Excel versions. Careful alignment matters because a valid position can still select the wrong cell in a different range.
3.1 Find positions with MATCH and XMATCH
MATCH and XMATCH answer a different question from XLOOKUP: where is the item in this range? They return a position. You can use that position to retrieve a value, choose a field, or check whether an item exists.
Count from the start of the range
=MATCH(lookup_value, lookup_array, [match_type])
With the product codes in A2:A6, =MATCH("P-103", A2:A6, 0) returns 3. The code is in worksheet cell A4, but it is the third item of the chosen range. If you include the header and search A1:A6, its position becomes 4. A position must always be interpreted relative to the range that produced it.
MATCH searches one row or one column. For an exact match, use 0 as the third argument. It returns the first match, ignores case, and accepts text wildcards. =MATCH("Mon*", B2:B6, 0) returns 3 for "Monitor stand".
Keep the MATCH modes straight
| match_type | Result | Required order |
|---|---|---|
| 0 | First exact match | Any order |
| 1, or omitted | Exact or largest value below the input | Ascending |
| -1 | Exact or smallest value above the input | Descending |
Leaving the third argument out selects 1. That is useful for lower-limit bands, but dangerous for IDs: a missing code can produce a position for a different code. Enter 0 for an identifier even when the current list happens to be sorted.
Use XMATCH for modern matching
=XMATCH(lookup_value, lookup_array, [match_mode], [search_mode])
XMATCH defaults to exact matching, so =XMATCH("P-103", A2:A6) returns 3. Its mode numbers follow XLOOKUP, not MATCH:
| match_mode | Meaning |
|---|---|
| 0, or omitted | Exact |
| -1 | Exact or next smaller |
| 1 | Exact or next larger |
| 2 | Wildcard |
With capacities 5, 10, 20, and 40 liters in K2:K5, =XMATCH(13, K2:K5, 1) returns 3. The 20-liter box is the smallest that can hold 13 liters. With ordinary search, XMATCH can find next-smaller or next-larger values in unsorted data too. MATCH needs a descending list and type -1 for this next-larger task; with capacities 40, 20, 10, 5, it returns position 2.
Change the search, not the numbering
XMATCH search mode -1 searches backward. For codes "P-101", "P-102", "P-101" in A2:A4, =XMATCH("P-101", A2:A4, 0, -1) returns 3. It finds the last occurrence but still counts from the start of the range.
Search modes 2 and -2 use binary search and require ascending and descending data respectively. They are separate from the match mode that chooses exact, smaller, larger, or wildcard matching.
Turn a position into an existence check
A missing exact key gives #N/A. =ISNUMBER(MATCH(G2, $A$2:$A$6, 0)) returns TRUE for a found code and FALSE for a missing one. ISNUMBER tests whether MATCH produced a numeric position; it does not test whether the code itself is numeric.
Key Takeaways
- MATCH returns a range-relative position, not a worksheet row or a price.
- MATCH needs 0 for an exact match; its default is approximate.
- XMATCH defaults to exact and uses XLOOKUP-style match modes.
- Reverse search still counts positions from the start.
- ISNUMBER around an exact MATCH tests whether a key is present.
3.2 Return values with INDEX and MATCH
INDEX retrieves a value from a known position. MATCH supplies that position by finding a key. Combining the two makes a lookup with separate key and answer ranges, including a return column to the left.
Read INDEX by itself
=INDEX(array, row_num, [column_num])
In the product list, =INDEX(D2:D6, 3) returns 32.50, the third price. The position is relative to D2:D6, so 3 selects worksheet cell D4.
A rectangular array needs both coordinates. =INDEX(A2:D6, 3, 2) returns "Monitor stand": row 3 and column 2 inside that selected block. INDEX takes the row first and the column second. A requested position beyond the array gives #REF!.
Build the combination from the inside out
For "P-103" in G2, use:
=INDEX(D2:D6, MATCH(G2, A2:A6, 0))
MATCH(G2, A2:A6, 0)searches the product codes exactly and returns 3.- INDEX receives that 3 as its row position.
INDEX(D2:D6, 3)returns 32.50.
The inner function produces a position, not a price. The outer function uses that position in the return range. This separation is why you can choose an answer column on either side of the keys.
For a left lookup, =INDEX(A2:A6, MATCH("Whiteboard", B2:B6, 0)) searches names in B and returns "P-104" from A. VLOOKUP cannot return that left-hand column using an ordinary table range.
Give both ranges the same starting point
Alignment is essential even when the formula produces no error. Compare these return ranges while keeping MATCH(G2, A2:A6, 0):
| Return range | What position 3 selects | Result |
|---|---|---|
D2:D6 | D4 | 32.50 |
D1:D6 | D3 | 149.00 |
The second formula returns the office chair's price. MATCH is correct, but the return range starts one row too early. Unlike an unequal-array XLOOKUP error, this mismatch can look like a valid answer. Use ranges covering the same source records, with the same height and starting row.
Keep it correct when copied or edited
Fill down with =INDEX($D$2:$D$6, MATCH(G2, $A$2:$A$6, 0)). The lookup cell changes on each row while both source ranges remain fixed. Keep MATCH's 0: leaving it out changes the lookup to approximate matching.
INDEX refers directly to the answer column, so inserting or deleting other columns lets its reference adjust. A VLOOKUP with a typed field number can select a different field after that same edit. Deleting the actual answer column still breaks the lookup.
Where XMATCH is available, =INDEX(D2:D6, XMATCH(G2, A2:A6)) gives the same result with exact matching by default. INDEX with MATCH works in every Excel version, Google Sheets, and LibreOffice Calc. It is a practical choice when a workbook must work in Excel 2019 or earlier; XLOOKUP is usually shorter in current Excel and provides its own missing-key argument.
Key Takeaways
- INDEX retrieves a value by position; MATCH finds that position from a key.
- Use 0 in MATCH for an exact lookup.
- Align lookup and return ranges before nesting the functions.
- Lock both source ranges when filling down.
- INDEX with MATCH supports left lookups and older Excel versions.
- Direct answer-column references adjust to changes in other columns.
3.3 Look up by row and column at once
A two-way lookup answers a question with two labels: which region, and which month? Find each label's position, then return the cell where those positions meet.
Set up a grid
Put regions in A2:A5, months in B1:D1, and sales in B2:D5:
| Region | Jan | Feb | Mar |
|---|---|---|---|
| North | 120 | 135 | 128 |
| South | 98 | 104 | 110 |
| East | 143 | 151 | 147 |
| West | 87 | 92 | 95 |
For East in February, follow East's row and February's column to 151.
Give INDEX two positions
=INDEX(B2:D5, MATCH("East", A2:A5, 0), MATCH("Feb", B1:D1, 0))
The first MATCH returns 3: East is third among the regions. The second returns 2: February is second among the months. INDEX therefore takes row 3, column 2 of the data block and returns 151.
The data block excludes the row labels and headers. Its four rows align with A2:A5; its three columns align with B1:D1. Positions must be measured from those same starting edges.
Swapping the MATCH functions does not always cause an error. Here it asks INDEX for row 2, column 3, which exists and contains South's March value, 110. Keep row first, column second even when both positions are small enough to fit either direction.
Use input cells
Put the selected region in H1 and month in H2:
=INDEX($B$2:$D$5, MATCH(H1, $A$2:$A$5, 0), MATCH(H2, $B$1:$D$1, 0))
Changing either input changes the result without editing the formula. Data-validation drop-down lists can offer the existing labels so entries match the source spellings.
Read two alternative formulas
A nested XLOOKUP can first return the region's row and then select the month:
=XLOOKUP("Feb", B1:D1, XLOOKUP("East", A2:A5, B2:D5))
The inner lookup produces East's row: 143, 151, 147. The outer one searches the three month labels and returns the second value, 151. Each array stage must have the same orientation and size as the labels it matches.
VLOOKUP can use MATCH for its field number:
=VLOOKUP("East", A1:D5, MATCH("Feb", A1:D1, 0), FALSE)
Here the table includes the region-label column. MATCH must therefore search the full width A1:D1, making February field 3. Searching only B1:D1 would return 2; VLOOKUP would then return East's January value, 143.
| Formula | Where February is counted from | Position |
|---|---|---|
INDEX over B2:D5 | B1:D1, the data columns | 2 |
VLOOKUP over A1:D5 | A1:D1, the whole table | 3 |
Key Takeaways
- Two-way lookups find one row position and one column position.
- INDEX takes the row position before the column position.
- Align label ranges with the data block they describe.
- A nested XLOOKUP can return a row and then select a field.
- VLOOKUP with MATCH must count headers across the full table width.
4Look up values in bands with approximate matches
A parcel weight or an order quantity rarely equals a listed band boundary. Approximate matching connects that input to the applicable rate, while a capacity lookup chooses an option large enough for a requirement. Read the table as a rule about intervals before selecting a mode. Work through lower limits, upper limits, and effective dates, paying attention to exact boundaries, missing end ranges, and each function’s sorting requirements.
4.1 Find the band a value falls into
A band table gives one result to every value in an interval. You can use it for shipping weights, quantity discounts, or other stepped rates. The lookup chooses a boundary; it does not round the input to a nearby number.
Store the start of each band
Use these lower limits and shipping costs in A2:B6:
| Lower limit (kg) | Cost |
|---|---|
| 0 | 4.50 |
| 2 | 7.00 |
| 5 | 11.00 |
| 10 | 18.00 |
| 20 | 30.00 |
Each lower limit belongs to the band it starts. The first row covers 0 kg up to, but not including, 2 kg. The next covers 2 kg up to 5 kg. A 7.3 kg parcel belongs to the band beginning at 5 kg because 5 is the largest limit at or below 7.3.
Keep limits as numbers in their own column. A label such as "2–5 kg" is text, so it cannot serve as a numeric limit. Put display labels in a separate column if you need them.
Find the exact or next smaller limit
=VLOOKUP(7.3, $A$2:$B$6, 2, TRUE) returns 11.00. The input is absent, so the function selects the row beginning at 5 and returns its cost. TRUE explicitly requests the approximate behavior needed here.
The same result comes from:
=XLOOKUP(7.3, A2:A6, B2:B6, "No band", -1)=INDEX(B2:B6, MATCH(7.3, A2:A6, 1))
MATCH returns position 3; INDEX returns the third cost. Notice the mode numbers: next smaller is -1 in XLOOKUP and XMATCH, but 1 in MATCH. VLOOKUP and HLOOKUP use TRUE for this behavior.
Test the edges
Exactly 5 kg costs 11.00 because a lower-limit band includes its starting value. A 4.99 kg parcel is still in the 2 kg band and costs 7.00. The last band starts at 20 kg and has no upper end, so 25 kg costs 30.00.
A value below the smallest lower limit has no qualifying row. If your table starts at 1 kg, a 0.4 kg parcel gives #N/A. Begin at the smallest relevant value, often 0, or give a clear missing-band message.
Apply the sorting rule
VLOOKUP with TRUE, HLOOKUP with TRUE, and MATCH with type 1 require ascending limits. Sort whole records so each cost stays with its limit. Unsorted limits can give a wrong answer without an error. XLOOKUP with match mode -1 and default search can find the correct lower limit in any order; binary search has its own sorting requirement.
Use a returned rate in a calculation
A quantity-discount table has limits 1, 10, 50, and 100 units with discounts 0%, 5%, 10%, and 15%. For 75 units, the qualifying lower limit is 50, so the discount is 10%. At 4.20 per unit, the net amount is:
An exact match would fail for 75 because that number is not a listed limit. Conversely, approximate matching on product codes can silently select a different product. Decide whether the input identifies a record or belongs in a band before choosing the mode.
Key Takeaways
- A lower-limit band uses the largest limit at or below the input.
- The boundary belongs to the band that starts there.
- Next smaller is TRUE in VLOOKUP, 1 in MATCH, and -1 in XLOOKUP/XMATCH.
- Older approximate lookups need ascending limits.
- Store numeric limits separately from display labels.
- Check the smallest input and the final band.
4.2 Use next-larger matches, upper limits and dates
Some lookups need a value large enough to meet a requirement. Others need the rule already in force on a date. Choose the boundary direction from the meaning of the table, then check exact endpoints.
Choose the smallest adequate option
Put box labels "S", "M", "L", and "XL" in A2:A5 and capacities 5, 10, 20, and 40 liters in B2:B5. A 13-liter load needs the smallest capacity at least as large as 13: the 20-liter box.
=XLOOKUP(13, B2:B5, A2:A5, "Too large", 1) returns "L". Match mode 1 means exact or next larger. Exactly 20 liters also returns "L". A 45-liter load returns "Too large" because no capacity can meet it.
XMATCH with mode 1 returns the selected position instead of the box label. VLOOKUP and HLOOKUP do not have a next-larger mode; their approximate setting chooses a key at or below the input.
Use MATCH with the right order
MATCH can find the next larger item with type -1, but its list must be descending. Sort the whole box table to XL 40, L 20, M 10, S 5. Then:
=INDEX(A2:A5, MATCH(13, B2:B5, -1))
MATCH returns 2, the position of 20 in this reordered list. INDEX returns "L". Using MATCH type -1 on the ascending list can give #N/A or an incorrect position. The negative mode means next larger in MATCH; it means next smaller in XLOOKUP and XMATCH.
Distinguish upper and lower limits
A shipping rule might say "up to and including 2 kg: 4.50; up to 5 kg: 7.00; up to 10 kg: 11.00; up to 20 kg: 18.00". These are upper limits. Select the smallest limit at or above the parcel's weight, using next larger.
| Table meaning | Exactly 2 kg | Direction |
|---|---|---|
| From 0 kg: 4.50; from 2 kg: 7.00 | 7.00 | Exact or next smaller |
| Up to 2 kg: 4.50; up to 5 kg: 7.00 | 4.50 | Exact or next larger |
Both tables are valid; they express different rules. With upper limits ending at 20 kg, 25 kg has no band. Show a clear message or extend the table to cover the intended inputs. A lower-limit table's last row, by contrast, continues upward.
Look up the price in force on a date
Dates are stored as numbers, so start dates work as lower limits. Suppose prices are effective from January 1, 2026 at 2.10; April 1, 2026 at 2.25; and September 1, 2026 at 2.40.
Use next smaller to select the latest start date at or before the requested date. June 15, 2026 selects April 1 and returns 2.25. September 1 itself selects the new price of 2.40. Store real spreadsheet dates so chronological comparisons work.
Choose a search method
XLOOKUP and XMATCH next-larger or next-smaller modes work on unsorted data with ordinary search. Binary search modes 2 and -2 require ascending and descending arrays respectively. Choosing a direction of approximation does not remove that separate binary-search requirement.
Key Takeaways
- Next larger selects the smallest value at or above the requirement.
- Use XLOOKUP/XMATCH mode 1, or MATCH type -1 on descending data.
- Upper-limit bands include their upper boundary.
- Effective-from dates use next smaller.
- Test out-of-range inputs and keep binary-search sorting separate.
5Look up across sheets and handle missing values
Useful lookups often reach beyond the current sheet, into a shared source list or another file. Connect those sources with readable references and ranges that include new records. Then handle missing keys without concealing broken formulas or treating an unknown price as zero. Finish with a practical troubleshooting routine and two-condition lookups, so you can diagnose both visible errors and plausible values taken from the wrong record.
5.1 Look up data on another sheet or in another file
A lookup can use a table on another sheet without copying it beside the formula. Keeping the source separate makes a workbook easier to maintain, but you need references that stay aligned as the source changes.
Add the sheet name
A cross-sheet reference puts the sheet name before an exclamation mark: Products!A2:A6. Use single quotes when the name contains spaces or special characters, as in 'Price List'!A2:A6. While building a formula, click the source sheet and select its cells to let the spreadsheet write the reference.
On an Orders sheet, let A2 hold "P-102" and B2 hold quantity 3. The product list is on Products:
=XLOOKUP(A2, Products!$A$2:$A$6, Products!$D$2:$D$6)
This returns the unit price, 149.00. To return the line total, multiply by the quantity:
=B2*XLOOKUP(A2, Products!$A$2:$A$6, Products!$D$2:$D$6)
The result is 447.00. Copying down changes the order inputs while the source ranges stay fixed. A sheet name identifies the location; dollar signs control copying.
Use names or a growing table
Define Codes as Products!$A$2:$A$6 and Prices as Products!$D$2:$D$6. Then =XLOOKUP(A2, Codes, Prices) is easier to read. A name created from a selected range is absolute by default; check the name's actual definition because names can also contain relative references.
A fixed range does not grow just because new records appear below it. A product added in row 7 is outside $A$2:$A$6. In Excel, format the source as a table named Products and use =XLOOKUP(A2, Products[Code], Products[Price]). These structured references include new table rows automatically.
Whole-column references such as Products!A:A and Products!D:D also include new rows. Use corresponding full columns on both sides so their positions remain aligned.
Connect another Excel workbook
An external reference includes the file name in square brackets:
=XLOOKUP(A2, [Prices.xlsx]Products!$A$2:$A$6, [Prices.xlsx]Products!$D$2:$D$6)
Selecting the source range with both files open helps build it correctly. When the source closes, Excel shows its folder path. A moved, renamed, or deleted file can break updating and require a repaired link. Linked dynamic-array results that spill between workbooks require both workbooks open when refreshed.
Bring data into Google Sheets
Google Sheets uses IMPORTRANGE for a different spreadsheet. It takes the source URL and range text, for example =IMPORTRANGE(H1, "Products!A2:D100"), where H1 holds the source spreadsheet URL. The first connection shows #REF! until you choose Allow access.
After access is allowed, =VLOOKUP(A2, IMPORTRANGE(H1, "Products!A2:D100"), 4, FALSE) searches the imported table and returns its fourth field. The quoted range is text, not a direct local-sheet reference.
Renaming a local sheet updates direct references automatically. Deleting that sheet produces #REF!. Check the source location when a previously working lookup loses access to its table.
Key Takeaways
- Use
Sheet!range, with single quotes around sheet names containing spaces. - Lock source ranges while order inputs move.
- Fixed ranges can miss added rows; Excel table columns grow with the table.
- Names are only as stable as their definitions.
- External workbooks depend on valid file links.
- IMPORTRANGE connects Google spreadsheets and needs initial access approval.
5.2 Handle values that are not found
A missing key needs a clear result, but a broken formula needs attention. Handle those cases separately so an unknown product does not look like a free product and a bad reference does not look like an unknown one.
Replace the no-match case
#N/A means the lookup found no suitable match. The key may be absent, or it may differ in spelling, stored type, or spaces. Investigate an unexpected failure before deciding it is a new record.
XLOOKUP has a fourth argument for the no-match case:
=XLOOKUP(G2, $A$2:$A$6, $D$2:$D$6, "Not found")
It returns 32.50 for "P-103" and "Not found" for "P-109". This argument handles failure to find a key; a separate error such as #VALUE! from unequal array sizes still shows.
For older lookup formulas, use IFNA:
=IFNA(VLOOKUP(G2, $A$2:$D$6, 4, FALSE), "Not found")
IFNA replaces #N/A only. It can also wrap HLOOKUP or INDEX with MATCH. A #N/A already stored in a matched return cell is still an error value and can be caught by an outer IFNA; a lookup's own no-match argument describes a different event.
Keep formula faults visible
IFERROR replaces every error, including errors caused by broken references or incorrect arguments. Consider =IFERROR(VLOOKUP(G2, $A$2:$D$6, 5, FALSE), "Not found"). Column 5 does not exist in a four-column table, so the underlying error is #REF!, even for a valid code. IFERROR hides it under the message "Not found".
| Handler | What it replaces |
|---|---|
| XLOOKUP if_not_found | No matching key |
| IFNA | #N/A from its expression |
| IFERROR | Any error from its expression |
Choose the narrow handler that fits the intended missing case.
Choose a useful replacement
A message is clear for someone reading a list. Zero is appropriate only when a missing result truly means zero. Returning 0 for an unknown price makes a total too low.
An empty string, "", looks blank but remains text. Multiplying a quantity by that text gives #VALUE!; SUM ignores cells containing text. Decide how later calculations should behave before replacing an error. A visually clean column can still hide missing amounts from a total.
Separate an empty field from a missing record
A found key with an empty category cell is not an unknown key. Excel normally returns 0 for a directly returned empty cell. This test can display a field-specific message:
=IF(XLOOKUP(G2, A2:A6, C2:C6)="", "No category", XLOOKUP(G2, A2:A6, C2:C6))
The IF checks the matched source value against empty text. It does not create a category or fill the source record.
Track unresolved entries
=IF(ISNA(MATCH(G2, $A$2:$A$6, 0)), "New code", XLOOKUP(G2, $A$2:$A$6, $D$2:$D$6)) checks for a missing code before retrieving its price. If results in H2:H50 use the message "Not found", =COUNTIF(H2:H50, "Not found") counts those unresolved lookups.
Band tables can also lack a result: below the first lower limit, or above the last upper limit. Extend the table where the rules support a band, or display "No band" so the input remains visible for review.
Key Takeaways
- Investigate unexpected
#N/Abefore calling the key missing. - Use XLOOKUP if_not_found for no key, or IFNA for
#N/A. - IFERROR can hide broken references and argument faults.
- A missing price is not automatically zero.
- A found empty field differs from a missing record.
- Count unresolved messages to keep missing data visible.
- Check the uncovered ends of band tables.
5.3 Troubleshoot lookups and choose the right function
Troubleshooting starts by checking the key and ranges, not by hiding the error. Also test a few results that show ordinary values: some of the most costly lookup faults produce no error at all.
Trace a failed lookup
- Check whether the intended value is in the searched key column.
=ISNUMBER(MATCH(G2, A2:A6, 0))tests for an exact match. - Compare stored types with
=ISNUMBER(G2)and=ISNUMBER(A4)for the source cell you expect to match. A FALSE existence test can reflect mismatched types, not an absent record. - Check spaces with
=LEN(G2)and the source key's LEN result. - Inspect endpoints and copied references. Include all source records and lock ranges that must stay fixed.
- Confirm the match mode. Identifiers need exact matching; bands need the appropriate smaller or larger boundary.
Read the error and check silent faults
| Error | Common lookup cause |
|---|---|
#N/A | No suitable key, mismatched text/number types, or extra spaces |
#REF! | Missing source or row/column index beyond the table |
#VALUE! | Unequal XLOOKUP arrays or a table index below 1 |
#NAME? | Misspelled or unavailable function |
#SPILL! | Blocked multi-cell output in Excel |
A wrong value without an error may come from approximate matching on codes, unsorted older approximate lookups, a broad wildcard, duplicate keys, misaligned INDEX/MATCH ranges, or reversed row and column positions. Compare a few results with the source by hand, including a boundary and a copied formula.
Match two conditions with one helper key
Suppose rows 2–6 contain Item in A, Size in B, and Price in C: "T-shirt" S 12.00; "T-shirt" M 12.00; "T-shirt" L 13.50; "Hoodie" M 29.00; "Hoodie" L 31.00. Looking up just "Hoodie" returns its first size, which may not be the requested size.
In D2, enter =A2&"|"&B2 and fill down. The helper key combines both fields, producing "Hoodie|L" for the last record. =XLOOKUP("Hoodie|L", D2:D6, C2:C6) returns 31.00.
Use a separator absent from the component values. Without one, "AB" joined to "C" and "A" joined to "BC" both become "ABC". A useful helper key must still identify one intended record.
Test both conditions directly in current Excel
=XLOOKUP(1, (A2:A6="Hoodie")*(B2:B6="L"), C2:C6)
Each comparison creates TRUE or FALSE for each row. Multiplying the comparisons produces 1 only where both are TRUE: here the array is 0, 0, 0, 0, 1. XLOOKUP finds 1 and returns the fifth price, 31.00. If several rows meet both conditions, this remains a single-result lookup and returns the first one by default.
Choose a function that fits
Use XLOOKUP for most new work in supported versions. Use INDEX with MATCH for older Excel compatibility or for a row-and-column lookup. Maintain VLOOKUP or HLOOKUP when an existing workbook relies on them, entering FALSE for IDs. Use MATCH or XMATCH when the needed result is a position or an existence test. Check the function against the software used by the people sharing the workbook.
Key Takeaways
- Check presence, stored type, spaces, range coverage, and match mode in order.
- A normal-looking value can still come from the wrong row or field.
- Combine two conditions with a separated helper key or a Boolean product in current Excel.
- A two-condition lookup still returns one record by default.
- Choose functions that fit both the task and the receiving software.
Lookup Functions examples
1Build a lookup you can trust
18 steps
- 1IntroductionBring a price into an order
An order needs a product’s current price. Keeping the price in one source list lets a lookup retrieve it whenever the workbook recalculates.
Start by identifying the key and its corresponding answer range. Then build an exact XLOOKUP and check what happens when you copy it, return several fields, or search data whose stored values differ from how they look.
- 2ExplanationIdentify the three parts
A lookup value is what you search for. The lookup range contains the keys; the return range contains the answers in matching order.
In the product list, codes occupy
A2:A6and prices occupyD2:D6. IfG2contains "P-103", search the codes for that value and return the price from the same position. Headers in row 1 are left out of both ranges. - 3Key InsightOne key should identify one record
A product code is useful because it can identify one record. A product name or category may repeat. A normal lookup returns one match, usually the first, so repeated keys can select the wrong record without an error.
Keep one record per row and the same stored type throughout the key column. A formula can keep prices current, but it depends on the source being organized and available.
- 4ChallengeChoose a dependable key
A staff list includes two employees named "Sam Lee" with employee numbers 317 and 842. An order needs one person’s department. Which field should identify the person?
---reveal---
Use the employee number. The name selects more than one record, and a normal lookup would return only one of them. The unique number lets the formula select the intended employee’s own department.
- 5ExampleWrite the three required arguments
Put "P-103" in
G2. In the result cell, enter:=XLOOKUP(G2, A2:A6, D2:D6)Read the arguments in order: search for the value in
G2, search among the product codes, and return from the prices. XLOOKUP defaults to exact matching and first-to-last search. A missing exact key returns#N/Aunless you supply a missing-key result. - 6ExampleFollow the matching position
The codes in
A2:A6are "P-101", "P-102", "P-103", "P-104", and "P-105". The prices inD2:D6are 24.90, 149.00, 32.50, 58.00, and 18.75."P-103" is third, so XLOOKUP takes the third price, 32.50. This is why the arrays must line up. Adding a header to only one array changes its size and gives
#VALUE!in Excel. - 7TipLock the source before copying
Use
=XLOOKUP(G2, $A$2:$A$6, $D$2:$D$6)before filling down. The dollar signs lock both source arrays.One row down,
G2becomesG3, while the product list stays fixed. Without the locks, the source shifts toA3:A7andD3:D7, dropping the first product. A formula that worked on its first row can then fail for a valid code. - 8ConnectionChoose a return range on either side
Separate arrays allow a left lookup:
=XLOOKUP("Whiteboard", B2:B6, A2:A6)It searches product names in B and returns "P-104" from A. For horizontal data, the same idea works across columns: with "Jan", "Feb", "Mar" in
B1:D1and sales 4200, 3850, 4600 inB2:D2,=XLOOKUP("Feb", B1:D1, B2:D2)returns 3850. - 9ExampleReturn several fields
Change the return array to
B2:D6:=XLOOKUP(G2, A2:A6, B2:D6)For "P-103", the result contains "Monitor stand", "Accessories", and 32.50. Excel spills these into neighboring cells. The result is several fields from one record, not all records with the same key. Leave room for the output; an occupied destination cell causes
#SPILL!. - 10ChallengePredict the copied formula
You fill
=XLOOKUP(G2, $A$2:$A$6, $D$2:$D$6)down one row. Which reference changes, and why?---reveal---
Only
G2changes, becomingG3. It is a relative reference and should read the next input. Both source arrays stay fixed because their row and column references are absolute. The copied formula searches the same complete product list for the new order’s code. - 11ExplanationMake stored types agree
The number 1001 and the text "1001" can look identical but fail an exact match. If the source keys are numbers,
VALUE(G2)converts text digits in the input to a number.Keep IDs such as "00123" as text because the zeros matter. Numeric conversion loses them. Excel numeric input also preserves only 15 significant digits, so long identifiers need text storage before entry.
- 12TipCheck spaces and capitals
=LEN(G2)returns 6 for "P-103 " but 5 for "P-103".TRIM(G2)can remove ordinary surrounding spaces from the input; spaces in source keys need cleaning there.Ordinary exact matches ignore case. When capitals distinguish Excel keys,
=XLOOKUP(TRUE, EXACT(A2:A6, G2), D2:D6)looks for the TRUE produced by a case-sensitive comparison. - 13ExampleEnable a partial text match
=XLOOKUP("*chair*", B2:B6, D2:D6, "None", 2)returns 149.00 for "Office chair". The fifth argument, 2, enables wildcards.*matches any number of characters;?matches one. Use~*or~?for a literal wildcard character. A broad pattern can fit several records: "P-10?" fits every product code here, so default search takes the first. - 14ExampleRetrieve the last matching record
A log in
A2:B4contains "P-101" at 22.50, "P-102" at 145.00, and "P-101" at 24.90. The default lookup for "P-101" returns 22.50.=XLOOKUP("P-101", A2:A4, B2:B4, "Not found", 0, -1)returns 24.90. The final -1 searches backward. It selects the latest entry only when the log is kept in oldest-to-newest order. - 15Key InsightSeparate matching from searching
Match mode controls which key qualifies; search mode controls how the list is searched. Their argument positions are different.
Default search mode 1 scans first to last without needing sorted data. Binary search modes 2 and -2 need ascending and descending keys respectively. An unsorted array can give a wrong result under binary search even when the match mode is correct.
- 16ChallengeFix an apparent missing code
G2holds "P-103 " and the source key is "P-103". Both are text. A default XLOOKUP gives#N/A. What should you fix first?---reveal---
Remove the input’s trailing space, for example with
TRIM(G2). Its extra character prevents an exact match. Changing to approximate matching would allow a different key to qualify and leave the real data mismatch unresolved. LEN can confirm that the two strings have different lengths. - 17ChallengeChoose the intended repeat
A rate log runs oldest to newest and stores the same code more than once. You need its newest exact rate and must copy the formula down an order list. What two formula choices matter?
---reveal---
Use search mode -1 to select the last match, and lock both source ranges while leaving each order’s input relative. Exact matching keeps other codes out. Reverse search is a date choice here because the stated order makes the last matching row the newest.
- 18RecapCheck the lookup before relying on it
Identify the input, the keys, and the answers. Align the arrays, use exact matching for IDs, and lock the source before copying.
If the result is unexpected, inspect types and characters before changing modes. For repeated keys, choose which record you mean; for partial text, make the pattern specific enough to identify the intended result.
2Read older lookup formulas correctly
11 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionFind the field a formula selects
- 2ExplanationCount from the table’s first column
- 3Key InsightSet FALSE for identifiers
- 4ExampleChange the table edge
- 5TipKeep an index tied to the right header
- 6ChallengeCount a field inside a shifted table
- 7ExampleRead a horizontal report
- 8Key InsightKeep table rows separate from sheet rows
- 9ConnectionPoint directly at the costs row
- 10ChallengeDiagnose a plausible wrong number
- 11RecapRead the selected table before the index
3Build a lookup from positions
14 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionFind a position, then retrieve a value
- 2ExampleRead a position within a range
- 3ExplanationCompare the modern default
- 4ChallengeCheck presence without retrieving a field
- 5ExampleUse INDEX on a known position
- 6ExampleLet MATCH supply the position
- 7Key InsightCheck which record position 3 means
- 8ChallengeRepair the shifted return range
- 9ExplanationAdd a column position
- 10ExampleRetrieve the grid intersection
- 11ConnectionSelect a row, then a month
- 12TipMatch the outer function’s counting edge
- 13ChallengeExplain the wrong month
- 14RecapKeep the position and range together
4Choose the right boundary for a band
12 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionRead what the limit means
- 2ExplanationRead a lower-limit shipping table
- 3ExampleRetrieve the qualifying cost
- 4Key InsightA starting boundary belongs to its new band
- 5TipKeep limits numeric and records together
- 6ChallengeTest both sides of a limit
- 7ExampleChoose a box large enough
- 8ConnectionUse MATCH’s different next-larger rule
- 9Key InsightRead “up to” as an upper limit
- 10ExampleFind the price already in force
- 11ChallengeMatch the rule to its direction
- 12RecapCheck meaning, mode, and endpoints
5Connect sources and diagnose lookup problems
16 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionKeep the source connected and errors useful
- 2ExampleReference another sheet
- 3ExampleUse the returned price in an order
- 4TipInclude records added later
- 5ConnectionKnow which kind of source link you use
- 6ChallengeExplain a newly missing product
- 7ExplanationLabel the no-match event
- 8ExampleExpose an error hidden by IFERROR
- 9Key InsightChoose what later calculations should see
- 10ChallengeKeep a formula fault visible
- 11ExplanationTrace an unexpected missing match
- 12TipInspect ordinary-looking results too
- 13ExampleMake both fields part of the key
- 14ExampleFind the row where both tests pass
- 15ChallengeRepair the lookup and its hidden error
- 16RecapCheck the record, source, and missing case
Lookup Functions practice questions
Set 1: Choose modes and connect source tables10 Practice Questions
Question 1 of 10
Show answerHide answer
Question 2 of 10
Show answerHide answer
Question 3 of 10
=VLOOKUP(H2, A2:C4, 3). How should it be changed to reject an unknown code between existing codes?Show answerHide answer
Question 4 of 10
J4:J7. What does =XMATCH(25, J4:J7, 1) return?Show answerHide answer
Question 5 of 10
A3:A5 are "Red", "Blue", "Green"; headers B2:D2 are "Apr", "May", "Jun". The data rows are Red 20, 25, 28; Blue 31, 35, 39; Green 42, 46, 49. =VLOOKUP("Green", A2:D5, MATCH("May", B2:D2, 0), FALSE) returns 42. What single range change makes the intended lookup correct?Show answerHide answer
Question 6 of 10
Show answerHide answer
Question 7 of 10
Show answerHide answer
Question 8 of 10
Show answerHide answer
Question 9 of 10
A2. What formula keeps including records appended to that table?Show answerHide answer
Question 10 of 10
=XLOOKUP(1, (A2:A5="Mug")*(B2:B5="Red"), C2:C5) is used in current Excel. What result does it return, and why?Show answerHide answer
Set 2: Build and read everyday lookups10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
H4. The source codes occupy B3:B12, and their unit prices occupy E3:E12. What formula can be filled down while keeping the entire source fixed?Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
D6:G14: Code, Description, Unit, and Rate, in that order. With a code in J6, what formula returns its exact rate?Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
C5:E8, the top row is "Apr", "May", "Jun". The next rows hold output, defects, and hours. Defects are 8, 6, and 9. What does =HLOOKUP("May", C5:E8, 3, FALSE) return?Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
F8:F11 contain "K-8", "K-2", "K-6", and "K-9". What does =MATCH("K-6", F8:F11, 0) return?Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
B5:B7 hold "R-4", "R-9", "R-2"; F5:F7 hold 26, 41, 18. What does =INDEX(F5:F7, MATCH("R-9", B5:B7, 0)) return?Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
=IFERROR(VLOOKUP(H2, $A$2:$D$20, 5, FALSE), 0) and shows a total of 0 for that code. What repair both retrieves valid prices and labels missing codes without hiding the index fault?Show answerHide answer
Save this lesson to see this answer.
Set 3: Find faults that ordinary results can hide10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
E9:H12. Its first row contains years, followed by Orders, Returns, and Hours. Which row index retrieves Returns?Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
C4:C6 are "N-1", "N-2", "N-3". Amounts in F4:F6 are 15, 28, 33; F3 contains "Amount". For "N-2", =INDEX(F3:F6, MATCH(H2, C4:C6, 0)) shows 15. What repair addresses the cause?Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
J2:K5 holds limits 1, 25, 70, 140 and discounts 0%, 6%, 11%, 16%. The copied formula for 90 units uses =VLOOKUP(H9, J3:K6, 2, FALSE) and gives #N/A. What formula change both fits the discount rule and preserves the complete source when filled down?Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
#REF! and a request to connect the sheets. What action completes that initial connection?Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
"" in J2. What happens to =4*J2 and to a SUM over cells including J2?Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
=A2&B2 makes a lookup for zone "A", tier "BC" return 5.00. What repair keeps every listed zone/tier combination distinct without moving the records?Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 4: Apply lookup rules to changing workbooks10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
=XMATCH("Closed", F2:F15) return when it finds that text?Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
B4:B8 and prices in E4:E8. Row 10 uses =XLOOKUP(H10, B4:B8, E4:E8). After filling to row 12, the code stored in B4 gives #N/A. What should be entered in the original formula before filling again?Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
A1:D9, headed Code, Item, Unit, Rate. A new field is inserted before Rate. Which design continues finding Rate by its header as references expand?Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
=INDEX(F4:F18, MATCH(J4, B4:B18, 0)). A column is inserted before column D. The key and return cells are retained. What behavior should you expect?Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
A2:A4 are "Alpha", "Beta", "Gamma". Months in B1:D1 are "Jul", "Aug", "Sep". The data rows are 16, 19, 23; 27, 31, 34; 38, 42, 47. You need Gamma in August. A formula uses INDEX on B2:D4, then MATCH("Aug", B1:D1, 0), then MATCH("Gamma", A2:A4, 0). What does it return, and what change retrieves the requested intersection?Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
=IFERROR(XLOOKUP(H2, B2:B12, E3:E12), "Unknown"). H2 and its matching source key are text with no extra spaces. What repair fixes the source problem while keeping later formula faults visible?Show answerHide answer
Save this lesson to see this answer.
Stuck on your own question? Homework Help
Key Terms
A
Absolute reference
$A$2:$A$6 stays fixed while the order’s relative input moves down.Aligned arrays
A2:A6 and D2:D6 pair each product code with its price on the same source row.Approximate match
Ascending order
B
Band table
Binary search
Boolean product
C
Case-sensitive comparison
Column index
A2:D6, but index 3 when the selected table begins in column B.Compatibility
Cross-sheet reference
Products!D2:D6 supplies prices while the order formula stays on Orders.D
Data block
B2:D5, that range is the data block.Data-validation list
H2 can offer the same "Jan", "Feb", and "Mar" labels that a lookup grid uses.Descending order
E
Effective date
Empty string
"" lets SUM skip it but makes multiplication fail.Exact match
Existence check
External workbook link
[Prices.xlsx]Products!A2:A6 may need repair after the source file moves.F
Fixed range
$A$2:$A$6, so the lookup cannot find its code.H
Header row
Helper key
HLOOKUP
=HLOOKUP("Feb", B1:D4, 3, FALSE) uses HLOOKUP to retrieve February’s costs from the third table row.Horizontal lookup
B1:D1 to select the corresponding value in the costs row.I
if_not_found argument
IFERROR
IFNA
IMPORTRANGE
INDEX
=INDEX(A2:D6, 3, 2) uses INDEX to return the product name in the third record’s second field.INDEX with MATCH
Intersection
L
Left lookup
Lookup
Lookup range
A2:A6 form the lookup range and "P-103" is listed third, "P-103" has position 3 within it.Lookup value
G2, the lookup value is the product code held in that input cell.Lower limit
M
MATCH
=MATCH("P-103", A2:A6, 0) uses MATCH to return 3 although the matching code is in worksheet row 4.Match mode
Match type
Missing-key result
N
Named range
Products!$D$2:$D$6 to make an order’s lookup easier to read.Nested function
Next larger
Next smaller
Number stored as text
R
Range lookup argument
Record
Relative position
A4 has relative position 3 in A2:A6, but 4 when the searched range includes the header in A1.Return range
A2:A6 selects the third price from the aligned return range D2:D6.Row index
S
Search mode
Separator
Silent lookup error
Source of truth
Spill
Structured reference
Products[Price] includes prices for records appended to the Excel table.T
Table array
B2:D6, Product is field 1 and Price is field 3, regardless of worksheet letters.Trailing space
Two-way lookup
U
Unique key
Upper limit
V
VLOOKUP
=VLOOKUP(G2, A2:D6, 4, FALSE) uses VLOOKUP to return the exact code’s fourth table field.W
Wildcard
X
XLOOKUP
=XLOOKUP(G2, A2:A6, D2:D6) uses XLOOKUP to retrieve the price for the product code in G2.XMATCH
About this lesson
Make your own Study Materials
Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.