I need to take out parts from a string, and place them in different cells.
String as follow
dfd://aas:hadd3a8py@dsdd.usuos.cos.es/ rrtt://aas.csd-wwb.ew/
dfd://georg:hnk738py@dfd.usuos.cos.es/ rrtt://georg.csd-wwb.ew/
need to put in cell1 aas, cell2 hadd3a8py, cell3 dsdd.usuos.cos.es cell4 rrtt://georg.csd-wwb.ew
The same for the second string.
Please note that words could be small and long only thing that are the same are separators.
How to cut these? Please help.
Thank you.![]()
Try:
=MID(A1,FIND("//",A1)+2,FIND(":",A1,FIND("//",A1))-FIND("//",A1)-2)=LEFT(MID(A1,FIND(B1&":",A1)+LEN(B1)+1,255),FIND("@",MID(A1,FIND(B1&":",A1)+LEN(B1)+1,255))-1)=LEFT(MID(A1,FIND(C1&"@",A1)+LEN(C1)+1,255),FIND("/",MID(A1,FIND(C1&"@",A1)+LEN(C1)+1,255))-1)in B1:D1, respectively, and copy down=LEFT(MID(A1,FIND(D1&"/",A1)+LEN(D1)+2,255),LEN(MID(A1,FIND(D1&"/",A1)+LEN(D1)+2,255))-1)
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
Oh wow Thank you so MUCH!!!
I see that each next string depends on previous. I need that each uses A1and don't depend on others.
Could you do that please?
Why can't they depend on previous?
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
Hi rakun,
Be careful what you ask for. Put your string in A1 and the following in B1 and drag the formula to the right.
See if this gives you the results you want.
As I saved the answer it said that Excel 2003 will not support more than 7 levels of nesting. So here is your formula that will work in a single cell but you need to upgrade to a newer version of Excel.=TRIM(MID(SUBSTITUTE(TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE($A$1,"//"," "),":"," "),"@"," "))," ",REPT(" ",LEN(TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE($A$1,"//"," "),":"," "),"@"," "))))),LEN(TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE($A$1,"//"," "),":"," "),"@"," ")))*(COLUMN()-1),LEN(TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE($A$1,"//"," "),":"," "),"@"," ")))))
I like NBVC's answer better. Why can't it depend on previous? My formula above depends on the column the formula is in, so previous makes sense to me.
Last edited by MarvinP; 03-03-2011 at 10:14 AM. Reason: Dislexia retype
One test is worth a thousand opinions.
Click the * below to say thanks.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks