Vlookup Numbers/Text

MikeDBMan

Well-known Member
Joined
Nov 10, 2010
Messages
610
We use numbers for various things in our ERP system. When we dump data into Excel sometimes those numbers show up as numbers and sometimes they show up in Excel as text. If I want to do a vlookup on that field, I have to ensure my lookup is looking at a number so both are numbers and text so both are text. This is a pain. I was trying to think of a way to work around that issue. Any suggestions?
 
Try something like:
Rich (BB code):
=VLOOKUP(A1+0,table,column_number,0)
"+0" makes Excel evaluate a number in text form to become numerical
 
Upvote 0
That presupposes that I would always be looking up text. I could make sure that is always the case but if the field's value is "123A" then adding 0 might not work. But maybe I can take that into account. I'll play around with it. Thanks!
 
Upvote 0
You should always test your data using ISNUMBER OR ISTEXT before doing your vlookup to ensure quality results, be careful also of extra spaces for this you can try TRIM to remove those extra spaces.
 
Upvote 0
I focused on this part of your posting:
When we dump data into Excel sometimes those numbers show up as numbers and sometimes they show up in Excel as text. If I want to do a vlookup on that field, I have to ensure my lookup is looking at a number
I took that to mean you were always wanting a numerical look up value and not a mixture of alphanumeric characters. Perhaps if you provided an example, it would less easy to misinterpret what help you are after
 
Upvote 0
JackDanIce, I agree with your reasoning on why you answered the way you did. There are rare cases where the number does contain alpha characters and I forgot to take that into consideration in my posting. I believe your solution will work and will go with it. Thanks for posting!
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top