Extract String from cell with multiple strings and spaces

UltraRhino

New Member
Joined
Dec 11, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi, all of these lines are in 1 cell, separated by spaces. I just want the SC (So SC017, SC283, etc) from each of these lines with in the cell to be put on separate lines within a column.
Text to columns with Ctrl+J as the delimiter kind of does some of it, but is there an easier way?

I want it to be:
SC017
SC283
SC004
etc.

What is the best method to achieve this?


Acquisitions - Building Only - Asset Purchase (SC017)

Building Renovations (SC283)

Capital Maint - Elevators (SC004)

Capital Maint - Envelope (SC005)

Capital Maint - Fire/Security Protection (SC006)

Capital Maint - Grounds - Landscaping, campus signs, etc. (SC012)

Capital Maint - Mechanical, Electrical, Plumbing, HVAC, YSM's Standby Power (SC007)

Capital Maint - Other (SC008)

Capital Maint - Roof - Other (SC010)

Capital Maint - Roof - Slate, Copper (SC009)

Capital Maint - Windows (SC011)

Cap Utility - Gas Turbine Overhaul (SC013)

Cap Utility - ITS Fiber Cable (SC014)

Cap Utility - Steam Traps (SC015)

Cap Utility - Utility Systems & Distribution Channels (SC016)

Conversion Capital Maintenance (SC386)

Equipment on Capital Projects - Central Only (SC642)

Fixed Equipment - Installation &/or Associated Costs (SC020)

Fixed Equipment - Other - Asset Purchase (SC173)

Land Improvements: paving, moats, walls, grading, etc. (SC019)

New Construction - High Tech Labs (SC001)

New Construction - non-High-Tech Labs (SC039)

New Construction - Parking Decks (SC040)

Other - Leasehold Improvements (SC384)

Renovation - High Tech Labs Comprehensive (SC041)

Renovation - High Tech Labs Major (SC042)

Renovation - High Tech Labs Programmatic (SC043)

Renovation - non-High-Tech Lab Comprehensive (SC002)

Renovation - non-High-Tech Lab Programmatic (SC003)
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
RawETBD
Acquisitions - Building Only - Asset Purchase (SC017)SC017
Building Renovations (SC283)SC283
Capital Maint - Elevators (SC004)SC004
Capital Maint - Envelope (SC005)SC005
Capital Maint - Fire/Security Protection (SC006)SC006
Capital Maint - Grounds - Landscaping, campus signs, etc. (SC012)SC012
Capital Maint - Mechanical, Electrical, Plumbing, HVAC, YSM's Standby Power (SC007)SC007
Capital Maint - Other (SC008)SC008
Capital Maint - Roof - Other (SC010)SC010
Capital Maint - Roof - Slate, Copper (SC009)SC009
Capital Maint - Windows (SC011)SC011
Cap Utility - Gas Turbine Overhaul (SC013)SC013
Cap Utility - ITS Fiber Cable (SC014)SC014
Cap Utility - Steam Traps (SC015)SC015
Cap Utility - Utility Systems & Distribution Channels (SC016)SC016
Conversion Capital Maintenance (SC386)SC386
Equipment on Capital Projects - Central Only (SC642)SC642
Fixed Equipment - Installation &/or Associated Costs (SC020)SC020
Fixed Equipment - Other - Asset Purchase (SC173)SC173
Land Improvements: paving, moats, walls, grading, etc. (SC019)SC019
New Construction - High Tech Labs (SC001)SC001
New Construction - non-High-Tech Labs (SC039)SC039
New Construction - Parking Decks (SC040)SC040
Other - Leasehold Improvements (SC384)SC384
Renovation - High Tech Labs Comprehensive (SC041)SC041
Renovation - High Tech Labs Major (SC042)SC042
Renovation - High Tech Labs Programmatic (SC043)SC043
Renovation - non-High-Tech Lab Comprehensive (SC002)SC002
Renovation - non-High-Tech Lab Programmatic (SC003)SC003

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Filter = Table.SelectRows(Source, each ([Raw] <> null)),
    ETBD = Table.AddColumn(Filter, "ETBD", each Text.BetweenDelimiters([Raw], "(", ")"), type text)
in
    ETBD
 
Last edited:
Upvote 0
Solution
I'm not versed in Power Query, but will give it a shot after i try the excel formula below.

=MID(A1,FIND("(",A1)+1,FIND(")",A1)-FIND("(",A1)-1)

I put the data in A1, and the formula in A2. It will give me the first one (SC017), but how do i get the next one (SC283)? Do i paste the same formula in A3? or do you add to the formula?

Acquisitions - Building Only - Asset Purchase (SC017)

Building Renovations (SC283)

Capital Maint - Elevators (SC004)

Capital Maint - Envelope (SC005)

Capital Maint - Fire/Security Protection (SC006)

Capital Maint - Grounds - Landscaping, campus signs, etc. (SC012)

Capital Maint - Mechanical, Electrical, Plumbing, HVAC, YSM's Standby Power (SC007)

Capital Maint - Other (SC008)

Capital Maint - Roof - Other (SC010)

Capital Maint - Roof - Slate, Copper (SC009)

Capital Maint - Windows (SC011)

Cap Utility - Gas Turbine Overhaul (SC013)

Cap Utility - ITS Fiber Cable (SC014)

Cap Utility - Steam Traps (SC015)

Cap Utility - Utility Systems & Distribution Channels (SC016)

Conversion Capital Maintenance (SC386)

Equipment on Capital Projects - Central Only (SC642)

Fixed Equipment - Installation &/or Associated Costs (SC020)

Fixed Equipment - Other - Asset Purchase (SC173)

Land Improvements: paving, moats, walls, grading, etc. (SC019)

New Construction - High Tech Labs (SC001)

New Construction - non-High-Tech Labs (SC039)

New Construction - Parking Decks (SC040)

Other - Leasehold Improvements (SC384)

Renovation - High Tech Labs Comprehensive (SC041)

Renovation - High Tech Labs Major (SC042)

Renovation - High Tech Labs Programmatic (SC043)

Renovation - non-High-Tech Lab Comprehensive (SC002)

Renovation - non-High-Tech Lab Programmatic (SC003)
 
Upvote 0
Assuming your data starts in A1, place the formula in B1. With B1 selected, right click on the small, black rectangle at the bottom right of the cell and drag down until the last value in column A.
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,250
Members
452,623
Latest member
Techenthusiast

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