CLEAN function

This article describes the formula syntax and usage of the CLEAN function in Microsoft Excel.

Description

Removes all nonprintable characters from text. Use CLEAN on text imported from other applications that contains characters that may not print with your operating system. For example, you can use CLEAN to remove some low-level computer code that is frequently at the beginning and end of data files and cannot be printed.

Important   The CLEAN function was designed to remove the first 32 nonprinting characters in the 7-bit ASCII code (values 0 through 31) from text. In the Unicode character set, there are additional nonprinting characters (values 127, 129, 141, 143, 144, and 157). By itself, the CLEAN function does not remove these additional nonprinting characters. For an example of how to remove these additional nonprinting characters from text, see Remove spaces and nonprinting characters from text.

Syntax

CLEAN(text)

The CLEAN function syntax has the following arguments:

  • Text    Required. Any worksheet information from which you want to remove nonprintable characters.

Example

Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust the column widths to see all the data.

Data

=CHAR(9)&"Monthly report"&CHAR(10)

Formula

Description

Result

=CLEAN(A2)

Removes the nonprintable characters CHAR(9) and CHAR(10) from the text string in cell A2.

Monthly report

Applies To: Excel Starter, Excel 2016 for Mac, Excel 2010, Excel 2013, Excel 2016 Preview, Excel for Mac 2011, Excel Online, Excel 2007



Was this information helpful?

Yes No

How can we improve it?

255 characters remaining

To protect your privacy, please do not include contact information in your feedback. Review our privacy policy.

Thank you for your feedback!

Support resources

Change language