简体   繁体   中英

Excel: INDEX MATCH with partial number

I have a large table of 12 digit numbers and associated info

I have a small list of 10 and 11 digit numbers (the first and/or last digits were cut off) - I'm attempting to cross these two lists to identify the items on the small list

normally, I'd use an index match to bring the associated info out of the table into the list, but because today I have only partial numbers in my list, I can't get the formula to work

I've seen other examples here that search for partial text strings contained within a range, but I haven't been able to adapt those formulas to my data. wildcards don't seem to work with numbers.

Many thanks for your input, and apologies in advance if I failed to find an existing solution on the site.

To match partial numbers inside a number range, like you do with strings, you can use an array formula with INDEX/MATCH , by composing a temporary array that converts the numbers into strings.

Say column A is your 12 digit numbers column, and you want to match the sequence 1234567890 and retrieve the value from column B , This CSE formula works:

=INDEX($B$2:$B$9999, MATCH("*1234567890*",""&$A$2:$A$9999,0))

Ctrl Shift Enter

Although you can use full columns A:A and B:B , this should be avoided as much as possible with array formulas, because they're slow . Full columns mean computing and operating arrays of more than a million entries, so avoid it. Also note the "expensive" conversion from numbers to strings (all numbers in the $A$2:$A$9999 are converted to strings here).

在此处输入图片说明


To use a cell reference, say D2 , instead of the harcoded 1234567890 , the formula should be used like this:

=INDEX($B$2:$B$9999,MATCH("*"&D2&"*",""&$A$2:$A$9999,0))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM