Grabbing Text After Certain Character & More

mdsurf

New Member
Joined
Aug 1, 2017
Messages
22
Office Version
  1. 2016
Platform
  1. MacOS
I have a cell formatted in the following way

G:\Shared drives\Designs\AB Acc\My Saw\PR Batch12\10021290403^New Game^My New Symbol^Company Flag^Don't Want^Oregon^.png

What I want to do is extract most of the words after the first '^' character between the string of numbers and 'New Game'. The end result should be

New Game My New Symbol Company Flag Oregon

Please note how the 'don't want' isn't included. I need to remove this text but not the text specifically, but the fact that it's the 4th batch of text between '^' if that makes sense.

Thank you in advance.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Try:
Book1
FGH
1
2G:\Shared drives\Designs\AB Acc\My Saw\PR Batch12\10021290403^New Game^My New Symbol^Company Flag^Don't Want^Oregon^.png
3
4Step 1New Game^My New Symbol^Company Flag^Don't Want^Oregon^.png
5Step 2New Game^My New Symbol^Company Flag^Don't Want^Oregon^
6Step 3New Game My New Symbol Company Flag Don't Want Oregon
7
8All in oneNew Game My New Symbol Company Flag Don't Want Oregon
9
Sheet6
Cell Formulas
RangeFormula
G4G4=RIGHT(G2, LEN(G2) - FIND(CHAR(94),G2))
G5G5=LEFT(G4,FIND(".",G4)-1)
G6G6=TRIM(SUBSTITUTE(G5,CHAR(94)," "))
G8G8=TRIM(SUBSTITUTE(LEFT(RIGHT(G2, LEN(G2) - FIND(CHAR(94),G2)),FIND(".",RIGHT(G2, LEN(G2) - FIND(CHAR(94),G2)))-1),CHAR(94)," "))
 
Upvote 0
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’)

Could you also give 3 or 4 more varied data samples and the expected results?
 
Upvote 0
To comply with this:
Please note how the 'don't want' isn't included.
When the format is always the same (6 times "^" )
VBA Code:
Function jec(cell As String) As String
 a = Split(cell, "^"): a(0) = "": a(4) = "": a(6) = ""
 jec = Application.Trim(Join(a))
End Function
 
Upvote 0
Try

Book1
ABC
1G:\Shared drives\Designs\AB Acc\My Saw\PR Batch12\10021290403^New Game^My New Symbol^Company Flag^Don't Want^Oregon^.pngNew Game My New Symbol Company Flag Oregon
2
Sheet1
Cell Formulas
RangeFormula
B1B1=SUBSTITUTE(SUBSTITUTE(LEFT(MID(SUBSTITUTE(A1,CHAR(94),"@",4),FIND(CHAR(94),SUBSTITUTE(A1,CHAR(94),"@",4))+1,99),FIND("@",MID(SUBSTITUTE(A1,CHAR(94),"@",4),FIND(CHAR(94),SUBSTITUTE(A1,CHAR(94),"@",4)),99))-1)&" "&TRIM(RIGHT(REPLACE(SUBSTITUTE(A1,CHAR(94),REPT(" ",99)),FIND(".",SUBSTITUTE(A1,CHAR(94),REPT(" ",99))),99,""),99)),CHAR(94)," "),"@","")
 
Upvote 0
Ignore post #5 and Try to exclude batch #4

Book1
AB
1G:\Shared drives\Designs\AB Acc\My Saw\PR Batch12\10021290403^New Game^My New Symbol^Company Flag^Don't Want^Oregon^.pngNew Game My New Symbol Company Flag Oregon
2G:\Shared drives\Designs\AB Acc\My Saw\PR Batch12\10021290403^New Game^My New Symbol^Company Flag^Don't Want^Oregon^Ashab^.pngNew Game My New Symbol Company Flag Oregon Ashab
3G:\Shared drives\Designs\AB Acc\My Saw\PR Batch12\10021290403^Ali^New Game^My New Symbol^Company Flag^Don't Want^Oregon^Ashab^.pngAli New Game My New Symbol Don't Want Oregon Ashab
4G:\Shared drives\Designs\AB Acc\My Saw\PR Batch12\10021290403^Ali^Pravin^New Game^My New Symbol^Company Flag^Don't Want^Oregon^Ashab^Pooja^.pngAli Pravin New Game Company Flag Don't Want Oregon Ashab Pooja
5
6
Sheet1
Cell Formulas
RangeFormula
B1:B4B1=TRIM(SUBSTITUTE(SUBSTITUTE(CONCATENATE(LEFT(SUBSTITUTE(REPLACE(A1,1,FIND(CHAR(94),A1),""),CHAR(94),"@",3),FIND("@",SUBSTITUTE(REPLACE(A1,1,FIND(CHAR(94),A1),""),CHAR(94),"@",3))-1)," ",REPLACE(REPLACE(SUBSTITUTE(REPLACE(A1,1,FIND(CHAR(94),A1),""),CHAR(94),"@",3),1,FIND("@",SUBSTITUTE(REPLACE(A1,1,FIND(CHAR(94),A1),""),CHAR(94),"@",3)),""),1,FIND(CHAR(94),REPLACE(SUBSTITUTE(REPLACE(A1,1,FIND(CHAR(94),A1),""),CHAR(94),"@",3),1,FIND("@",SUBSTITUTE(REPLACE(A1,1,FIND(CHAR(94),A1),""),CHAR(94),"@",3)),"")),"")),".png",""),CHAR(94)," "))
 
Upvote 0
If there are always the same number of sections (that's why I asked for more samples) then these worksheet functions should do the job
G3 if MS 365 or Excel 2019 (possibly Ctrl+Shift+Enter for 2019 but not for 365)
G4 for any version

mdsurf.xlsm
G
2G:\Shared drives\Designs\AB Acc\My Saw\PR Batch12\10021290403^New Game^My New Symbol^Company Flag^Don't Want^Oregon^.png
3New Game My New Symbol Company Flag Oregon
4New Game My New Symbol Company Flag Oregon
Sheet1
Cell Formulas
RangeFormula
G3G3=TRIM(CONCAT(MID(SUBSTITUTE(G2,"^",REPT(" ",300)),{1,2,3,5}*300,300)))
G4G4=TRIM(REPLACE(REPLACE(REPLACE(SUBSTITUTE(G2,"^",REPT(" ",300)),1800,300,""),1200,300,""),1,300,""))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,925
Messages
6,122,301
Members
449,078
Latest member
nonnakkong

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