ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   vLookup a portion of a no. in a cell (https://www.excelbanter.com/excel-worksheet-functions/243465-vlookup-portion-no-cell.html)

kattay

vLookup a portion of a no. in a cell
 
Can I do a vlookup on the 1st 2 no. of a 6 digits no.? Eg.
Table 1
Postal Code Area
200455 ?

Table 2
Postal Code Area
20 A
I want table 1 to reflect A

T. Valko

vLookup a portion of a no. in a cell
 
Maybe something like this:

=VLOOKUP(--LEFT(A2,2),Table2,2,0)

--
Biff
Microsoft Excel MVP


"kattay" wrote in message
...
Can I do a vlookup on the 1st 2 no. of a 6 digits no.? Eg.
Table 1
Postal Code Area
200455 ?

Table 2
Postal Code Area
20 A
I want table 1 to reflect A




kattay

vLookup a portion of a no. in a cell
 
Hi, thanks. It worked.
I guess the 2 in "--LEFT(A2,2)" refers to the no. of digits I want to
lookup. What about "--", does it denotes anything?

"T. Valko" wrote:

Maybe something like this:

=VLOOKUP(--LEFT(A2,2),Table2,2,0)

--
Biff
Microsoft Excel MVP


"kattay" wrote in message
...
Can I do a vlookup on the 1st 2 no. of a 6 digits no.? Eg.
Table 1
Postal Code Area
200455 ?

Table 2
Postal Code Area
20 A
I want table 1 to reflect A





T. Valko

vLookup a portion of a no. in a cell
 
I guess the 2 in "--LEFT(A2,2)" refers to the no.
of digits I want to lookup


Yes

What about "--", does it denotes anything?


The LEFT function is a text function and as such returns a *TEXT* value. The
double unary is one method of coercing the text result of 20 to the numeric
result of 20 so that you have matching data types between the lookup value
and the data in the lookup table.

TEXT 20 and numeric 20 aren't the same to Excel.

--
Biff
Microsoft Excel MVP


"kattay" wrote in message
...
Hi, thanks. It worked.
I guess the 2 in "--LEFT(A2,2)" refers to the no. of digits I want to
lookup. What about "--", does it denotes anything?

"T. Valko" wrote:

Maybe something like this:

=VLOOKUP(--LEFT(A2,2),Table2,2,0)

--
Biff
Microsoft Excel MVP


"kattay" wrote in message
...
Can I do a vlookup on the 1st 2 no. of a 6 digits no.? Eg.
Table 1
Postal Code Area
200455 ?

Table 2
Postal Code Area
20 A
I want table 1 to reflect A








All times are GMT +1. The time now is 04:43 PM.

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