ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Match 9 to 11 digits - vlookup (https://www.excelbanter.com/excel-discussion-misc-queries/150703-match-9-11-digits-vlookup.html)

Laury

Match 9 to 11 digits - vlookup
 
I have a list of 9 digit numbers (missing the end 2). I need to lookup the
closest match in a list of 11 digit numbers. I tried vlookup but it pulls in
the value above the one that I want. How do I make it find the one with all
9 digits matching?
EX:

List1 List2
300005555 30000555201 - vlookup pulls in this one
30000555502 - i want this one

Peo Sjoblom

Match 9 to 11 digits - vlookup
 
Maybe this will work

=INDEX(B2:B20,MATCH(TEXT(C1,"@"),LEFT(A2:A20,9),0) )

entered with ctrl + shift & enter

replacing


=VLOOKUP(C1,A2:B20,2,TRUE)


--
Regards,

Peo Sjoblom


"Laury" wrote in message
...
I have a list of 9 digit numbers (missing the end 2). I need to lookup the
closest match in a list of 11 digit numbers. I tried vlookup but it pulls
in
the value above the one that I want. How do I make it find the one with
all
9 digits matching?
EX:

List1 List2
300005555 30000555201 - vlookup pulls in this one
30000555502 - i want this one





Bob Phillips

Match 9 to 11 digits - vlookup
 
=INDEX(K1:K20,MATCH(TRUE,300005555=--LEFT(J1:J20,9),0))

which is an array formula, it should be committed with Ctrl-Shift-Enter, not
just Enter.
Excel will automatically enclose the formula in braces (curly brackets), do
not try to do this manually.
When editing the formula, it must again be array-entered.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Laury" wrote in message
...
I have a list of 9 digit numbers (missing the end 2). I need to lookup the
closest match in a list of 11 digit numbers. I tried vlookup but it pulls
in
the value above the one that I want. How do I make it find the one with
all
9 digits matching?
EX:

List1 List2
300005555 30000555201 - vlookup pulls in this one
30000555502 - i want this one




Laury

Match 9 to 11 digits - vlookup
 
Thanks - the index and match did the trick!

"Peo Sjoblom" wrote:

Maybe this will work

=INDEX(B2:B20,MATCH(TEXT(C1,"@"),LEFT(A2:A20,9),0) )

entered with ctrl + shift & enter

replacing


=VLOOKUP(C1,A2:B20,2,TRUE)


--
Regards,

Peo Sjoblom


"Laury" wrote in message
...
I have a list of 9 digit numbers (missing the end 2). I need to lookup the
closest match in a list of 11 digit numbers. I tried vlookup but it pulls
in
the value above the one that I want. How do I make it find the one with
all
9 digits matching?
EX:

List1 List2
300005555 30000555201 - vlookup pulls in this one
30000555502 - i want this one







All times are GMT +1. The time now is 05:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com