Kenny J
Kenny J

Reputation: 13

Excel formula that copies cell content while removing text

I need a formula that will copy A1 to B1 while removing "-text3" (the second dash and the text that follows it. The "text-text-text" format is consistent in column A). The text1, text2 and text3 each represent a variety in inconsistent strings.

A1:  text1-text2-text3
B1:  text1-text2 (-text3 has been removed by the formula)

Upvotes: 0

Views: 116

Answers (1)

Scott Craner
Scott Craner

Reputation: 152505

Use:

=LEFT(A1,FIND("}}}",SUBSTITUTE(A1,"-","}}}",2))-1)

enter image description here

Upvotes: 2

Related Questions