Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
sra
 
Posts: n/a
Default How do I remove multiple line feed(s) or carriage return(s)?

I have carriage returns in a column as follows:

address1 CR city CR state CR zip

--and--

address1 CR address2 CR city CR state CR zip

I need the city, state and zip to end up in the same column.

Can you help?

Thanks.

sra
Excel 2003




--

  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

You mean you want the city in its own column, the state in its own column and
the zip in its own column?

And your data always has 3 or 4 CR in the cell?

If yes, then (assuming the data is in A1:Axxx), then put this in B1:

=IF(LEN(A1)-LEN(SUBSTITUTE(A1,CHAR(10),""))=3,"dummystring"&CH AR(10),"")&A1
(and drag down)

It just looks for the number of CR's in the cell. If there's only 3, it
prefixes the string with a dummystring.

Now everything in column B has 4 CRs.

Select Column B
edit|copy
Edit|paste special|values

Now column B is values and you can use Data|Text to columns to separate the data
into each column.

Data|Text to columns
Delimited
Choose Other
type ctrl-j in that Other box

And finish up.

You could even clean up column C (edit|replace dummystring with nothing).

sra wrote:

I have carriage returns in a column as follows:

address1 CR city CR state CR zip

--and--

address1 CR address2 CR city CR state CR zip

I need the city, state and zip to end up in the same column.

Can you help?

Thanks.

sra
Excel 2003

--


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I do a find and replace for a cell that has multiple line. yrat Excel Discussion (Misc queries) 1 April 19th 05 03:48 PM
How do I remove repeating line in Excell - Top line on each page.. keepon Excel Worksheet Functions 1 March 23rd 05 11:26 PM
How to remove an extra line added by excel when pasting into notep CoolGuy Excel Discussion (Misc queries) 1 March 2nd 05 02:57 PM
How do I automatically remove carriage returns in Excel? Mike O. Excel Discussion (Misc queries) 4 February 18th 05 11:24 PM
Find/Replace carriage return & line feed characters in Excel. Mary Cullen Excel Worksheet Functions 1 January 4th 05 07:39 PM


All times are GMT +1. The time now is 03:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"