Function Problems

Remove Quotes and Line Breaks from Excel Text

John WilsonJohn Wilson Dec 2, 2026 869 views

Question details

Remove unwanted quotation marks and line breaks from imported Excel text so values can be compared reliably.

Remove Quotes and Line Breaks from Excel Text
Product
Microsoft Excel
Device & OS
not provided
Scenario
Text imported from another file needs to be cleaned before matching or comparison.
Observed behavior
Hidden quotation marks or line breaks may prevent text values from matching as expected.
Before you start

Identify the cells containing imported text and check whether double quotes and line breaks should be removed or replaced with spaces. If you use a formula, leave an empty column next to the source data for the cleaned results.

Solution 1Recommended

Clean imported text with an Excel formula

Use a formula when you want to clean a column while keeping the original text unchanged.

1
Enter the cleanup formula

If the imported text is in D2, select an empty cell such as E2 and enter =TRIM(CLEAN(SUBSTITUTE(D2,CHAR(34),""))).

2
Fill the formula down

Select E2 and drag its fill handle down alongside the rows you want to clean.

3
Use the cleaned values

Compare the results in column E, or copy them and use Paste Special > Values if you need fixed text instead of formulas.

Clean imported text with an Excel formula
How the formula changes text: SUBSTITUTE removes straight double quotes, CLEAN removes line breaks and other basic nonprinting characters, and TRIM removes leading, trailing, and repeated ordinary spaces. Removing a line break can join the words on either side.
Clean imported spreadsheet text

Remove Quotes and Line Breaks in WPS Spreadsheet

Open your workbook in WPS Spreadsheet and use a cleanup formula to remove double quotes, line breaks, and extra ordinary spaces before comparing imported text.

  1. 1. Open the workbook: Open WPS Spreadsheet and use Open to select your Excel workbook.
  2. 2. Enter the formula: If the source text is in D2, select E2 and enter =TRIM(CLEAN(SUBSTITUTE(D2,CHAR(34),""))).
  3. 3. Fill down: Drag the fill handle from E2 down to clean the remaining imported rows.
  4. 4. Keep the results: Copy the cleaned cells and use Paste Special > Values if you need to replace formulas with fixed text.
Clean imported text with familiar spreadsheet functionsKeep source text intact while reviewing cleaned resultsWork with Microsoft Excel XLSX and XLS files
microsoft office alternative - wps office

Frequently Asked Questions

Why do imported Excel values look identical but fail to match?

They may contain double quotes, line breaks, or extra spaces. Try =TRIM(CLEAN(SUBSTITUTE(D2,CHAR(34),""))) in an empty cell, then compare the cleaned result.

Can I replace line breaks with spaces instead of deleting them?

Yes. For text in D2, use =TRIM(CLEAN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(D2,CHAR(34),""),CHAR(10)," "),CHAR(13)," "))) to replace line feeds and carriage returns with spaces before trimming.

How do I remove double quotes without a formula?

Select the cells and open Home > Find & Select > Replace. Enter a double quote in Find what, leave Replace with empty, and select Replace All.

Will the cleanup formula remove curly quotes or nonbreaking spaces?

No. CHAR(34) targets straight double quotes, and TRIM does not remove nonbreaking spaces. Use additional SUBSTITUTE functions for those specific characters if they are present.