Extracting from multiple lines of text in one cell.

mrcrabby

New Member
Joined
Jan 8, 2018
Messages
3
Hi this is my data in one cell contains.

Appointment Details
Provider:Roy
Service: SUPER
Customer Details:
Name: JOE
Phone: 07912345678
Email: blabla@blablabla.com
Address: 1600 Amphitheatre Parkway in Mountain View, Santa Clara County, California, United States

I need to take each of these points from this one cell and put it into individual cells under my headers in Excel.

Headers in Excel.
A1 Provider
B1 Service
C1 Name
D1 Phone
E1 Email
F1 Address
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
It's awkward as we need to miss out the 2 headers (Appointment details and customer details). Are these 2 items always the 1st line and the 4th line as in your example?

If not will they always be "Appointment Details" and "Customer Details" with no chance of spelling error?

It's easy to split the string but the difficult part is only getting the items you want every time...
 
Upvote 0
Hi, welcome to the forum!

Here is one option, the formula in A2 can be copied across to the other cells.


Excel 2013/2016
ABCDEFGH
1ProviderServiceNamePhoneEmailAddressText
2RoySUPERJOE07912345678blabla@blablabla.com1600 Amphitheatre Parkway in Mountain View, Santa Clara County, California, United StatesAppointment Details Provider:Roy Service: SUPER Customer Details: Name: JOE Phone: 07912345678 Email: [EMAIL="blabla@blablabla.com"]blabla@blablabla.com[/EMAIL] Address: 1600 Amphitheatre Parkway in Mountain View, Santa Clara County, California, United States
Sheet1
Cell Formulas
RangeFormula
A2=TRIM(LEFT(SUBSTITUTE(MID($H2,FIND(A1&":",$H2)+LEN(A1)+1,LEN($H2)),CHAR(10),REPT(" ",LEN($H2))),LEN($H2)))
 
Upvote 0
Well that's a much better way than the VBA solution i was sorting. :rolleyes:
 
Upvote 0
Hi, welcome to the forum!

Here is one option, the formula in A2 can be copied across to the other cells.

Excel 2013/2016
ABCDEFGH
1ProviderServiceNamePhoneEmailAddressText
2RoySUPERJOE07912345678blabla@blablabla.com1600 Amphitheatre Parkway in Mountain View, Santa Clara County, California, United States
Appointment Details
Provider:Roy
Service: SUPER
Customer Details:
Name: JOE
Phone: 07912345678
Email: blabla@blablabla.com
Address: 1600 Amphitheatre Parkway in Mountain View, Santa Clara County, California, United States

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
A2=TRIM(LEFT(SUBSTITUTE(MID($H2,FIND(A1&":",$H2)+LEN(A1)+1,LEN($H2)),CHAR(10),REPT(" ",LEN($H2))),LEN($H2)))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>


Fantastic, thank you very much.
 
Upvote 0

Forum statistics

Threads
1,214,660
Messages
6,120,787
Members
448,994
Latest member
rohitsomani

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