Vlookup with Left Function
Hello,
Below is my formula, and I am not seeing why it is still #NoMatch? I am attempting to Vlookup the base Job# (ie: 190347), by using the =LEFT function to obtain the first 6 characters of the cell. Then using the first 6 characters, lookup that base value from a master file to vlookup the PM and SUPT
=======
=IF(ISBLANK([JOB# (if Applicable)]5397), " ", VLOOKUP((LEFT([JOB# (if Applicable)]5397, 6)), {Job List Range 1}, 6, false))
=======
If I leave the formula as is, and manually removed the "200" from the job# cell, the functions will work as desired and the desired name will populate. In Excel I would use the "--" to alleviate any formatting issues, but I'm stumped here.
Best Answer
-
Whether or not it is the Primary Column doesn't make a difference in this case. What makes the difference is the LEFT function as you have already discovered. Here's why...
You are entering NUMBERS into your lookup table, but the LEFT function outputs TEXT. Text isn't numbers, and that is why you are getting the #NO MATCH error. Try wrapping the LEFT function in a VALUE function and drop that into your VLOOKUP.
VALUE(LEFT(...................))
=IF(ISBLANK([JOB# (if Applicable)]@row), "", VLOOKUP(VALUE(LEFT([JOB# (if Applicable)]@row, 6)), {Job List Range 1}, 6, false))
Answers
-
How are the values entered in the master file?
-
Hi Paul. The Job# on the master sheet where I'm attempting to lookup to is not the primary column, but it is entered as an actual number, meaning no additional lookups or any other formulas. The formula was working as planned prior to adding the "LEFT" functionality for the first 6 characters. I broke out the "LEFT" and it worked just fine...it's just when I put it all together.
-
Whether or not it is the Primary Column doesn't make a difference in this case. What makes the difference is the LEFT function as you have already discovered. Here's why...
You are entering NUMBERS into your lookup table, but the LEFT function outputs TEXT. Text isn't numbers, and that is why you are getting the #NO MATCH error. Try wrapping the LEFT function in a VALUE function and drop that into your VLOOKUP.
VALUE(LEFT(...................))
=IF(ISBLANK([JOB# (if Applicable)]@row), "", VLOOKUP(VALUE(LEFT([JOB# (if Applicable)]@row, 6)), {Job List Range 1}, 6, false))
-
Typically in Excel I'd have used "text to columns" to deal with varying formats. That worked perfectly. Appreciate the help and new trick. Thank you.
-
Happy to help. 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.1K Get Help
- 414 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 141 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!