Excel Remove Line Breaks: 7 Ways to Clean Data
Clean data begins with removing in‑cell line breaks that break lookups and exports. This guide outlines seven practical methods—from quick Find & Replace to dynamic arrays, Power Query, and VBA—so you can choose the right approach for your data and workflow in 2026.
Why line breaks show up in spreadsheets
Invisible line breaks often enter a workbook during normal business activity. A CSV exported from a CRM like Salesforce or HubSpot may preserve embedded carriage returns inside a Notes field. A web‑scraped address column can retain breaks copied from HTML. Copying an email signature into a remarks cell may bring along soft breaks that aren’t obvious until a formula, filter, or export behaves strangely. 1 2
Excel typically treats an in‑cell line break as the line‑feed character CHAR(10). Alt+Enter is the keyboard shortcut for inserting a break inside a cell, which is why cleanup formulas often target CHAR(10) with SUBSTITUTE or use Find and Replace workflows. 1 2
Microsoft’s guidance on inserting a line break in a cell confirms the user action that creates the character you need to remove. [Microsoft Docs: Insert a line break in a cell](https://support.microsoft.com/en-us/excel/insert-a-line-break-in-a-cell).
Three characters deserve attention:
- CHAR(10): The line‑feed character found in Windows content and often in Mac workflows.
- CHAR(13): The carriage‑return character seen in legacy Mac data and some CSV exports.
- CHAR(160): A non‑breaking space that looks like a regular space but resists cleanup.
Mobile exports and route‑planning imports may reject these characters outright. That makes cleanup a practical requirement, not a cosmetic preference, when a field has to pass into another system. 3
The seven practical methods (from quick cleanup to repeatable pipelines)
1) The fastest built‑in cleanup: Find & Replace
Find & Replace is great for a one‑off range. It changes the selected values directly, so scope matters.
- Select the target range. Don’t select the entire sheet unless you intend to alter every matching cell. The operation is destructive, and a Paste Special Values workflow isn’t undoable indefinitely.
- Press Ctrl+H to open Find and Replace, then click inside the Find what box.
- Hold Ctrl and press J. The field appears empty, but Excel is now searching for
CHAR(10).
- Leave Replace with empty to remove the breaks, or substitute with a space, comma, or pipe if downstream filtering needs a separator.
- Click Replace All and compare the dialog count with the selected rows.

Ctrl+J catches line feeds, but some legacy Mac exports may require a second pass for CHAR(13) or a formula that handles both characters. See Ablebits’ guide to removing carriage returns in Excel for patterns you can reuse. 4
The immediate result: cleaned values that work with VLOOKUPs, pivot tables, and exports without extra formula columns. Use this method when the file is static and you’ve verified the replacement choice. Pick one method per column based on how that column is consumed.
2) SUBSTITUTE, TRIM, and CLEAN: when to use each
These functions solve different problems. Use SUBSTITUTE for precise control, then finish with TRIM to normalize spaces. CLEAN removes non‑printable characters but can delete separators that you want to preserve.
| Formula | Handles CHAR(10) | Handles CHAR(13) | Handles CHAR(160) | Side effect |
|---|---|---|---|---|
| SUBSTITUTE(A2,CHAR(10)," ") | Yes | No | No | Replaces with a space |
| TRIM(A2) | No | No | No | Normalizes spaces |
| CLEAN(A2) | Yes | Yes | No | Deletes control chars |
Practical rule: use SUBSTITUTE when you need deliberate replacements, CLEAN for stripping, and finish with TRIM when you might have extra spaces. Example:
=TRIM(SUBSTITUTE(SUBSTITUTE(A2,CHAR(13)," "),CHAR(10)," ")) 5
If imported text still contains invisible characters after cleanup, consider inspecting with a tool like Simple Unmark to verify there’s nothing hidden before the text returns to Excel.
Microsoft 365 and Excel 2021 let you split or recombine line breaks without extra helper columns. The output spills into neighboring cells while the source remains intact and updates with the imported data. 6
To place each line in its own column:
=TEXTSPLIT(A1,CHAR(10))
To handle carriage returns first, normalize then split:
=TEXTSPLIT(SUBSTITUTE(A1,CHAR(13),""),CHAR(10))
To collapse lines into a single, space‑delimited value:
=TEXTJOIN(" ",TRUE,TEXTSPLIT(A1,CHAR(10)))
Dynamic arrays are especially useful when a CSV lands in a staging sheet and you want a live cleaned output beside it.
Practical rule: Use TEXTSPLIT to expose structure, and TEXTJOIN to deliberately collapse structure. 7
One caveat: TEXTSPLIT can return #SPILL! if neighboring cells aren’t empty. Unmerge or clear the target area before diagnosing the formula. Some older Excel builds may require fallbacks like FILTERXML for certain split‑and‑recombine workflows.
4) Cleaning an Entire Table With Power Query
Power Query shines when the same dirty file arrives regularly. Record the transformation once and refresh against the next CSV. Start with Data > From Table/Range. In the Power Query editor, duplicate the column to preserve the original, then perform a Split Column > By Delimiter and press Ctrl+J to map the delimiter to a line feed. 8

Choose Split into Rows when each line represents a separate record; choose Split into Columns when each line represents a field. After splitting, Merge Columns with a space or comma as the delimiter. This approach pairs well with a documented storage process and is referenced by teams moving exports between workbooks and systems. 9
Power Query records each transformation, so the next CSV can pass through the same steps without re‑doing the work. Finish with Close & Load to a worksheet or data model. This method handles line‑feeds and carriage‑returns within the query, reducing cross‑platform friction.
5) A VBA Macro for Bulk Cleanup
A macro is useful when the source data is static, the workbook is large, or you want to run cleanup from a central place like Personal.xlsb. It overwrites selected values, so save a backup or write to a new column first.
Sub RemoveLineBreaks()
Dim cell As Range
For Each cell In Selection
If Not IsEmpty(cell) Then
cell.Value = Replace(Replace(cell.Value, Chr(10), " "), Chr(13), " ")
cell.Value = WorksheetFunction.Trim(cell.Value)
End If
Next cell
End Sub
Run RemoveLineBreaks on a selected range. The loop replaces both CHAR(10) and CHAR(13) with a space, then trims extra spaces. The macro is deliberately narrow to avoid changing formulas or non‑text data. If you need to process every sheet, wrap the loop in a For Each ws In Worksheets block and test on a copy first.
Formulas are often preferable when the import is refreshed, because they leave the raw data intact and make the transformation visible to others. Ensure your replacement choice (space, comma, or nothing) is documented for downstream systems.
6) Cleaning Address and Notes Fields for Route Imports
Route imports illustrate the difference between removing a character and preserving meaning. Consider an address stored as:
123 Main St
Apt 4B
Deleting the break yields 123 Main StApt 4B, which can break geocoding. Replacing with a space gives 123 Main St Apt 4B, while a comma and space yields 123 Main St, Apt 4B. The correct choice depends on how the downstream parser interprets the text. 10
Route planning platforms may treat each line as a separate stop unless the import process handles multiline values. Dispatcher notes can have the same risk. A hard break between a customer name and an instruction might look readable in Excel but become multiple rows after export.
Field‑level decision: audit columns before applying a global rule. Detect the character with FILTER and LEN, decide on a literal space for plain text, and consider TEXTSPLIT in helper columns before reassembling with TEXTJOIN and a delimiter. For addresses, separate components into their own columns before export to preserve mapping and clarity. OnRoute’s route management context helps frame a practical field workflow instead of treating the spreadsheet as the final destination. 11
Don’t strip breaks blindly from mixed columns. The right replacement is a schema decision, not a formatting preference.
Cross‑platform files fail when cleanup assumes the same encoding everywhere. Windows tends to use CHAR(13) + CHAR(10), while macOS may use CHAR(10) alone. Older CSVs can contain a lone CHAR(13). 12
Diagnostic quick check:
=SUMPRODUCT(--(CODE(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1))=10))
Count line feeds with 10 and carriage returns with 13. A dedicated cross‑platform workflow reduces surprises in production exports. 13
FAQs
Q: How can I remove line breaks quickly in Excel?
A: Use Find & Replace with Ctrl+J to target
CHAR(10), then replace with a space if needed. For mixed line endings, pair with a
SUBSTITUTE/
CLEAN approach.
1
Q: When should I use Power Query or a formula?
A: Use Power Query for repeatable, automated imports and when you want to preserve the raw data in a separate layer. Use formulas when you prefer a live, auditable transformation alongside the data in the same workbook.
8
Q: How do I handle multi‑line addresses for route imports?
A: Decide between keeping structure by splitting into columns or collapsing with a delimiter before export. Field‑level decisions prevent misinterpretations in downstream route planners.
10
OnRoute helps field sales and operations teams turn clean spreadsheet inputs into coordinated route execution with route planning, live GPS visibility, messaging, check‑ins, and operational reporting. If line‑break errors are creating duplicate stops or unreliable field data, visit OnRoute to see how the platform can support a more dependable workflow.