How to remove everything after 2nd "-" ?

joshman108

Active Member
Joined
Jul 6, 2016
Messages
310
Cell value which I want altered is:

abc-abc-abc

with formula

LEFT(A2,(FIND("-",A2,(FIND("-",A2)+1)+1)))

which cuts down to abc-abc-

But how do I remove the dash at the end to leave:

abc-abc?

Thanks!
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Gerald Higgins

Well-known Member
Joined
Mar 26, 2007
Messages
9,258
Try

LEFT(A2,(FIND("-",A2,(FIND("-",A2)+1)+1))-1)

Or if the 2nd "-" is ALWAYS character 8. . .
=left(a2,7)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,191,165
Messages
5,985,040
Members
439,935
Latest member
Monty238

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top