Solved

Vlookup with left - all formatted as text - getting N/A -  what am I missing

Posted on 2016-10-28
6
29 Views
Last Modified: 2016-10-28
hi Folks
Am attaching a file with a vlookup (with a left function). The left function works fine (cell E2) but it is not working with the Vlookup. I have formatted both columns as text...so what am I missing? Thanks.
vlookup_with_left.xlsx
0
Comment
Question by:agwalsh
6 Comments
 
LVL 33

Assisted Solution

by:Norie
Norie earned 125 total points
ID: 41863523
Try this.

=VLOOKUP(VALUE(LEFT(A2,3)),$H$2:$I$26,2,FALSE)
0
 
LVL 17

Assisted Solution

by:contactkarthi
contactkarthi earned 125 total points
ID: 41863609
Left gives back you a string you need to use value function to convert it to a number. That will fix the issue.
0
 
LVL 49

Accepted Solution

by:
Rgonzo1971 earned 250 total points
ID: 41863612
or
=VLOOKUP(--(LEFT(A2,3)),$H$2:$I$26,2,0)
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

Author Comment

by:agwalsh
ID: 41863624
Thanks for all that..but why won't converting both sets of data to text work?  Surely left is a text function - the data in A2:A26 is text. The data in H2:H26 is text....
@Rgonzo1971 - what does the -- in front of the Left do?
0
 
LVL 49

Expert Comment

by:Rgonzo1971
ID: 41863636
Even if it's formatted as text, Excel uses it as a number
only if the number would be preceded by a apostrophe
'857
would Excel treat it as text

-- does the same work as value convert text to number
0
 

Author Closing Comment

by:agwalsh
ID: 41863685
Good to know that preceding a left() function with -- gets over the text issue with vlookups..
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question