Partial match with numbers and wildcard (2024)

Table of Contents
Explanation Another option

Explanation

Excel supports the wildcard characters "*" and "?", and these wildcards can be used to perform partial (substring) matches in various lookup formulas. However, if you use wildcards with a number, you'll convert the numeric value to a text value. In other words,"*"&99&"*" = "*99*" (a text string), and if you try to find a text value in a range of numbers, the match will fail.

One solution is toconvert the numeric values to text with the TEXT function like this:

=MATCH("*"&E5&"*",TEXT(data,"0"),0)

This is an array formula and must be entered with Control + Shift + Enter, except in Excel 365.

This formula uses the TEXT function to transform the numbers in B5:B10 to text with the number format "0". Because we give the entire range to TEXT, we get back all values converted to text in an array, which is returned directly to the MATCH function as the array argument. With the numbers converted to text, the MATCH function can find a partial match as usual.

Note that MATCH must be configured for exact match to use wildcards, by setting the 3rd argument to zero (0) or FALSE.

Another option

Another way to to transform a number to text is to concatenatethe numbers to an empty string ("") with the ampersand (&)operator like this:

=MATCH("*"&E5&"*",data&"",0)

The numbers in data become text without formatting, and the result is the same as above, 7.

Partial match with numbers and wildcard (2024)
Top Articles
Latest Posts
Article information

Author: Kerri Lueilwitz

Last Updated:

Views: 6495

Rating: 4.7 / 5 (47 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Kerri Lueilwitz

Birthday: 1992-10-31

Address: Suite 878 3699 Chantelle Roads, Colebury, NC 68599

Phone: +6111989609516

Job: Chief Farming Manager

Hobby: Mycology, Stone skipping, Dowsing, Whittling, Taxidermy, Sand art, Roller skating

Introduction: My name is Kerri Lueilwitz, I am a courageous, gentle, quaint, thankful, outstanding, brave, vast person who loves writing and wants to share my knowledge and understanding with you.