Excel formula that copies cell content while remov

2019-06-09 03:27发布

问题:

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)

回答1:

Use:

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