Split cell based on a character

DavidAC

Board Regular
Joined
Feb 10, 2003
Messages
134
Office Version
  1. 365
I have a list of 1000 rows similar to "Case_01_Allocate Further Staff_V4.xlsx" or "Casenote_01_Casenote_Filter_V5.xlsx" I need to be able to split this field into 2 separate columns based on the second _ so the fields should end up looking like below.
Any help greatly appreciated

Case_01 _Allocate Further Staff_V4.xlsx
Casenote _01_Casenote_Filter_V5.xlsx
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Maybe this can help:

The TEXTPLIT works only if you have O365. Else you can use the other formulas individually in each cell for first / last parts.

Book1
ABCDEFGHIJKLM
1Case_01_Allocate Further Staff_V4.xlsxCase_01Allocate Further Staff_V4.xlsxCase_01Allocate Further Staff_V4.xlsx
2Casenote_01_Casenote_Filter_V5.xlsxCasenote_01Casenote_Filter_V5.xlsxCasenote_01Casenote_Filter_V5.xlsx
3
Sheet1
Cell Formulas
RangeFormula
J1:J2J1=LEFT(A1,FIND("_",A1,FIND("_",A1,1)+1)-1)
K1:K2K1=RIGHT(A1,LEN(A1)-FIND("_",A1,FIND("_",A1,1)+1))
E1:F2E1=TEXTSPLIT(LEFT(A1,FIND("_",A1,FIND("_",A1,1)+1)-1)&"*"&RIGHT(A1,LEN(A1)-FIND("_",A1,FIND("_",A1,1)+1)),"*")
Dynamic array formulas.


No doubt @Fluff will be along soon with something better :) as usual..
 
Upvote 0
Not better, just different. ;)
Fluff.xlsm
ABC
1
2Case_01_Allocate Further Staff_V4.xlsxCase_01Allocate Further Staff_V4.xlsx
3Casenote_01_Casenote_Filter_V5.xlsxCasenote_01Casenote_Filter_V5.xlsx
4
5Case_01_Allocate Further Staff_V4.xlsxCase_01Allocate Further Staff_V4.xlsx
6Casenote_01_Casenote_Filter_V5.xlsxCasenote_01Casenote_Filter_V5.xlsx
7
8Case_01_Allocate Further Staff_V4.xlsxCase_01Allocate Further Staff_V4.xlsx
9Casenote_01_Casenote_Filter_V5.xlsxCasenote_01Casenote_Filter_V5.xlsx
10
Main
Cell Formulas
RangeFormula
B2:B3B2=TEXTBEFORE(A2,"_",2)
C2:C3C2=TEXTAFTER(A2,"_",2)
B5:C6B5=TEXTSPLIT(SUBSTITUTE(A5,"_","^",2),"^")
B8:B9B8=LEFT(A8,FIND("^",SUBSTITUTE(A2,"_","^",2))-1)
C8:C9C8=SUBSTITUTE(A8,B8&"_","")
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,214,830
Messages
6,121,834
Members
449,051
Latest member
excelquestion515

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