Extract and be able to sort from a text string

-emma-

Board Regular
Joined
Jul 14, 2006
Messages
180
Office Version
  1. 365
Platform
  1. Windows
Hi everyone,

Silly work and out dated systems have been causing me problems all day! We have a system that information is extracted from and the results are as below...

JohnSmith	Feb 22, '20 23:09	France	Manhattan	Offline	Verified
MR_Armstrong	Feb 09, '20 20:27	England	Brooklyn	Offline	Verified

What I need to be able to do is put this in some sort of manageable table. So I can filter, sort, extract etc. I've tried and managed to get some parts working, all be it messy, but the date is the thing that is stumping me the most. I can only ever get it to sort in Alpha order, no matter how I seem to format the cell.

Ideally, I would like to dump all the information in Tab 1 and Tab 2 spits out a pretty result.
Example of Tab 1 would be A2-A999 a dump of info as above
Example of Tab 2 would have headings of Name (A1), Date (B1), Location (C1) and Final Destination (D1) and the results in rows 2-999 extracted from Tab 1 data. (The rest of the information is not needed)

Please remember that I need to be able to sort on all things, especially Date.

Any help on this would be great.

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.
Not sure this is the most efficient, but I think it does what you want:

Cell Formulas
RangeFormula
A2:A3A2=SUBSTITUTE(SUBSTITUTE(Sheet1!A2,"&#9",""),"'","20")
B2:B3B2=LEFT(A2,FIND(";",A2)-1)
C2:C3C2=--MID(A2,FIND(";",A2)+1,(FIND(";",A2,1+FIND(";",A2)))-FIND(";",A2)-1)
D2:D3D2=MID(A2,FIND(CHAR(160),SUBSTITUTE(A2,";",CHAR(160),2))+1,FIND(CHAR(160),SUBSTITUTE(A2,";",CHAR(160),3))-FIND(CHAR(160),SUBSTITUTE(A2,";",CHAR(160),2))-1)
E2:E3E2=MID(A2,FIND(CHAR(160),SUBSTITUTE(A2,";",CHAR(160),3))+1,FIND(CHAR(160),SUBSTITUTE(A2,";",CHAR(160),4))-FIND(CHAR(160),SUBSTITUTE(A2,";",CHAR(160),3))-1)
 
Upvote 0
Here another option for you to consider.
In columns B to E the same formula and in column H the formula for the date.

Dante Amor
ABCDEF
1TEXTNAMEDATE AND TIMELOCATIONDESTINATIONDATE
2JohnSmith	Feb 22, '20 23:09	France	Manhattan	Offline	VerifiedJohnSmithFeb 22, '20 23:09FranceManhattan22/02/2020
3MR_Armstrong	Feb 09, '20 20:27	England	Brooklyn	Offline	VerifiedMR_ArmstrongFeb 09, '20 20:27EnglandBrooklyn09/02/2020
s3
Cell Formulas
RangeFormula
B2:E3B2=TRIM(MID(SUBSTITUTE($A2,"	",REPT(" ",99)),((COLUMNS($B2:B2)-1)*99)+1,99))
F2:F3F2=(MID(C2,5,2)&"/"&LEFT(C2,3)&"/20"&MID(C2,10,2))+0
 
Upvote 0
This works great, apart from Column C. I get #VALUE as a response :confused:
 
Upvote 0
Not sure this is the most efficient, but I think it does what you want:

Cell Formulas
RangeFormula
A2:A3A2=SUBSTITUTE(SUBSTITUTE(Sheet1!A2,"&#9",""),"'","20")
B2:B3B2=LEFT(A2,FIND(";",A2)-1)
C2:C3C2=--MID(A2,FIND(";",A2)+1,(FIND(";",A2,1+FIND(";",A2)))-FIND(";",A2)-1)
D2:D3D2=MID(A2,FIND(CHAR(160),SUBSTITUTE(A2,";",CHAR(160),2))+1,FIND(CHAR(160),SUBSTITUTE(A2,";",CHAR(160),3))-FIND(CHAR(160),SUBSTITUTE(A2,";",CHAR(160),2))-1)
E2:E3E2=MID(A2,FIND(CHAR(160),SUBSTITUTE(A2,";",CHAR(160),3))+1,FIND(CHAR(160),SUBSTITUTE(A2,";",CHAR(160),4))-FIND(CHAR(160),SUBSTITUTE(A2,";",CHAR(160),3))-1)
This works great, apart from Column C. I get #VALUE as a response :confused:
 
Upvote 0
Here another option for you to consider.
In columns B to E the same formula and in column H the formula for the date.

Dante Amor
ABCDEF
1TEXTNAMEDATE AND TIMELOCATIONDESTINATIONDATE
2JohnSmith	Feb 22, '20 23:09	France	Manhattan	Offline	VerifiedJohnSmithFeb 22, '20 23:09FranceManhattan22/02/2020
3MR_Armstrong	Feb 09, '20 20:27	England	Brooklyn	Offline	VerifiedMR_ArmstrongFeb 09, '20 20:27EnglandBrooklyn09/02/2020
s3
Cell Formulas
RangeFormula
B2:E3B2=TRIM(MID(SUBSTITUTE($A2,"	",REPT(" ",99)),((COLUMNS($B2:B2)-1)*99)+1,99))
F2:F3F2=(MID(C2,5,2)&"/"&LEFT(C2,3)&"/20"&MID(C2,10,2))+0
This is ideal! But I need the Date section to include time. Sorry, I know I'm being a pain! Is it a quick fix? Or am I formatting the cell incorrectly?
 
Upvote 0
I formatted my column C and you can use Dante's with the right formatting as well.
 
Upvote 0
But I need the Date section to include time

Change the formula in cell F2 to this and format cell to : dd/mm/yyyy hh:mm

=(MID(C2,5,2)&"/"&LEFT(C2,3)&"/20"&MID(C2,10,2) & " " & RIGHT(C2,5))+0
 
Upvote 0
Another slight variation to consider.
Each formula copied down.
Format the Date/Time column with whatever format you want.

20 02 28.xlsm
ABCDE
1DataNameDate/TimeLocationDestination
2JohnSmith	Feb 22, '20 23:09	France	Manhattan	Offline	VerifiedJohnSmith22-Feb-20 23:09FranceManhattan
3MR_Armstrong	Feb 09, '20 20:27	England	Brooklyn	Offline	VerifiedMR_Armstrong09-Feb-20 20:27EnglandBrooklyn
Split Text
Cell Formulas
RangeFormula
B2:B3B2=LEFT(A2,FIND("&",A2)-1)
C2:C3C2=DATEVALUE(SUBSTITUTE(MID(A2,FIND(" ",A2),8),", '",MID(A2,FIND(";",A2)+1,3)))+MID(A2,FIND("'",A2)+4,5)
D2:D3D2=TRIM(MID(SUBSTITUTE(A2,"	",REPT(" ",100)),200,100))
E2:E3E2=TRIM(MID(SUBSTITUTE(A2,"	",REPT(" ",100)),300,100))
 
Upvote 0
another option with Power Query
NameDateTimeLocDest
JohnSmithFeb 22, '20 23:09FranceManhattan
MR_ArmstrongFeb 09, '20 20:27EnglandBrooklyn

Rich (BB code):
// Table1
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    BF = Table.AddColumn(Source, "Name", each Text.BeforeDelimiter([TEXT], " "), type text),
    BT1 = Table.AddColumn(BF, "DateTime", each Text.BetweenDelimiters([TEXT], " ", " ", 0, 3), type text),
    BT2 = Table.AddColumn(BT1, "Loc", each Text.BetweenDelimiters([TEXT], " ", " ", 4, 0), type text),
    BT3 = Table.AddColumn(BT2, "Dest", each Text.BetweenDelimiters([TEXT], " ", " ", 5, 0), type text),
    TSC = Table.SelectColumns(BT3,{"Name", "DateTime", "Loc", "Dest"})
in
    TSC
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,744
Members
448,989
Latest member
mariah3

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