Pasted data often carries hidden line breaks that wreck exports and lookups. SUBSTITUTE swaps the line-break character for a space, and CLEAN strips any other non-printable leftovers.
The example
Multi-line cell collapses to one clean line.
| A | B | |
|---|---|---|
| 1 | Raw | One line |
| 2 | 123 Main⏎Suite 5 | 123 Main Suite 5 |
The formula
The formula:
How it works
How it works:
CHAR(10)is the line-feed inserted by Alt+Enter;CHAR(13)is a carriage return some imports add.SUBSTITUTE(A2, CHAR(10), " ")replaces every line break with a space.- Wrap in
TRIMto collapse the double spaces that result, andCLEANto remove other non-printables. - To remove breaks entirely (no space), substitute with
""instead of a space.
CLEAN alone removes line breaks too — =CLEAN(A2) strips the first 32 non-printable characters, including CHAR(10) and CHAR(13). But it deletes them with no replacement, joining words together; use SUBSTITUTE with a space first if you need word separation, then CLEAN for the rest.
Try it: interactive demo
Text with line breaks (press Enter inside).
Variations
Remove entirely
No replacement space:
CLEAN everything
Strip all non-printables:
Both breaks
CR and LF:
Pitfalls & errors
Two break characters. Imports may use CHAR(13), CHAR(10), or both — substitute each to be safe.
CLEAN joins words. It deletes breaks with no space; SUBSTITUTE with a space keeps words apart.
TRIM the doubles. Replacing breaks with spaces can leave double spaces — wrap in TRIM.
Practice workbook
Frequently asked questions
How do I remove line breaks from a cell in Excel?
What's the difference between CLEAN and SUBSTITUTE here?
My data still has breaks after CHAR(10) — why?
Stop fighting formulas. Learn them in a day.
This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class