FP

FormulaPilot

Spreadsheet formula tools

Open generator
Excel how-to guide

How to xlookup last match in Excel

Pull the latest status, most recent price, or last logged owner for a matching key.

intermediateLookup & ReferenceXLOOKUP reference

Step-by-step instructions

How to xlookup last match3 steps

1

Use A2 as the lookup value and point XLOOKUP at the column containing all repeated keys.

2

Set the return array to the values you want back, like status or owner.

3

Keep the match mode exact and set search mode to -1 so Excel returns the last match.

Example data

Worked example

Order IDStatus
A-100Packed
A-100Shipped
A-100Delivered

Common mistakes

Errors to watch out for

Not found returned unexpectedly

Check whether the lookup values in the source table and lookup cell are stored as the same type, especially text vs numeric IDs.

FAQ

Frequently asked questions

Why use -1 in XLOOKUP?

The search mode argument of -1 tells XLOOKUP to search from last to first, which returns the last matching row.

Need a custom variation?

Describe your exact spreadsheet problem — get the formula in seconds.

Open AI Formula Generator — Free

Related how-to guides

Continue learning.