split text string at 3rd instance of special character from the right of string.

JRD74

New Member
Joined
May 3, 2016
Messages
2
Hello - trying to find code that will split a text string at the 3rd instance of a special character from the right of the string.

example string - "xxx-yyyy-zzz-FL-1-15-8"

I would like to split the text at the 3rd "-" from the right (split between FL and 1). I then need to paste the 2 values in adjacent cells to the original (using Offset or something).

A1 = xxx-yyyy-zzz-FL-1-15-8
B1 = xxx-yyyy-zzz-FL-
C1 = 1-15-8

there will be varying lengths of text between the dashes, but the split will always be needed at the 3rd "-" from the right.

Any guidance would be appreciated.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Welcome to the board

B1: =LEFT(A1,FIND("^",SUBSTITUTE(A1,"-","^",LEN(A1)-LEN(SUBSTITUTE(A1,"-",""))-2)))
C1: =SUBSTITUTE(A1,B1,"")
 
Upvote 0

Forum statistics

Threads
1,223,714
Messages
6,174,052
Members
452,542
Latest member
Bricklin

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
Back
Top