Extract Data

Rubber Beaked Woodpecker

Board Regular
Joined
Aug 30, 2015
Messages
203
Office Version
  1. 2021
In cell A1 I have the following data

14:152 Orange6 Blue7 Green10 Black

Is there a formula or code I could use that extracts only the data I require and insert it into the range A10:A13 as follows;

A10: Orange
A11: Blue
A12: Green
A13: Black

Many thanks
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
This might work. It strips out anything that's not letters - except for a few characters - but that could be tidied up with an even longer formula. It should work in 2016.

MrExcelPlayground20.xlsx
A
1014:152 Orange6 Blue7 Green10 Black
11
12
13Orange
14Blue
15Green
16Black
Sheet28
Cell Formulas
RangeFormula
A13:A16A13=(FILTERXML("<t><s>"&SUBSTITUTE(TRIM(CONCAT(CHAR(IF((CODE(MID(A10,ROW(INDIRECT("1:"&LEN(A10))),1))<65)+(CODE(MID(A10,ROW(INDIRECT("1:"&LEN(A10))),1))>122),"32",CODE(MID(A10,ROW(INDIRECT("1:"&LEN(A10))),1))))))," ","</s><s>")&"</s></t>","//s"))
Dynamic array formulas.
 
Upvote 0
Here is another way to do this with a formula (formula in A10)...not very elegant, but with an older version of Excel, your options are more limited. You could do this with VBA or a user-defined function. Alternatively, if you have access to Excel 365, some other functions are available to make this more convenient (formula in A3). In pre-Excel 365, the A10 formula will need to be entered with Ctrl-Shift-Enter to confirm it as an array function, and the formula pulled down through cell A13.
MrExcel_20240107 (version 1).xlsx
A
114:152 Orange6 Blue7 Green10 Black
2
3Orange
4Blue
5Green
6Black
7
8
9
10Orange
11Blue
12Green
13Black
Sheet7
Cell Formulas
RangeFormula
A3:A6A3=LET(tt,TEXTAFTER(A1," "),TEXTSPLIT(TEXTJOIN("",TRUE,IF(ISERROR(MID(tt,SEQUENCE(LEN(tt)),1)*1),MID(tt,SEQUENCE(LEN(tt)),1),"")),," "))
A10:A13A10=FILTERXML( "<t><s>"& SUBSTITUTE( TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE($A$1, "0",""),"1",""),"2",""),"3",""),"4",""),"5",""),"6",""),"7",""),"8",""),"9",""),":","")), " ", "</s><s>" ) &"</s></t>", "//s" )
Dynamic array formulas.
 
Upvote 0
And yet one more solution.

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(Source, {{"Column1", Splitter.SplitTextByDelimiter(" ", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Column1"),
    #"Split Column by Character Transition" = Table.SplitColumn(#"Split Column by Delimiter", "Column1", Splitter.SplitTextByCharacterTransition((c) => not List.Contains({"0".."9"}, c), {"0".."9"}), {"Column1.1", "Column1.2"}),
    #"Filtered Rows" = Table.SelectRows(#"Split Column by Character Transition", each ([Column1.1] <> "14:")),
    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Column1.2"})
in
    #"Removed Columns"

Book4
A
1Column1
214:152 Orange6 Blue7 Green10 Black
3
4
5
6
7
8
9
10Column1.1
11Orange
12Blue
13Green
14Black
Sheet1
 
Upvote 0

Forum statistics

Threads
1,215,170
Messages
6,123,416
Members
449,099
Latest member
COOT

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