Ravindra BagaleCourses & study guides मराठी Track your progress

4. Lookup Functions

Excel

4.7 XLOOKUP Match Modes, Search Modes and Multiple Returns

A lookup needs two decisions: which values qualify as a match, and how Excel should search for them. These decisions live in different XLOOKUP arguments. Once you separate them, you can retrieve a last recorded order, apply a threshold, search a text pattern or return several fields without confusing one task with another.

We use fictional customer orders, parcel scans, products and delivery-price examples. The familiar shopping and courier contexts explain the business questions; they are not records or policies from an actual company. Every formula below has a stated source and an expected result you can check independently.

Last is a position; latest is a time: reverse search starts at the end of the supplied list. It does not inspect dates to decide which event happened most recently. A chronological result needs a suitable sort order and a clear rule for tied timestamps.

1. Separate matching rules from search rules

Read the full argument order

=XLOOKUP(lookup_value,lookup_array,return_array,[if_not_found],[match_mode],[search_mode])

The first three arguments identify the requested value, the source list to search and the aligned results to return. The fourth supplies an optional missing-result value. The fifth changes the matching rule. The sixth changes the search method or direction. Optional arguments still occupy positions even when you leave one blank.

For a basic exact lookup, you can stop after the first three arguments. For a reverse exact lookup with a visible fallback, supply all six. Reading the complete expression aloud helps: search for this customer, search this customer list, return this amount list, show this message when absent, require an exact match, and start from the end.

The two option groups have different meanings
ArgumentValuePurpose
match_mode0Exact match; the default
match_mode-1Exact match, otherwise next smaller lookup value
match_mode1Exact match, otherwise next larger lookup value
match_mode2Match a wildcard text pattern
search_mode1Search first to last; the default
search_mode-1Search last to first
search_mode2Binary search on ascending sorted lookup values
search_mode-2Binary search on descending sorted lookup values

The same number can mean different things in different positions. A minus one in the fifth argument selects the next-smaller matching rule; a minus one in the sixth starts at the end. A two in the fifth means wildcard matching; a two in the sixth means ascending binary search. Always connect an option with its argument name.

  • Choose the matching rule from the question you are answering.
  • Choose the search rule from the source structure and ordering.
  • Keep lookup and return records aligned.
  • Define missing-result behaviour separately.
  • Test cases that distinguish the chosen rule from other plausible rules.
  • Avoid changing options merely to make an unwanted error disappear.

2. Prepare the four-order example

Keep the original practice data consistent

Create a worksheet named Data and enter the following table in A1:C5. Each data row represents one fictional order. These are the dates used by the original Task Hub exercise; the earlier article used slightly different display dates. This version uses the Task Hub dates consistently so both the amount and date answers agree.

Data!A1:C5 — fictional customer orders, oldest first
DateCustomerAmount
2 November 2026Zoya120
3 November 2026Amir300
5 November 2026Zoya450
7 November 2026Ravina180

To create genuine dates regardless of whether your local date-entry convention is day-first or month-first, use =DATE(2026,11,2) in A2, then corresponding DATE formulas with days 3, 5 and 7 in A3:A5. Apply a readable date format afterward. Enter the Amount values as numbers. The displayed dates are not simply text labels that happen to look chronological.

Put Customer to find in E1 and Zoya in F1. Put First amount in E2, Last amount in E3 and Last date in E4. Reserve F2:F4 for formulas. The source has two Zoya rows because one customer can place several orders. That repetition is valid for this event list; it would have a different meaning in a directory intended to contain one row per customer.

Check the source before searching it

  • There are four orders and three displayed customer names.
  • Zoya appears in two orders, with amounts 120 and 450.
  • Amir appears once, with amount 300.
  • Ravina appears once, with amount 180.
  • The four amounts total 1050.
  • Zoya's two amounts total 570, which is different from either individual order amount.

Names are convenient for this tiny demonstration. A real order system should usually connect records through a stable customer identifier because different people can share a name. Reverse search on a common name could otherwise retrieve someone else's order while appearing technically successful.

3. Compare first and last physical matches

Retrieve the first amount

Enter the first formula in F2. With default exact matching and default first-to-last search, XLOOKUP finds Zoya at the first source occurrence and returns 120. It does not add the two Zoya orders or compare their dates.

=XLOOKUP(F1,$B$2:$B$5,$C$2:$C$5,"No order")

Retrieve the last amount

Enter the second formula in F3. The fifth argument zero keeps exact matching. The sixth argument minus one begins the search at the end of the supplied list. The final Zoya occurrence is the 5 November row, so the result is 450.

=XLOOKUP(F1,$B$2:$B$5,$C$2:$C$5,"No order",0,-1)

The formula works upward through the list until it finds a matching customer. In this source, the last physical Zoya row also happens to be the latest Zoya order because the complete records are arranged oldest first. That chronological interpretation belongs to the source order, not to a built-in date rule in XLOOKUP.

You may see formulas with two adjacent commas before the matching option. They leave the optional missing-result argument omitted while preserving the positions of later arguments. For a beginner report, the explicit No order message makes the behaviour easier to understand. Do not remove a comma and accidentally move the search option into the matching position.

Return the date of the same occurrence

In F4, change only the return range to the date field. Keep the same customer input, exact rule and reverse search. The result is 5 November 2026. If you see 46331 in a workbook using the standard 1900 date system, apply a date format; the underlying serial number represents the returned date.

=XLOOKUP(F1,$B$2:$B$5,$A$2:$A$5,"No order",0,-1)

Changing a number format does not repair a text date or choose a newer record. The first check is whether the source contains genuine dates and whether the selected record is the intended one. Format the result only after its meaning is correct.

4. Lab 1 — expose the difference between last and latest

Verify the original answers

Known results from the original four orders
RequestFirst amountLast amountLast date
Zoya1204505 November 2026
Amir3003003 November 2026
Ravina1801807 November 2026
RajaNo orderNo orderNo order
  1. Build the three report formulas and verify Zoya's original results.
  2. Change F1 to Amir and compare the first and last amounts.
  3. Change F1 to Raja and confirm that the unresolved request remains visible.
  4. Restore Zoya and record the original amount and date outputs.
  5. Save an experiment copy before adding the late-arriving historical row below.
  6. Keep the original source available so you can return to the Task Hub fixture afterward.

Append an older event at the bottom

In the experiment copy, enter a fifth order in A6:C6: 1 November 2026, Zoya, 90. Use DATE to create its actual date value. This row represents an older order that arrived in the export late. Extend the formulas' lookup and return ranges through row 6.

The reverse lookup now returns 90 and 1 November 2026. Those are the last physical matching row's values. They are not Zoya's latest order in time; the 5 November order for 450 is still later. The five-row source total is 1140 and Zoya's three-order total is 660.

An older Zoya order for 90 rupees dated1 November is appended below the5 November order for450. Reverse search returns 90 although450 is the latest by date.
Search direction uses the supplied row order. A later import position does not prove a later event time.

Restore a meaningful chronological order

Sort the entire A1:C6 record block by Date ascending, including the correct header treatment. Do not sort the Date column by itself. After the full records are ordered, the first Zoya amount becomes 90 and the last becomes 450. The source totals remain 1140 overall and 660 for Zoya because sorting changes order, not membership or amounts.

This is a useful independent test: a chronological sort should alter which matching record is encountered first or last, while preserving each date-customer-amount relationship and the totals. If only one column is sorted, the totals may still look correct even though the records have been corrupted.

If two orders have the same displayed date, a date-only sort may not define which one happened later. Use a genuine timestamp and, when necessary, a stable event sequence or order identifier with a documented tie rule. A row's position should reflect an intentional business ordering rather than whichever file happened to be pasted last.

5. Lab 2 — retrieve a parcel's recorded status

Prepare a complete scan history

Create a worksheet named Tracking and enter this table in A1:C6. Each row is one invented parcel scan, not one parcel. Repeated tracking numbers are expected because the same parcel is scanned at several stages. The AWB label is a familiar logistics term for the shipment identifier in this example.

Tracking!A1:C6 — fictional scan events in chronological order
DateAWB NoStatus
10 November 2026AWB-7001Picked up
10 November 2026AWB-7002Picked up
11 November 2026AWB-7001In transit
12 November 2026AWB-7001Delivered
12 November 2026AWB-7002In transit

Create the dates using DATE with the stated year, month and days. Put AWB to find in E1 and AWB-7001 in F1. Put First status, Last status and Last scan date in E2:E4. Enter the following formulas in F2:F4 respectively.

=XLOOKUP(F1,$B$2:$B$6,$C$2:$C$6,"No scan yet")
=XLOOKUP(F1,$B$2:$B$6,$C$2:$C$6,"No scan yet",0,-1)
=XLOOKUP(F1,$B$2:$B$6,$A$2:$A$6,"No scan yet",0,-1)

For AWB-7001, expect Picked up, Delivered and 12 November 2026. The date serial is 46338 in the standard 1900 date system. For AWB-7002, expect Picked up, In transit and 12 November 2026. For AWB-7009, all three formulas show No scan yet in this dataset.

  1. Confirm five event rows and two distinct parcel IDs in the source.
  2. Check that AWB-7001 has three recorded scans and AWB-7002 has two.
  3. Run the report for both known parcels and the unknown parcel.
  4. Verify each returned status and date against the same complete source record.
  5. In an experiment copy, append an older scan for AWB-7001 dated 9 November 2026 with status Label created.
  6. Extend both formula ranges and observe that reverse search now returns Label created.
  7. Explain why that result is the last row but not the latest scan by date.
  8. Sort complete records chronologically and confirm the last AWB-7001 status returns to Delivered.

Keep the wording faithful to the source

The phrase last recorded status is more precise than a guaranteed live parcel status. The workbook can only report events present in its source extract. A delayed feed, an incomplete export or a later event not yet imported can make the workbook older than the courier system. State the extract time when such freshness matters.

No scan yet is a friendly exercise message, but technically it means no matching scan exists in the included source. It does not prove the parcel never existed or was never scanned elsewhere. If the business needs a stronger claim, the source and validation process must support that claim.

6. Search a text pattern deliberately

Distinguish literal text from a pattern

A product search may ask for the first product whose description contains Grapes. That is different from asking for a product whose entire description equals Grapes. Wildcards let a search expression describe a family of strings. In XLOOKUP, choose match mode two when that pattern behaviour is intended.

Create a worksheet named Products with Product ID and Description in A1:B1. Enter the following four records in rows two through five. Keep their order as shown for the first exercise, because first and last pattern matches depend on this order.

Products!A1:B5 — invented catalogue descriptions
Product IDDescription
P-101Green Grapes 500g
P-102Apples 1kg
P-103Black Grapes 500g
P-104Grape Juice 1L
=XLOOKUP("*Grapes*",$B$2:$B$5,$A$2:$A$5,"No product",2)

The asterisks permit any sequence of characters before and after Grapes. The first qualifying description is Green Grapes 500g, so the formula returns P-101. Grape Juice does not contain the complete word fragment Grapes and therefore does not qualify for this particular pattern.

Without match mode two, the asterisks are part of the literal search text. The exact-mode formula would look for a description literally equal to *Grapes*, including those characters, and return No product in this sample. It does not automatically turn the expression into a contains search.

Use wildcard symbols with a clear purpose

  • An asterisk represents a sequence of zero or more characters.
  • A question mark represents one character.
  • A tilde escapes a wildcard character when the literal symbol is needed.
  • A pattern can match more than one source record.
  • A single XLOOKUP still returns one selected match.
  • Review the actual matching descriptions before relying on a broad pattern.

Add search mode minus one to the product formula and the answer becomes P-103, the last description containing Grapes. Both Green Grapes and Black Grapes qualify; the search direction decides which qualifying record is returned. Neither result is a list of all grape products.

=XLOOKUP("*Grapes*",$B$2:$B$5,$A$2:$A$5,"No product",2,-1)

To retrieve every matching product, use a filtering approach with an appropriate text condition rather than repeatedly assuming one lookup represents the entire catalogue. Be precise about singular and plural words, spelling variations and meaningful product attributes. A pattern match is a text rule, not a semantic understanding of product categories.

Practise a literal asterisk safely

In a separate scratch list, enter BOX-A1 in D2 and BOX-*1 in D3, with labels Standard pouch and Pattern pouch in E2:E3. An exact-mode search for the text BOX-*1 returns Pattern pouch because the asterisk is literal by default. A wildcard-mode search for the same expression can match BOX-A1 first and return Standard pouch.

In wildcard mode, search for BOX-~*1 to require the actual asterisk character. That escaped pattern returns Pattern pouch. This small contrast is worth practising because familiar VLOOKUP or MATCH wildcard behaviour can lead students to assume all lookup functions interpret the same text in the same way.

7. Choose a lower-bound or upper-bound rule

Start with the policy the values represent

Approximate matching should answer a defined band or capacity question. It should not be used to guess a nearby customer or parcel identifier. A next-smaller key can be meaningful when each key starts a price band; a next-larger key can be meaningful when each key is an upper capacity limit.

Create a worksheet named Fees. In A1:B4, enter the following fictional delivery rule. Each minimum begins a band and the stated fee applies to the whole order within that band. These numbers are invented teaching policy, not the pricing of a shopping app.

Fees!A1:B4 — lower-bound delivery fee example
Minimum orderFee
049
50029
10000

Put Order value in D1 and 750 in E1. For a valid non-negative numeric order value, the next formula chooses an exact minimum if available; otherwise it chooses the next smaller minimum. The key selected for 750 is 500, so the returned fee is 29.

=XLOOKUP(E1,$A$2:$A$4,$B$2:$B$4,"Outside fee policy",-1)

Next smaller refers to the lookup value, not the return value. The returned fees happen to decrease as order values increase. You are not asking Excel for the smallest fee or the fee numerically closest to the order amount. You are asking which lower boundary contains that valid order value.

  • An order value of zero uses the minimum-zero band and returns 49.
  • A value of 499.99 remains below 500 and returns 49.
  • A value of 500 matches the boundary and returns 29.
  • A value of 999.99 remains below 1000 and returns 29.
  • A value of 1000 matches the last boundary and returns 0.
  • A value above 1000 uses the last band's fee 0 under this stated policy.

A negative order value is invalid for this particular model and needs a validation or review condition. Do not let a fallback message replace the underlying business input rules. Likewise, decide how returns, credits or cancelled orders should be handled before applying a delivery fee to a real export.

Use upper boundaries for a different question

In a separate block on Fees, put Maximum kg and Charge in G1:H1. Enter limits 1, 3, 5 in G2:G4 and corresponding charges 50, 90, 130 in H2:H4. This second teaching rule charges by the smallest listed capacity that can contain a positive package weight. Put Package kg in J1 and 2 in K1.

=XLOOKUP(K1,$G$2:$G$4,$H$2:$H$4,"No listed capacity",1)

A two-kilogram package needs the next larger listed limit, three kilograms, so the charge is 90. Exactly three kilograms also returns 90. A weight of 3.01 needs the five-kilogram band and returns 130. A weight above five has no suitable listed capacity and should remain unresolved rather than being charged at the largest available band by assumption.

The opposite approximate rule would answer a different question. Next-smaller matching for a two-kilogram package would choose the one-kilogram limit, which cannot contain the package under this policy. Before memorising minus one or plus one, explain whether the keys are lower starting points or upper allowed limits.

Test the boundary, not just a comfortable middle value

For both policies, check a value just below each boundary, exactly at it and just above it. Also check the lowest valid input and an out-of-domain input. A formula that succeeds for 750 does not prove it treats 500 and 1000 correctly. Boundary checks connect the Excel option with the intended business rule.

Keep these policy tables sorted and documented so a person can inspect the bands easily. Ordinary first-to-last approximate XLOOKUP does not have the same binary-sort requirement as the binary modes below, but an orderly, unique threshold list is still easier to review. Duplicate thresholds with conflicting fees are a policy defect that a search direction should not silently resolve.

8. Understand binary search before selecting it

Binary search depends on an ordered lookup field

A linear search works through the supplied list from one end. A binary search uses the ordering of values to narrow the search region repeatedly. That can reduce the search work for a large ordered list, but it depends on the exact lookup field being sorted as required. A list sorted by another column does not satisfy that condition.

Search mode two requires ascending lookup values. Search mode minus two requires descending lookup values. The return values must stay attached to their corresponding lookup records during the sort. Sorting only the keys can produce a correctly found key paired with the wrong result.

=XLOOKUP(E1,$A$2:$A$4,$B$2:$B$4,"Outside fee policy",-1,2)

This formula uses the ascending Fees lower-bound list. It combines next-smaller matching with ascending binary search. For 750 it should still return 29. The matching rule and search method remain separate choices even though both affect the formula's behaviour.

Do not use binary mode on unsorted input and expect a helpful warning. Microsoft documents that unsorted lookup values can produce invalid results. The exact wrong answer is not a reliable teaching contract, so do not build a lesson around one accidental result from a particular unsorted arrangement.

Choose maintainability as well as speed

  • Use binary search only when the lookup-field ordering is guaranteed and maintained.
  • Verify both the beginning and end of the sorted source.
  • Keep lookup and return fields together during sorting.
  • Use clear duplicate-key rules rather than relying on an unspecified first or last duplicate outcome.
  • Retest after imports, appends and source changes.
  • Measure a real large-workbook problem before promising a universal performance improvement.

For a three-row teaching fee table, binary search offers no practical benefit worth complicating the beginner report. It is included here so you recognise the option and its prerequisite when you encounter it. The default linear search is often the clearer starting point for ordinary small lists.

9. Return several fields from one matched record

Give the return array more than one column

A store report often needs city, area and manager together. XLOOKUP can retrieve all three from the same matched record when its return array includes those aligned columns. This is multiple fields from one selected record, which is different from returning every record whose key matches.

Create a separate worksheet named StoreView and enter this complete compact directory in A1:D4. It is a smaller teaching copy of familiar course records, not the full seven-store source from the previous lesson. The headers and formula ranges below belong to this specific layout.

StoreView!A1:D4 — three fictional store records
Store IDCityAreaManager
BLK-NSK-01NashikCollege RoadZoya
AMN-NGP-01NagpurDharampethAmir
BLK-KOP-01KolhapurRajarampuriRani

Put Requested store in F1 and BLK-NSK-01 in G1. Put City, Area and Manager in G3:I3. Leave G4:I4 clear, then enter the following formula only in G4. It returns the three values Nashik, College Road and Zoya across G4:I4.

=XLOOKUP(G1,$A$2:$A$4,$B$2:$D$4,"Store not found")

G4 is the formula's anchor. The adjacent cells display the other returned fields as a spill. Do not copy the formula across all three cells; that would create overlapping output requests. To edit the expression, return to its anchor rather than attempting to edit an individual spilled value.

Check shape and available output space

The lookup field has three rows and the return array has the same three record rows, plus three output columns. That is a compatible shape for returning one matched row. The return array does not need to have only one column, but its record dimension must correspond to the lookup list.

Change G1 to AMN-NGP-01 and expect Nagpur, Dharampeth and Amir. Then try an absent store code. The supplied fallback is one text value, so do not assume every missing request will produce three labelled fallback fields. Design the report's empty-result presentation deliberately if a fixed output shape is required.

In an experiment copy, place a note in H4 before entering the lookup in G4. The occupied cell blocks the intended spill and can produce #SPILL!. Preserve the note by moving it to an appropriate place, then clear the actual obstruction and check again. Do not delete surrounding data blindly just to remove the error.

  • Keep the spill output outside an Excel Table.
  • An Excel Table may still provide the source records through structured references.
  • Leave the complete intended output rectangle clear.
  • Avoid merged cells across the spill area.
  • Keep headings separate from the dynamic output values.
  • Check the source and destination after adding more return fields.

Connect the pattern search with the store fields

On StoreView, try =XLOOKUP("*Road*",$C$2:$C$4,$A$2:$A$4,"No area",2). It searches the Area field and returns BLK-NSK-01 because College Road is the first matching area. The result is a store identifier, not the matching area text, because the return range is column A. Describe both the search field and returned field when explaining a pattern-based result.

If another area containing Road is added later, the same formula still returns only one qualifying store. It is therefore useful for a stated first-match exercise, but unsuitable as a complete report of every store on a road-named area. Source growth can change the meaning of a previously unique pattern without changing the formula itself.

Mini lab — return a delivery duration

Create a separate DeliveryLog worksheet with the following data in A1:C4. Each row represents one fictional completed delivery observation. The last field contains a numeric duration in minutes; it is not an Excel clock time or an amount in rupees. Enter the dates with DATE as in the earlier labs.

DeliveryLog!A1:C4 — fictional delivery observations
Store IDDateMinutes
BLK-PUN-012 November 202630
BLK-NSK-013 November 202625
BLK-PUN-015 November 202622

In E2, enter =XLOOKUP("BLK-PUN-01",$A$2:$A$4,$C$2:$C$4,"No observation",0,-1). The answer is 22 minutes from the last matching observation. A first-to-last lookup returns 30. The two Pune observations total 52 minutes and average 26, but neither of those calculations is the question answered by the reverse lookup.

Temporarily change the final duration from 22 to 24. Predict the reverse result 24, the unchanged first result 30 and the revised two-observation average 27. Then restore 22. This simple edit checks that the report reads the intended record and preserves the difference between one event, a total and an average.

If the operational question asks for average delivery performance, use an appropriate aggregation over a clearly defined set of observations. A last observation cannot stand in for an average, and one store's latest event cannot establish the service level of an entire platform. Label the unit, the selected store and the observation date beside a single-value result.

One selected store ID returns three fields: Nashik, College Road and Zoya. The three output cells belong to one matched store, not three different matching records.
A wider return array changes the number of fields returned. It does not turn XLOOKUP into an all-matches filter.

10. Trace a reverse exact search

Read the original AWB-7001 history

  1. Define the key and rule

    The request is AWB-7001, matching is exact, and search starts at the end of the original five-event list.

  2. Inspect the last source record

    The final row belongs to AWB-7002. It does not match the requested identifier, so the search continues toward the start.

  3. Find the last qualifying row

    The next record is AWB-7001 with Delivered on 12 November 2026. This is the last physical exact match in the supplied source.

  4. Check the time interpretation

    The original records are chronologically ordered for this parcel, so the last match also represents its latest included scan. A late-arriving older row would invalidate that interpretation until the ordering is repaired.

Repeat the explanation after adding the historical Label created event from the lab. Describe what the function actually searches, then describe what the business question requires. Keeping those two sentences separate makes it easier to recognise when the data preparation needs to change.

11. Check the decisions with explained answers

1. A minus one appears in the fifth argument. Does that mean reverse search?

No. The fifth argument is match_mode, so minus one means exact match or next smaller lookup value. Reverse search requires minus one in the sixth argument. State the argument name along with its value to avoid confusing the two options.

2. A historical Zoya order for 90 is appended last. Which amount does reverse search return?

It returns 90 after the formula includes that row. The latest dated order is still 450 on 5 November. Reverse search follows physical source order; it does not calculate the maximum date. Sorting complete records chronologically restores the intended latest interpretation.

3. Does *Grapes* always act as a contains search in XLOOKUP?

No. It is a wildcard pattern only when wildcard match mode is selected. Exact mode treats the asterisks literally. In the stated product list, wildcard mode returns P-101 first or P-103 with reverse search; neither is the complete set of matching products.

4. Which fee does the lower-bound policy assign to exactly 500?

The exact 500 boundary returns 29. Just below 500, the zero minimum applies and returns 49. This difference is why a boundary check is more informative than testing only a middle value such as 750.

5. Can an unsorted binary lookup return a plausible wrong value?

Yes. Binary search depends on the specified ascending or descending ordering. Unsorted data can produce invalid results without a dependable error warning. Use binary mode only when the source order is maintained and verified.

6. A three-column return array gives three cells. Are these three matching records?

No. They are three fields from one selected record. In StoreView, Nashik, College Road and Zoya describe the same store. If the question asks for all matching stores, use a method designed to return multiple records.

12. Explain the choices in an interview

How would you retrieve the latest status from a scan history?

I would first define latest using the event timestamp and a tie rule, then ensure complete records follow that ordering. A reverse exact XLOOKUP can retrieve the last matching row from that prepared history. I would test a late-arriving older event so the report cannot confuse import order with event time.

How do next-smaller and next-larger matching differ?

They select neighbouring lookup keys in different directions when no exact key exists. Lower-bound bands commonly use next smaller; upper-capacity limits commonly use next larger. I choose from the policy meaning and test exact boundaries, nearby values and out-of-domain inputs.

What conditions do you check before choosing binary search?

The actual lookup field must be sorted in the required direction and remain aligned with its return records. I also check duplicate-key policy and whether imports preserve order. I would measure a real performance need rather than claiming binary mode improves every small workbook.

How would you explain a blocked multi-column result?

The formula needs several adjacent cells for its output. An occupied or merged cell can block that spill. I inspect the intended output area, preserve any existing content and move or clear the actual obstruction. I also keep the spilling formula outside Excel Tables.

How do you distinguish one record's fields from all matching records?

A wider XLOOKUP return array retrieves several attributes of its selected match. It does not enumerate every matching row. I use a unique key for a single-record report and a filtering or aggregation method when the business question involves a collection of records.

13. Build a short recall routine

Match mode

Decide which lookup values qualify: exact, a neighbouring boundary or an intentional text pattern.

Search mode

Decide how the supplied list is searched. Direction does not create a chronological ordering.

Event time

Keep timestamps and tie rules with the source. A last imported record may describe an older event.

Boundary meaning

Lower starts and upper capacities answer different questions. Test both sides of every threshold.

Spill shape

Several returned columns are several fields from one record. Keep their output area available and labelled.

Verification

Use known results, missing cases, reversed order and source changes. A plausible answer alone is not enough.

Final challenge: explain the late historical order without using the word latest until you have checked the dates. Then compare the fee and capacity examples and justify their opposite matching directions. Practise the original order and parcel questions in the Excel Task Hub, and continue to XMATCH for position-based matching.

Reference checks