Hi
I have a column where the cells contain two numbers from 0-10 with a / between them, like this: 0/3.
I want to exchange these numbers with the corresponding letter abbreviations like this:
0/3 => ME/LG.
Can this be done?
Any help is appreciated
Hi
I have a column where the cells contain two numbers from 0-10 with a / between them, like this: 0/3.
I want to exchange these numbers with the corresponding letter abbreviations like this:
0/3 => ME/LG.
Can this be done?
Any help is appreciated
Yes. You can split out the 2 values like this:
=LEFT(A1,FIND("/",A1)-1)
=RIGHT(A1,LEN(A1)-FIND("/",A1))
Create a lookup table holding the values and their text replacements and use VLOOKUP to return them and then combine them again.
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.
I can get the cells split into two. However, the vlookup doesn't work on the split cells which has the =left and =right formula in it, it only returns #N/A? When I use vlookup on a cell I just typed the number into vlookup works ? So vlookup doesn't work on the resulting number from a formula?
I'm guessing that will be because your vlookup table has numeric values in it whereas the formula I posted will return text.
You could change the formula to:
=LEFT(A1,FIND("/",A1)-1)*1
=RIGHT(A1,LEN(A1)-FIND("/",A1))*1
Which will then return numerics.
Dom
It worked! Thank you very much for your help, Dom!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks