Excel Formula to Find Text and Return a Name from the Same Row
Question details
Find text contained in a roster cell and return the name from another column on the same row.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A user has search text in C11, searchable roster values in D2:D7, and corresponding names in E2:E7.
- Observed behavior
- The desired result is the name from the first row whose searchable value contains the text in C11.
Confirm that the searchable values and names occupy corresponding rows, and enter the text to find in C11. The examples below use D2:D7 for the search and E2:E7 for the names; adjust both ranges together for your roster.
Use XLOOKUP to find text and return the matching name
Use this formula in an Excel version that supports XLOOKUP to return the first name matching a partial text search.
Type the text you want to find into cell C11.
Select an empty result cell and enter =IF(C11="","",XLOOKUP("*"&C11&"*",D2:D7,E2:E7,"",2)).
Press Enter. The formula returns the name from the first matching row, or a blank if C11 is empty or no match is found.

Use INDEX and MATCH when XLOOKUP is unavailable
Use this alternative in older Excel versions that support INDEX and MATCH.
Find a matching name in WPS Spreadsheets
Use INDEX and MATCH with wildcards in WPS Spreadsheets to find text within a roster cell and return the name from the same row.
- 1. Open the roster: Open WPS Spreadsheets and use Open to select your roster workbook.
- 2. Enter the search term: Type the text to find in cell C11, with searchable values in D2:D7 and corresponding names in E2:E7.
- 3. Insert the formula: Select an empty result cell and enter =IF(C11="","",IFERROR(INDEX(E2:E7,MATCH("*"&C11&"*",D2:D7,0)),"")).
- 4. View the result: Press Enter to return the name from the first matching row. Adjust the ranges in the formula if your roster uses different cells.

Frequently Asked Questions
How do I find text that is only part of a cell?
Surround the search value with asterisks, as in "*"&C11&"*". In XLOOKUP, set the match mode to 2 to enable wildcard matching.
What happens if more than one roster row matches?
The formulas shown return the name from the first matching row in the search range.
Why does the formula return a blank?
The formulas return a blank when C11 is empty or when no matching text is found. Check C11 and confirm that D2:D7 contains the values you want to search.
Can I use VLOOKUP instead?
Yes. When the search column is to the left of the name column, enter =IF(C11="","",IFERROR(VLOOKUP("*"&C11&"*",D2:E7,2,FALSE),"")) in an empty cell.




