Thank you very much Domski and daddylonglegs!
Both your suggestions worked great.
Though I was just wondering why wasn't the formula working, I'd appreciate it if you could explain... but if not, thanks again for the help.
Thank you very much Domski and daddylonglegs!
Both your suggestions worked great.
Though I was just wondering why wasn't the formula working, I'd appreciate it if you could explain... but if not, thanks again for the help.
Your formula was this
=VLOOKUP(LEFT(D1,2),$A$1:$B$4,2,2)
It's not usual to use 2 as the final argument, the options are TRUE (1) or FALSE (0). If you use 2 it behaves like 1.
When you use 1 as the final argument the lookup range (A1:A4 here) needs to be sorted ascending. As A1:A4 isn't sorted ascending the results are "odd". If you use this version instead
=VLOOKUP(LEFT(D1,2),$A$1:$B$4,2,0)
Then you'd get #N/A for your examples because you are trying to find a match for "De" or "Kr" in A1:A4 and neither of those values exist.
With my suggestion you are looking for "De*" and "Kr*" where * is a wildcard representing zero or more characters....so you do get matches for those
Audere est facere
And mine as proved by DL was totally over complicating the situation
Dom
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks