FotoDJ
FotoDJ

Reputation: 351

Excel - remove characters after a specific character

I have colum B with values:

0015-04D-SEAW
0015-ADLKM-SPOK
0015-D-CURR
0016-01N-BOIL etc.

How can I remove all characters after second dash and the second dash itself as well, it should look like this:

0015-04D
0015-ADLKM
0015-D
0016-01N

Upvotes: 0

Views: 74

Answers (2)

d.b
d.b

Reputation: 32548

One dirty solution would be to convert text to columns delimited by - and then to concatenate the first two columns separated by -

Upvotes: 1

cyboashu
cyboashu

Reputation: 10433

Assuming B1 contains 0015-04D-SEAW

This would do : =IFERROR(MID(B1,1,FIND("-",B1,FIND("-",B1,1)+1)-1),B1)

Result : 0015-04D

Upvotes: 2

Related Questions