madkitty
madkitty

Reputation: 1675

Vlookup doesn't work with column of string

I have 4 columns, containing 2 columns of names and 2 columns of values, as below. I need to update Column B with value in K, if the name1 = name2. Both name columns are formatted as text, and values columns are formatted as numeric.

(A) Name1     (B) Value1       (J) Name2     (K) Value2
     A                               A             123    
     B                               B             456   
     C                               X             000   
     D                               Y             000   
     E                               Z             000  
     F                               C             789   

I insterted the following vlookup in the first row of column B, but it returns the name in column A.

=VLOOKUP(A4,J2:J22890,K2:K22890)


I'm expecting to have the following result:
    (A) Name1     (B) Value1       (J) Name2     (K) Value2
         A              123              A             123    
         B              456              X             000   
         C              789              B             456   
         D                               Y             000   
         E                               Z             000  
         F                               C             789   

Am I using vlookup a the wrong way? or is it due to the fact that I'm looking up strings??

Upvotes: 0

Views: 473

Answers (2)

ChrisG
ChrisG

Reputation: 1251

Since I can't edit the post because it's not enough characters and I can't comment because I don't have enough rep... =VLOOKUP(A4,$J$2:$K$22890,2,0)

This is Alex's post with absolute references for the lookup table array.

Upvotes: 1

Alex Szabo
Alex Szabo

Reputation: 3276

I think it should be

=VLOOKUP(A4,J2:K22890,2,0)

1.First parameter is the value you are looking for,

2.second one is the range (it can be multiple columns, with the referenced data in the most-left column of the selection),

3.followed by the column's number where the records should be retrieved from,

4.and lastly a flag (1 or 0) if you would like to accept similar results (1) or exact matches only (0)

Upvotes: 2

Related Questions