Excel - Split by `;` in each cell

2019-03-06 15:04发布

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:

enter image description here

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!

2条回答
家丑人穷心不美
2楼-- · 2019-03-06 15:25

With data in B1; in C1 enter:

=TRIM(MID(SUBSTITUTE($B1,"-",REPT(" ",999)),COLUMNS($A:A)*999-998,999))

and copy across:

enter image description here

查看更多
在下西门庆
3楼-- · 2019-03-06 15:38

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

查看更多
登录 后发表回答