I would like to split these texts into cells in excel:
Hello-HOW-are-YOU-DOING-!
This-is-not-my-name-.
Random-People-are-looking-?
No-!
It should basically look like that:
At the moment I am using this formula, which gives me just the first split:
=LEFT(Export!A2;FIND("-";Export!A2)-1)
Any recommendations how I can do the split automatically for each -?
I appreciate your replies!
With data in B1; in C1 enter:
=TRIM(MID(SUBSTITUTE($B1,"-",REPT(" ",999)),COLUMNS($A:A)*999-998,999))
and copy across:
Or you could do this...
=MID($A2,FIND(B2,$A2)+LEN(B2)+1,FIND("-",$A2,FIND(B2,$A2)+LEN(B2)+1)-(FIND(B2,$A2)+LEN(B2)+1))
in cell D onwards since you already have
=LEFT(A2,FIND("-",A2)-1)
for the first cell
来源:https://stackoverflow.com/questions/27964856/excel-split-by-in-each-cell