How to find the word after the second dash or the third word?
APPLE-PEANUT-EGG-BALL
to get APPLE we can use LEFT search
to get PEANUT we can use MID search
to get BALL we can use RIGHT search
ho to find the EGG?
How to find the word after the second dash or the third word?
APPLE-PEANUT-EGG-BALL
to get APPLE we can use LEFT search
to get PEANUT we can use MID search
to get BALL we can use RIGHT search
ho to find the EGG?
If your data is in A1, use this...
=TRIM(MID(SUBSTITUTE($A1,"-",REPT(" ",LEN($A1))),LEN($A1)*2+1,LEN($A1)))
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
I'm sorry, I have problem to get BALL too. Please, help me...
I thought you already had that part?
another way...to get APPLE we can use LEFT search
to get PEANUT we can use MID search
to get BALL we can use RIGHT search
ho to find the EGG?
=mid(a1,search("-",a1,3)+1,99)
If you want to break them all out into seperate columns...
A B C D E 1APPLE-PEANUT-EGG-BALL APPLE PEANUT EGG BALL
B2=TRIM(MID(SUBSTITUTE($A1,"-",REPT(" ",LEN($A1))),LEN($A1)*(COLUMN()-2)+1,LEN($A1)))
copied across
Why not use Data - Text To Columns, Deliminated, with hyphen as the delimiter ?
Jonmo1, I just woke up, Im using that as my excuse for not thinking of that option![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks