Find the Cell Address of a Matching Value in Excel
Question details
Find the address of the first or last cell matching a lookup value in an Excel range.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A user wants to locate a value in a worksheet range and return its cell reference.
- Observed behavior
- The formula should return an address such as A3, or indicate that no match was found.
Identify the range to search and enter the lookup value in K2. Choose whether the first or last match should be returned; for a multi-column range, the formula below searches each row from left to right.
Find a match in a multi-column range with Excel 365 or Excel 2024
Use TOCOL and XMATCH to return the first or last matching address in a rectangular range.
The formula searches A1:H15 row by row, from left to right. It returns a relative address such as B3 rather than the cell value.
Select an empty cell outside A1:H15 and enter =IFERROR(LET(p,XMATCH($K$2,TOCOL($A$1:$H$15,0),0,1),ADDRESS(ROW($A$1)+QUOTIENT(p-1,COLUMNS($A$1:$H$15)),COLUMN($A$1)+MOD(p-1,COLUMNS($A$1:$H$15)),4)),"Not found").
To search from the end instead, change the final argument of XMATCH from 1 to -1 and press Enter.
Replace every occurrence of $A$1:$H$15 with your data range, replace $A$1 with its top-left cell, and replace $K$2 with your lookup cell.

Find a match in one column with an array formula
Use this method in older Excel versions when the search range is a single column.
Find a matching cell address in WPS Spreadsheets
Use ADDRESS with MATCH to return the first matching cell in a column, or use LOOKUP to find the last match.
- 1. Open your workbook: Open WPS Spreadsheets and choose File > Open to select your workbook.
- 2. Prepare the lookup: Place the values to search in A1:A15 and enter the lookup value in K2, or adapt those references to your sheet.
- 3. Find the first match: Select an empty cell and enter =IFERROR(ADDRESS(ROW($A$1)+MATCH($K$2,$A$1:$A$15,0)-1,COLUMN($A$1),4),"Not found"). Press Enter.
- 4. Find the last match: For the last match instead, enter =IFERROR(ADDRESS(LOOKUP(2,1/($A$1:$A$15=$K$2),ROW($A$1:$A$15)),COLUMN($A$1),4),"Not found") in an empty cell and press Enter.

Frequently Asked Questions
How do I return the last match instead of the first?
In the multi-column Excel formula, change XMATCH's search mode from 1 to -1. In the single-column array formula, replace SMALL with LARGE.
What does the 4 in the ADDRESS formula do?
The fourth argument tells ADDRESS to return a relative reference such as A3. Change it to 1 to return an absolute reference such as $A$3.
Why does the formula display "Not found"?
IFERROR displays that message when the formula produces an error, including when there is no match. Check the value in K2, the search range, and any errors in the source cells.
Can I use a named range instead of cell references?
Yes. Replace the range references with your named range and make sure the top-left cell reference used by ADDRESS corresponds to that range.
Does MATCH treat asterisks and question marks as literal characters?
With MATCH set to exact-match mode 0, * and ? in a text lookup value are wildcards. Use ~* or ~? in the lookup value to search for those characters literally.




