(Suitably refreshed now ...)
Next you need to set up some named ranges. This will make the formula
which I will give you shorter, and hopefully easier to follow.
Highlight all the data in the table (in this case C1
31 on Sheet1)
and click on Insert | Name | Define and give this the name
"Table" (without the quotes) in the top box, then click OK. Then
highlight all the data in column C (i.e. C1:C31) and Insert | Name |
Define again, and this time give the name "values" (no quotes).
Now you need to set up a name for each of the block of numbers in
column C that are the same number of digits. So highlight C1:C9 and
give this the name "L_1" (again, without the quotes). The next range
will be C10:C14, and give this the name L_2 (for 2-digit numbers).
Similarly for C15:C19 (L_3), C20:C27 (L_4), C28:C29 (L_5) and C30:C31
(L_6).
Obviously in your real table the ranges will be different, but I am
assuming that you will want to test out my solution on your example
data first before applying it to the actual data.
Now, with the list of numbers you want to find partial matches on
located in column F of Sheet2 (starting in F1), put this formula in an
adjacent cell:
=INDEX(Table,MATCH(LEFT(F1,MAX(IF(ISNA(MATCH(LEFT(F1,1)*1,L_1,0)),
0,1),IF(ISNA(MATCH(LEFT(F1,2)*1,L_2,0)),
0,2),IF(ISNA(MATCH(LEFT(F1,3)*1,L_3,0)),
0,3),IF(ISNA(MATCH(LEFT(F1,4)*1,L_4,0)),
0,4),IF(ISNA(MATCH(LEFT(F1,5)*1,L_5,0)),
0,5),IF(ISNA(MATCH(LEFT(F1,6)*1,L_6,0)),0,6)))*1,values,0),2)
Note that this is all one formula - be wary of spurious line-breaks
that your newsreader might insert. Copy this down the column for as
many values as you have. I got these results for the 23 numbers in
your second example:
279874857 0.05
482244288 0.01
947343425 0.15
124623028429 0.15
4428473839 x
99899292340 0.07
743427633 0.04
1124859574 x
1250343425 0.01
7733222553 0.04
2030294021 0.13
484312594 x
4034885556 x
1238495345 x
4585547 x
12463593 0.08
6981111 x
2341223 x
12954745 x
18246512597 x
95853089 0.25
48607809655 0.11
482242322097 0.01
Try this out on your sample data, then post back if you need help
applying it to up to 9-digit numbers in your real data.
Hope this helps.
Pete