Clean Function in Google Sheets and Non-Printable Characters

The CLEAN function is one of the Text functions in Google Sheets. What is the use of it? To understand that you should know about the non-printable characters which you may come across in Sheets.

The Clean function is useful for removing non-printable characters in a cell or in an array. It’s not an array function though.

So obviously, when the non-printable characters are present in an array, then using the ArrayFormula function is unavoidable. I have included this Array and Clean combination in the below example.

Non-printable Characters in Google Sheets

Non-printable characters are the non-printable ASC-II characters such as Backspace, Line Feed, Carriage Return, Horizontal Tab, Vertical Tab, etc.

Refer this Wiki to see the table containing the current Unicode characters. In the provided table in that page, the decimal numbers 0 to 31 represents the non-printable characters in Google Sheets. You can test that in Google Sheets as below.

=ArrayFormula(char(row(A1:A50)))

Apply this formula in cell A1. Please note that column A must be blank at least up to row#50.

Scroll down this column to see the visible characters starting from row # 33.

What does the above formula do?

The Row function returns the numbers 1 to 50 in the range A1:A50. That numbers are within the Char function to return the associated characters.

That means the formula returns the non-printable characters in the range A1:A31. The balance rows A32:A50 contains the printable characters.

As a side note, the character in row # 32 (A32) is also not visible but that is a printable character called Whitespace.

Example to Non-Printable Characters in a Text in Sheets

Your Sheet may contain non-printable characters if you import data from external sources. Also, you can manually place such characters using the Char function in Sheets.

For example, I have the string “Info Inspired” in cell A1. I can move the string ‘Inspired’ to a new line within cell A1 as below.

="INFO"&CHAR(10)&"INSPIRED"

The Char function converts the number 10 to the character ‘Line Feed’ as per the Unicode table.

Line Feed Non-printable Character in Google Sheets

You May Like: How to Move New Lines in a Cell to Columns in Google Sheets.

If such characters present in a cell, it won’t be ‘visible’ similar to the Whitespace character. But the Whitespace is not a non-printable character.

Syntax and Examples to the Clean Function in Google Sheets

Syntax:

CLEAN(text)

Argument:

text – The text string in a cell or array whose non-printable characters are to be removed.

Formula Example to the Clean Function in Sheets

=clean(A1)
Clean Function in Google Sheets - Formula

In an array use the function as per the formula example below.

=ArrayFormula(clean(A1:A10))

Note:

Just like the To_Text function, you can convert a number to text using the Clean function. Want to see one example? Here you go!

Assume cell A1:A10 contains the numbers 1 to 10. You can use the following Clean formula to convert these numbers to text.

=ArrayFormula(clean(A1:A10)) 

Using a Clean formula, you can’t Clean the Whitespaces in a cell. For that, you can either use the Trim function or the menu Data > Trim Whitespace command.

=TRIM(A1)

Find more details here – How to Remove Additional, Double or Extra Spaces in Google Sheets.

That’s all about the use of Clean function in Google Sheets. Enjoy!

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Lookup Values Under Categories in Excel and Google Sheets

We can use a combination of XLOOKUP and VLOOKUP in both Excel and Google...

Extract Items Under a Category from the Same Column in Excel

In Excel, you can use a combination of the XLOOKUP and DROP functions to...

How to Create a Searchable Table in Excel Using the FILTER Function

Finding specific records, or rows containing the required information, is straightforward in Excel using...

Time Sequences in Excel by Minute, Hour, or Second Increments

Creating time sequences, whether by hour, minute, or second increments in Excel, can be...

More like this

XMATCH Row by Row: Finding Values Across a Range in Google Sheets

Using the BYROW function with XMATCH in Google Sheets allows us to match values...

Limit Formula Expansion to a Specific Row in Google Sheets

In this tutorial, I’ll explain how to limit the expansion of an array formula...

3-D Referencing Structured Data Tables in Google Sheets

When you have several tables within a single sheet—not across multiple sheets in a...

2 COMMENTS

  1. I’m successfully using CHAR(9989) and CHAR(10060) in my google sheet to indicate positive and negative outcomes.

    They display nicely in the print settings display but as soon as the sheet moves from Print Settings to Chrome Print, the ticks and crosses disappear irrespective of whether I am outputting to a printer or PDF.

    Any ideas?

    • Hi, Charles Yeats,

      At present, it seems Google Sheets doesn’t support it. Try instead the below character codes.

      Here are the printable tick and cross mark symbols.

      Positive Outcomes: =char(10004)
      Negative Outcomes: =char(10006)

      You can change their colors similar to the font.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.