You've just opened a CRM export and the data looks fine until a lookup fails, a filter misses a record, or a route importer turns one address into multiple stops. The culprit is often an invisible line break embedded in a Notes, address, or remarks field. If you clean it once with a mouse click, the same problem returns with the next CSV.
For recurring sales operations work, Excel remove line breaks is best treated as a data-pipeline task. The right method depends on the source character, the separator your downstream system needs, and whether you're cleaning one range or a file that arrives every week. Below are seven practical methods, from Find and Replace to formulas, dynamic arrays, Power Query, VBA, and field-level decisions for route imports.
Why Line Breaks Show Up in Your Spreadsheets
Line breaks usually enter a workbook through otherwise normal business activity. A CSV exported from a CRM such as 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.
Excel commonly handles an in-cell line break as the line-feed character CHAR(10). Microsoft documents Alt+Enter as the keyboard method for inserting a line break inside a cell, which is why cleanup formulas generally target CHAR(10) with SUBSTITUTE or use Find and Replace workflows. Microsoft's Excel guidance on inserting line breaks confirms the user action that creates the character you need to remove.
Three characters deserve attention:
- CHAR(10): The line-feed character commonly found in Windows workbook content and also encountered in Mac workflows.
- CHAR(13): The carriage-return character found in legacy Mac data and some CSV or system exports.
- CHAR(160): A non-breaking space that can look like an ordinary space while resisting normal cleanup.
Mobile-app exports and Garmin or 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.
The fastest built-in cleanup
Find and Replace is still useful for a one-off range. It changes the selected values directly, so scope matters.
- Select the target range. Don't select the whole 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 completely, or enter a space, comma, or pipe if downstream filtering needs a separator.
- Click Replace All and compare the dialog count with the selected rows.

Pressing Ctrl+J catches line feeds, not every possible return character. Legacy Mac exports may require a second pass for CHAR(13), or a formula that handles both characters. The historical Ctrl+H and Ctrl+J workaround remains widely documented, including examples using SUBSTITUTE(A1,CHAR(10),"") and nested replacements for CHAR(13) and CHAR(10) in imported data. Ablebits' guide to removing carriage returns in Excel provides those patterns and explains why CRM exports, addresses, and survey fields often need this treatment.
The result is immediate. VLOOKUPs, pivot tables, filters, and CSV exports can work with the cleaned values without adding formula columns that increase workbook complexity. Use this method when the file is static and you've verified the replacement choice. You won't need all seven methods. Pick one method per column based on how that column is consumed.
Choosing Between SUBSTITUTE TRIM and CLEAN
These three functions solve different problems. Stacking them without understanding their scope can either leave characters behind or merge words that should remain separate.
SUBSTITUTE gives you precise control:
=SUBSTITUTE(A2,CHAR(10)," ")
It directly targets CHAR(10) and replaces it with a chosen value, such as a space, comma, or pipe. It can also be nested to handle CHAR(13).
TRIM is a finishing function, not a line-break remover. It normalizes regular spaces, including interior runs of the standard space character CHAR(32), but it doesn't remove CHAR(10) or CHAR(13). CLEAN removes non-printable ASCII control characters, including line feeds and carriage returns, but it deletes them rather than inserting a separator. The Excel CLEAN function reference explains why that matters when separate words sit on opposite sides of a break.
| Formula | Handles CHAR(10) | Handles CHAR(13) | Handles CHAR(160) | Side effect |
|---|
SUBSTITUTE(A2,CHAR(10)," ") | Yes, when targeted | No, unless nested | No, unless targeted | Preserves control over the replacement |
TRIM(A2) | No | No | No | Normalizes regular spaces only |
CLEAN(A2) | Yes | Yes | No | Deletes control characters and may merge words |
My decision rule is simple. Use SUBSTITUTE when the replacement needs to be deliberate, use CLEAN for pure stripping, and finish with TRIM when the result may contain uneven spaces:
=TRIM(SUBSTITUTE(SUBSTITUTE(A2,CHAR(13)," "),CHAR(10)," "))
If imported text still contains invisible characters after formula cleanup, clean up AI text with Simple Unmark can help inspect and remove hidden formatting before the text returns to Excel.
Microsoft 365 and Excel 2021 let you split or recombine line breaks without creating helper columns. The output spills into neighboring cells, while the source remains untouched and updates when the imported data changes.
To place each line in its own column, use:
=TEXTSPLIT(A1,CHAR(10))
For data that includes carriage-return wrappers, normalize the return first, then split:
=TEXTSPLIT(SUBSTITUTE(A1,CHAR(13),""),CHAR(10))
To collapse multiple lines into one space-delimited value, use:
=TEXTJOIN(" ",TRUE,TEXTSPLIT(A1,CHAR(10)))
That preserves word boundaries instead of smashing the text together. If you need every split piece with no separator, CONCAT can recombine the returned array, though that choice is appropriate only when the break itself carries no meaningful separation.
Dynamic arrays are particularly useful when a CSV lands in a staging sheet and you want a live cleaned output beside it. The source remains available for audit, while downstream formulas reference the transformed column.
Practical rule: Use TEXTSPLIT to expose structure, and TEXTJOIN to deliberately collapse structure.
One gotcha can stop the formula immediately. TEXTSPLIT returns #SPILL! when merged cells block the output range. Unmerge the target area and make sure neighboring cells are empty before diagnosing the formula itself. Older Microsoft 365 builds may also require a different fallback, such as FILTERXML, for certain split-and-recombine workflows.
Cleaning an Entire Table With Power Query
Power Query is the better choice when the same dirty file arrives repeatedly. Instead of editing every import, record the transformation once and refresh it against the next CSV.
Start with Data > From Table/Range. In the Power Query editor, duplicate the column if you need to preserve the original value for auditing. Select the duplicate, choose Split Column > By Delimiter, click in the delimiter field, and press Ctrl+J. Power Query maps that input to the line-feed character.

Choose Split into Rows when each line represents a separate record, such as a multi-line list that needs normalization. Choose Split into Columns when each line represents a consistent field and you want a wide table. After splitting, select the resulting columns and use Merge Columns, choosing a space or comma as the delimiter.
This approach works well alongside a documented storage process. Teams that repeatedly move exports between workbooks and operational systems can also review OnRoute's cloud storage guidance when deciding where source files and cleaned outputs should live.
Because Power Query records each transformation, next week's CSV can pass through the same steps without another manual Find and Replace. Finish with Close & Load To and choose a worksheet or the Data Model. The query handles line-feed and carriage-return variations inside the transformation process, which removes much of the Windows-versus-Mac uncertainty that causes one-off formulas to fail.
The important operational decision is whether to split or collapse. Splitting creates structure for analysis. Merging creates a single export-safe field. Don't merge first if you still need to distinguish address components, note categories, or separate entries.
A VBA Macro for Bulk Cleanup
A macro is useful when the source data is static, the workbook is large, or a repeated cleanup needs to run from Personal.xlsb. It overwrites selected values, so save a backup or write the output to a new column before running it.
Open the VBA editor with Alt+F11, insert a new module, and paste:
`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'
Select the target range in Excel and run RemoveLineBreaks. The loop replaces both CHAR(10) and CHAR(13) with a single space, then collapses excess regular spaces.
The macro is intentionally narrow. It works on the selection rather than changing every worksheet, which is safer for operational files containing formulas, notes, and mixed data types. If you need to process every sheet, wrap the same cell loop inside a For Each ws In Worksheets pass, but test that version on a copy first.
Macros beat formulas when you need an in-place result and don't need the original text preserved in the working sheet. Formulas are usually better when the import is refreshed, because they leave the raw data intact and make the transformation visible to other analysts. Either way, document whether the replacement is a space, comma, or nothing. That choice affects every system receiving the export.
Cleaning Address and Notes Fields for Route Imports
A route import exposes the difference between removing a character and preserving meaning. Consider an address stored as:
123 Main St
Apt 4B
Deleting the break produces 123 Main StApt 4B, which can damage geocoding. Replacing it with a space creates 123 Main St Apt 4B, while a comma and space creates 123 Main St, Apt 4B. The correct choice depends on how the receiving parser interprets address text.
Route planning platforms such as Routific and OptimoRoute may treat each line in an address field as a separate stop unless the import process handles multiline values explicitly. Dispatcher notes have the same risk. A hard break between a customer name and an instruction may look readable in Excel but become multiple rows after export.
A field-level decision process
Start by auditing the column rather than applying one global cleanup rule:
- Detect the character: Use
FILTER and LEN to isolate suspicious rows, then inspect whether the content contains CHAR(10) or CHAR(13).
- Use a literal space for plain text: Find and Replace with Ctrl+J works when the goal is to make a value single-line.
- Preserve structured pieces: Use
TEXTSPLIT in helper columns, then rebuild with TEXTJOIN and a comma-space delimiter.
For an address, a practical formula is:
=TEXTJOIN(", ",TRUE,TEXTSPLIT(SUBSTITUTE(A2,CHAR(13),""),CHAR(10)))
The resulting cell stays on one line while retaining a visible separator between components. For reliable field mapping, separate the address and instructions into their own columns before export. The OnRoute route management software overview is useful context for teams designing a field workflow around route data rather than treating the spreadsheet as the final destination.
Don't strip breaks blindly from a column that mixes addresses, notes, and identifiers. The right replacement is a schema decision, not a formatting preference.
Cross-platform files fail when the cleanup assumes every line break has the same encoding. Windows commonly produces a carriage return plus line feed, while macOS may use a line feed alone. Older CSV exports can contain a carriage return by itself, so Ctrl+J isn't a universal detector.
For a reusable diagnostic, count line feeds in a cell with:
=SUMPRODUCT(--(CODE(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1))=10))
Replace 10 with 13 to count carriage returns. This is more useful than visually inspecting a cell because the characters remain invisible even when Wrap Text makes the content appear orderly.
| Source | Break characters | Formula to remove | Formula to replace with space |
|---|
| Windows workbook content | CHAR(10) or CHAR(13)+CHAR(10) | =SUBSTITUTE(SUBSTITUTE(A1,CHAR(13),""),CHAR(10),"") | =SUBSTITUTE(SUBSTITUTE(A1,CHAR(13)," "),CHAR(10)," ") |
| macOS content | CHAR(10) | =SUBSTITUTE(A1,CHAR(10),"") | =SUBSTITUTE(A1,CHAR(10)," ") |
| Legacy or system CSV | CHAR(13) | =SUBSTITUTE(A1,CHAR(13),"") | =SUBSTITUTE(A1,CHAR(13)," ") |
The removal formula can smash words together, so use the space version when the former lines represent separate tokens. Add TRIM after the replacement when imported values contain extra regular spaces. CHAR(160) needs its own SUBSTITUTE, because it behaves like a non-breaking space rather than a normal space.
Power Query avoids dependence on the keyboard. Use Table.ReplaceValue with the line feed entered directly in the replacement workflow, then apply the same query on either operating system. Before handing off the file, confirm the source platform, target platform, desired separator, and a sample LEN comparison. Teams building repeatable call-log workflows can also use the Excel call log template resource as a reference for keeping operational fields separate.
Your final checklist is short:
- Source: Identify whether the file came from Windows, macOS, a CRM, or a legacy export.
- Character: Test for both
CHAR(10) and CHAR(13) when the source is uncertain.
- Separator: Decide between a space, comma, semicolon, pipe, or nothing.
- Destination: Check the requirements of the lookup, CSV, route importer, or reporting model.
- Validation: Compare cleaned and original lengths on sample rows before production use.
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.