logo-mini

CLEAN Function

The CLEAN function in Excel is a useful tool for removing unwanted characters from a cell or range of cells. It is particularly useful for importing data from external sources, as these sources may sometimes include characters that are not compatible with Excel. The CLEAN function can help to remove these characters, ensuring that the data is accurately displayed in Excel.

The syntax for the CLEAN function is as follows:

CLEAN(text)

The text argument is the cell or range of cells that you want to clean. This can be a reference to a cell or a range, or it can be a string of text.

The CLEAN function removes the following characters from the text:

  • ASCII values 0 through 31
  • ASCII value 127

These characters are often referred to as “non-printing characters” as they do not appear when the text is displayed. They can cause problems when importing data into Excel, as they may not be recognized by the software.

The CLEAN function is a useful tool for cleaning up data before it is used in Excel. For example, if you have a list of names that includes non-printing characters, you can use the CLEAN function to remove these characters and ensure that the names are displayed correctly.

To use the CLEAN function, you can simply enter the formula into a cell and then reference the cell or range that you want to clean. For example, if you have a range of cells that contains names with non-printing characters, you can use the following formula:

=CLEAN(A1:A10)

This formula will remove all non-printing characters from the cells in the range A1:A10. You can then copy and paste the formula down to apply it to the rest of the cells in the column.

In addition to using the CLEAN function to remove non-printing characters, you can also use it to remove other types of characters. For example, if you want to remove all punctuation marks from a cell or range of cells, you can use the following formula:

=SUBSTITUTE(A1, “.”, “”)

This formula will replace all periods in the cell with an empty string, effectively removing them. You can use the same formula to remove other types of characters by simply replacing the period with the character that you want to remove.

There are a few limitations to the CLEAN function. It is only capable of removing ASCII values 0 through 31 and ASCII value 127. This means that it cannot remove other types of characters, such as special characters or foreign characters. If you need to remove these types of characters, you will need to use other functions or techniques.

In conclusion, the CLEAN function is a useful tool for removing unwanted characters from a cell or range of cells in Excel. It is particularly useful for cleaning up data that has been imported from external sources, as these sources may sometimes include non-printing characters that are not compatible with Excel. By using the CLEAN function, you can ensure that your data is accurately displayed in Excel and ready for use in your analyses and calculations.

Download the sample files: CLEAN FUNCTION – Click here