Extracting data from multi-line entry

Kentman

Active Member
Joined
Apr 26, 2010
Messages
260
I have a workbook supplied by someone else which contains cell entries with multi-lines - can I extract these by line?
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Gerald the user has put name, address, postcode etc in a single cell but has used Alt>Enter to wrap line as in: Kentman Some address Some postcode
 
Upvote 0
I see.

I can't think of a neat way to do this.
Normally I would suggest something like Data, Text to Columns, possibly after doing Edit, Find and Replace, but I can't either of those work with the character that alt+enter is giving you, which is probably =CHAR(10).

What you COULD do, is a bit cumbersome, but something like this
Code:
=mid(a1,find(char(10),a1,1),100)
and repeat this (adapted as required) for each element within the address.

There is probably a neater way of doing this . . .
 
Upvote 0
Sorry Kentman, there is a MUCH easier solution, I should have thought of it before, try the CLEAN() function.
 
Upvote 0
Update:

The best way I've found of doing the extract is to use the SUBSTITUTE function to turn line feeds into characters, I use the pipe "|" as it is very seldom used in normal text: =SUBSTITUTE(A2,CHAR(10),"|") > copy and past your column with the delimited values to a text file > save the text file > open it in excel using the delimited option and select the pipe as the delimiter.

You can now copy the values back into your original sheet.
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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