Clean() Function

The Excel CLEAN function removes all non-printable characters from a supplied text string. The function is designed to remove the non-printable characters, represented by numbers 0 to 31 of the 7-bit ASCII code, which are often found at the start of data that has been imported into Excel from other applications.

Syntax

The syntax for the CLEAN function in Microsoft Excel is:

=CLEAN( text )

Parameters or Arguments

text

The value that has all nonprintable characters removed from.

Clean Function Examples

The following spreadsheet shows the Excel Clean function applied to four different text strings.

All four of the above examples give the same result, which is the string, “clean text”.

Clean vs. Trim Function

Note that the Clean function is similar to the Excel Trim Function. The two functions differ in that the Clean Function removes the non-printable characters, represented by the ASCII numerics codes 0 to 31, while the Trim function removes additional spaces (represented by the ASCII numeric code 32).

Excel Function Home

Text Functions