How to use the CLEAN function in Excel

In this article, we will learn how to use CLEAN Function in Excel. CLEAN function is a text function which removes the non printing characters and line spaces which are not acknowledged by Excel.

What are non printing characters?

There are 38 characters in Excel which cannot be used as text in the beginning and end of the text. Some are low-level computer code that are usually at the beginning and end of files and cannot be printed by Excel. 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 6 nonprinting characters (values 127, 129, 141, 143, 144, and 157). Excel shows this as a question mark symbol ( ? ) in Excel.

Note: CLEAN function doesn't work on the additional 6 non printing characters (values 127, 129, 141, 143, 144, and 157).

CLEAN function is a text function which removes the 32 non printing characters and extra line spaces from the input value in Excel

Syntax of CLEAN function:

=CLEAN(text)

text : text value to clean

Example:

All of these might be confusing to understand. So, let's test this formula via running it on the example shown below. Here we have some values to test the CLEAN function in Excel.

Use the formula:

=CLEAN(D3)

D3 : value in D3 cell. Using cell reference.

Extra linespaces are removed from the value in D3 cell. Now remove characters from the value in D4 cell. Just copy the formula from E3 cell to other cells using Ctrl + D.

Characters between text removed using function.

Use with other functions like TRIM function:

Trim function in Excel removes extra spaces from the text and CLEAN function removes mentioned characters and line spaces. 

Use the formula:

= TRIM ( CLEAN ( D5 ) )

D3 : value in D3 cell. Using cell reference.

Here there is a character between "M" and "20" which is removed by CLEAN function. Extra spaces in the beginning and ending of the text which is removed by TRIM function. Spaces (not line space) between characters remains as it is. For that you need to use SUBSTITUTE function

Here are some observational notes using the CLEAN function shown below.

Notes:

  1. The function take one argument can be text using quotes or text in cell using cell reference.
  2. The takes input as text value and return as text value. So careful when using with other functions in formula.
  3. This function only removes 32 non printing 7-bit ASCII code (values 0 through 31 )not the additional ones.

Hope this article about How to use the CLEAN function in Excel is explanatory. Find more articles on text function formulas here. If you liked our blogs, share it with your fristarts on Facebook. And also you can follow us on Twitter and Facebook. We would love to hear from you, do let us know how we can improve, complement or innovate our work and make it better for you. Write to us at info@exceltip.com.

Related Articles:

How to Use REPLACE function in Excel

How to Use SUBSTITUTE function in Excel

How to use the Excel SEARCH function

How to use the CHAR Function in Excel 

How to use the UNICHAR Function in Excel

How to use the UNICODE Function in Excel

Popular Articles:

50 Excel Shortcuts to Increase Your Productivity | Get faster at your task. These 50 shortcuts will make you work even faster on Excel.

The VLOOKUP Function in Excel | This is one of the most used and popular functions of excel that is used to lookup value from different ranges and sheets. 

COUNTIF in Excel 2016 | Count values with conditions using this amazing function. You don't need to filter your data to count specific values. Countif function is essential to prepare your dashboard.

How to Use SUMIF Function in Excel | This is another dashboard essential function. This helps you sum up values on specific conditions.

Leave a Reply

Your email address will not be published. Required fields are marked *

Terms and Conditions of use

The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.

Visit Us On TwitterVisit Us On FacebookVisit Us On Youtube