How to combine multiple lines contained within once cell into one actual line of text

Woody Pecker

New Member
Joined
Apr 11, 2008
Messages
35
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I have information which I need to import from an external company, but when we receive it sometimes there are text contents within a single cell which appear on separate line (shown in the attached picture).

I need a formula that will concatenate this information onto one single line of text, so in this example "COLLECTION. 0 758 207 1156 - CALL BEFORE NO HGV USE SMALLER 25/5/2020" is required.

Regretfully I'm not up to speed on VBA, so formula would be better.

Capture.PNG
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Just select the column affected, Ctrl H then In the find what type Ctrl J then in the replace box put a space, make sure that "Match entire cell" is not checked & replace all.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
@Fluff regretfully I am still having some issues with my spreadsheet. I just couldn't get the Ctrl H Ctrl J method to work enough due to volume of instances within the sheet.

Someone suggested using the following formula, which certainly sorts out the criteria I needed for checking aspects of the text contained within that line of text:-

=SUBSTITUTE(IF('Paste Here'!K2="","",'Paste Here'!K2),CHAR(10)," ")

However, when I come to save the Excel spreadsheet down in CSV format, the single line alignment reverts back to the carriage return format.

Any ideas?
 
Upvote 0
A csv file is a form of text file & as such does not hold formatting or formulae.
You will either have to save as an Excel file, or copy paste the formulae as values.
 
Upvote 0

Forum statistics

Threads
1,214,919
Messages
6,122,259
Members
449,075
Latest member
staticfluids

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