Excaliburst
Excaliburst

Reputation: 65

How to get cell content to the right of n'th special character

From this cell content in Excel MB_Dyt01_MB_Dyt11 I need to extract everything right of the second underscore "_" character.

I have tried with this formula

=RIGHT(E12;FIND("_";SUBSTITUTE(E12;"_";"_";2))+10)

Which returns yt01_MB_Dyt11 Not correct.

And with this fomula =RIGHT(E35;FIND("_";E35;4)-1)

Which returns 03_Fm09

Can you help me extract the text MB_Dyt11 from the above cell?

Upvotes: 1

Views: 101

Answers (2)

Yan Zhang
Yan Zhang

Reputation: 1

To add to BigBen's answer, you can use the combination of len() and right() instead of mid() so that the formula would work on text strings of any length

=RIGHT(A1,LEN(A1)-FIND("~",SUBSTITUTE(A1,"_","~",2)))

Upvotes: 0

BigBen
BigBen

Reputation: 50143

One option:

=MID(A1;FIND("~";SUBSTITUTE(A1;"_";"~";2))+1;999)

enter image description here

Upvotes: 1

Related Questions