Find a Number Inside Text in Excel Without VLOOKUP
Question details
Find a number embedded in a longer text cell without using VLOOKUP.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A user has a number to search for and a column of sentences that may contain it.
- Observed behavior
- The user wants the position of the first sentence containing the number or the matching sentence itself.
Place the number to find in A2 on the sheet where you will enter the formula, and check that the sentences are in column A of Sheet1. Keep A2 nonblank and preserve any leading zeros as text.
Find the First Matching Sentence with MATCH
Use wildcard matching to return the position of the first sentence containing the number.
On the sheet containing the formula, enter the number or text identifier in cell A2.
Select an empty cell and enter =IFERROR(MATCH("*"&A2&"*",Sheet1!A:A,0),"Not found").
Press Enter. The formula returns the position of the first matching cell in Sheet1 column A, or Not found if there is no match.

Use XMATCH or XLOOKUP in Microsoft 365
Use XMATCH to return the position, or XLOOKUP to return the matching sentence.
Find a Number Inside a Sentence in WPS Spreadsheets
Use MATCH with wildcards in WPS Spreadsheets to find the first sentence containing a number and return its position.
- 1. Open the workbook: Open WPS Spreadsheets and use Open to select your workbook.
- 2. Check the search data: Enter the number in A2 on the current sheet and confirm that the sentences are in column A of Sheet1.
- 3. Enter the formula: Select an empty cell and enter =IFERROR(MATCH("*"&A2&"*",Sheet1!A:A,0),"Not found").
- 4. View the result: Press Enter to display the first matching position or Not found.

Frequently Asked Questions
How do I return the sentence instead of its position?
In a supported Excel version, enter =XLOOKUP("*"&A2&"*",Sheet1!A:A,Sheet1!A:A,"Not found",2) in an empty cell. It returns the first matching sentence.
What happens if more than one sentence contains the number?
MATCH and XMATCH return the position of the first match in the search range. XLOOKUP also returns the first matching sentence by default.
Will searching for 123 also find 1234?
Yes. The wildcards match text before and after 123, so 1234 is included. Use a more specific search term if you need to distinguish complete numbers.
Why should I store an identifier with leading zeros as text?
Excel can remove leading zeros from numeric entries. Format A2 as Text before entering an identifier such as 00123 so the formula searches for all of its characters.
Can I search a smaller range instead of the entire column?
Yes. Replace Sheet1!A:A with a range such as Sheet1!A2:A1000. MATCH then returns a position within that range, not the worksheet row number.




