Start Free Course

CLEAN Excel Function

Written by ExcelMojo Editorial Team ExcelMojo Editorial Team ExcelMojo editorial profile and article credentials. Full Bio
Reviewed by Dheeraj Vaidya, CFA, FRM Dheeraj Vaidya, CFA, FRM Reviewed for accuracy, clarity, and editorial standards. Full Bio
Updated Apr 22, 2026
Read Time 10 min

What Is CLEAN Function In Excel?

The CLEAN function in Excel is an inbuilt Text function that eliminates all the nonprintable characters from the given text. Users can apply the CLEAN Excel function on texts imported from other sources that contain characters our OS might not be able to print. While the CLEAN() clears away such characters, we can also use it to remove line breaks in a given text string.

For example, consider the below table. It shows a list of text values containing nonprintable characters and line breaks in column A and the formulas to derive them in column B.

Frequently Asked Questions (FAQs)

1. Where is the CLEAN function in Excel?

The CLEAN function in Excel is available in the Formulas tab. We can click Formulas 🡪 Text 🡪 CLEAN to use it.

Clean-formulas-text-function

2. Why is the CLEAN function not working in Excel?

The CLEAN function is not working in Excel, perhaps because the nonprinting characters we require to eliminate in the given text are not present in the first 32 7-bit ASCII code.

3. How to use the CLEAN() in Excel VBA?

We can use the CLEAN() in Excel VBA in the following way.

Let us see the steps with an example.

Consider the below table. Assume we have a source data set in column A, imported from an external application.

Clean function FAQ 3

And column B shows whether the individual cells in column A contain nonprintable characters, additional spaces, and line breaks.

Suppose we must remove such unwanted characters from the source data and display the required results in the target cell range C2:C5. Then here is how we can use the CLEAN function in Excel VBA to achieve the desired outcome in range C2:C5.

Step 1: With the required active worksheet opens, press the keyboard shortcut Alt + F11 to open the VBA Editor.

FAQ 3 - vba

Step 2: Next, choose the specific VBAProject in the left menu and click Insert –> Module to open the Module1 window.

FAQ 3 - vba module

Step 3: Enter the VBA code to remove nonprintable characters, additional spaces, and line breaks from the given text in the Module1 window.

FAQ 3 - VBA module (code)

Step 4: Next, click the Run Sub/UserForm button to run the code commands.

FAQ 3 - VBA module (run)

Step 5: Finally, open the active worksheet to view the output in the target cell range C2:C5.

FAQ 3 - step 5

Download Template

📥Download the ready-to-use Excel template to practice this tutorial yourself.

Download Excel Template

This has been a guide to Clean Excel Function. Here we learn to remove non-printable characters using CLEAN Formula, with examples & a downloadable excel template. You can learn more from the following articles –