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

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
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
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
ProviderServiceNamePhoneEmailAddressText
SUPERJOE07912345678blabla@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>
[TD="align: center"]1[/TD]

[TD="align: right"][/TD]

[TD="align: center"]2[/TD]
[TD="bgcolor: #FFFF00"]Roy[/TD]

[TD="align: right"][/TD]

</tbody>
Sheet1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]A2[/TH]
[TD="align: left"]=TRIM(LEFT(SUBSTITUTE(MID($H2,FIND(A1&":",$H2)+LEN(A1)+1,LEN($H2)),CHAR(10),REPT(" ",LEN($H2))),LEN($H2)))[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]


Fantastic, thank you very much.
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,265
Members
452,627
Latest member
KitkatToby

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