Extract String

vpranitha

New Member
Joined
Jun 26, 2014
Messages
25
Hello All,

Looking to extract text from a string. For eg my ID is CCCC 2020-STAR A1, how do I extract CCC 2020-STAR . Greatly appreciate your assistance.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Perhaps =MID(A1,2,13)

With only a single example the requirement could be interpreted in many ways.
 
Upvote 0
Try this,
Book1
AB
1CCCC 2020-STAR A1CCC 2020-STAR
2CCCC 2020-STAR A2CCC 2020-STAR
3CCCC 2020-STAR A3CCC 2020-STAR
4CCCC 2020-STAR A4CCC 2020-STAR
5CCCC 2020-STAR A5CCC 2020-STAR
6CCCC 2020-STAR A6CCC 2020-STAR
7CCCC 2020-STAR A7CCC 2020-STAR
8CCCC 2020-STAR A8CCC 2020-STAR
9CCCC 2020-STAR A9CCC 2020-STAR
10CCCC 2020-STAR A10CCC 2020-STAR
11CCCC 2020-STAR A11CCC 2020-STAR
12CCCC 2020-STAR A12CCC 2020-STAR
13CCCC 2020-STAR A13CCC 2020-STAR
Sheet1
Cell Formulas
RangeFormula
B1:B13B1=MID(A1,2,SEARCH(">",SUBSTITUTE(TRIM(A1)," ",">",2))-2)
 
Upvote 0
with Power Query
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    TBD = Table.TransformColumns(Source, {{"Raw", each Text.BeforeDelimiter(_, " ", {0, RelativePosition.FromEnd}), type text}})
in
    TBD
RawRaw
CCCC 2020-STAR A1CCCC 2020-STAR
 
Upvote 0
Try this,
Book1
AB
1CCCC 2020-STAR A1CCC 2020-STAR
2CCCC 2020-STAR A2CCC 2020-STAR
3CCCC 2020-STAR A3CCC 2020-STAR
4CCCC 2020-STAR A4CCC 2020-STAR
5CCCC 2020-STAR A5CCC 2020-STAR
6CCCC 2020-STAR A6CCC 2020-STAR
7CCCC 2020-STAR A7CCC 2020-STAR
8CCCC 2020-STAR A8CCC 2020-STAR
9CCCC 2020-STAR A9CCC 2020-STAR
10CCCC 2020-STAR A10CCC 2020-STAR
11CCCC 2020-STAR A11CCC 2020-STAR
12CCCC 2020-STAR A12CCC 2020-STAR
13CCCC 2020-STAR A13CCC 2020-STAR
Sheet1
Cell Formulas
RangeFormula
B1:B13B1=MID(A1,2,SEARCH(">",SUBSTITUTE(TRIM(A1)," ",">",2))-2)
Try this,
Book1
AB
1CCCC 2020-STAR A1CCC 2020-STAR
2CCCC 2020-STAR A2CCC 2020-STAR
3CCCC 2020-STAR A3CCC 2020-STAR
4CCCC 2020-STAR A4CCC 2020-STAR
5CCCC 2020-STAR A5CCC 2020-STAR
6CCCC 2020-STAR A6CCC 2020-STAR
7CCCC 2020-STAR A7CCC 2020-STAR
8CCCC 2020-STAR A8CCC 2020-STAR
9CCCC 2020-STAR A9CCC 2020-STAR
10CCCC 2020-STAR A10CCC 2020-STAR
11CCCC 2020-STAR A11CCC 2020-STAR
12CCCC 2020-STAR A12CCC 2020-STAR
13CCCC 2020-STAR A13CCC 2020-STAR
Sheet1
Cell Formulas
RangeFormula
B1:B13B1=MID(A1,2,SEARCH(">",SUBSTITUTE(TRIM(A1)," ",">",2))-2)


Thank you
 
Upvote 0

Forum statistics

Threads
1,215,214
Messages
6,123,665
Members
449,114
Latest member
aides

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