How to Remove the First N Characters in Google Sheets

Published on

You may want to remove the first n characters in Google Sheets to clean text strings. Which is the suitable function to do this?

To remove the first n characters in a single cell or column, you can use the functions REPLACE, RIGHT+LEN, MID+LEN, REGEXREPLACE, or REGEXEXTRACT functions.

The simplest option is the REPLACE function. We will start with that and include other options as well for educational purposes.

Removing the First N Characters Using the REPLACE Function in Google Sheets

Assume cell A1 contains the value “Mr. John”. To extract the name only from this string and remove the title “Mr. ” (a total of 4 characters), use the following formula in cell B1:

=REPLACE(A1, 1, 4, "")

This formula follows the syntax REPLACE(text, position, length, new_text), where:

  • text: The cell reference (A1 in this case)
  • position: The starting position of the text to replace (1 here, meaning the first character)
  • length: The number of characters to replace (4 here, the length of “Mr. “)
  • new_text: The text to replace with (“” here, an empty string)

The REPLACE function replaces part of the text in cell A1, starting from the first character and spanning 4 characters, with an empty string, effectively removing “Mr. ” and leaving “John”.

Note: When you use the REPLACE function to replace the first n digits in a number, the output will be text formatted. In that case, use the VALUE function to convert it back to a number, as shown below:

=VALUE(REPLACE(A1, 1, 5, ""))

This formula will return 67890 if the number in cell A1 is 1234567890.

Removing the First N Characters from Texts in a Column

In the following example, names with their titles are in column A, range A2:A15. Each title is 4 characters long, such as “Mr. ” and “Ms. “.

You can use ARRAYFORMULA with REPLACE to apply the formula to all rows in the column without needing to copy and paste it individually.

Here’s how to do it:

=ArrayFormula(REPLACE(A2:A15, 1, 4, ""))

Apply this formula in cell B2 to remove the titles “Mr. ” or “Ms. ” from the names in column A.

Removing the First N Characters from Text in a Column

What About Texts in Multiple Columns?

Yes! The REPLACE and ARRAYFORMULA combo will work with data in multiple columns.

Example:

=ArrayFormula(REPLACE(A2:B10, 1, 3, ""))

Alternative Solutions

As mentioned earlier, other functions can be used to remove the first n characters from a text. I am listing them below so you are aware of them when you encounter them in a shared sheet. Replace n with the number of characters you want to remove.

=RIGHT(A1, LEN(A1)-n)

Extracts all characters from the right of cell A1, excluding the first n characters.

=MID(A1, n+1, LEN(A1))

Extracts all characters from cell A1 starting at position n + 1 to the end of the string.

=REGEXREPLACE(A1, "^.{n}", "")

Removes the first n characters from the text in cell A1.

=REGEXEXTRACT(A1, REPT(".", n) & "(.*)")

Extracts all characters from cell A1, excluding the first n characters.

All these formulas will work with the ARRAYFORMULA function, similar to the REPLACE function. Please note that REGEXREPLACE and REGEXEXTRACT are specifically for text, not numbers.

Resources

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Expert Prashanth KV is a Diamond Product Expert in Google Sheets, officially recognized by Google for his contributions to the Docs Editors Help Community and featured in the Google Product Experts Directory. Explore his blog to learn advanced formulas, automation tips, and problem-solving techniques to elevate your spreadsheet skills.

Calculate Trip Days by Month (Start, End, and Full Days) in Google Sheets

If you're managing business travel in Google Sheets, you may need to calculate how...

Mode of Comma-Separated Numbers in Excel (Dynamic Array)

There is no dedicated function in Excel to directly find the mode of comma-separated...

How to Find Mode of Comma-Separated Numbers in Google Sheets

Working with comma-separated numbers inside a single cell is a common scenario in Google...

How to Count Merged Cells in Google Sheets (and Get Their Size)

Sometimes, you may have blocks of merged cells in a column or row. But...

More like this

Calculate Trip Days by Month (Start, End, and Full Days) in Google Sheets

If you're managing business travel in Google Sheets, you may need to calculate how...

How to Find Mode of Comma-Separated Numbers in Google Sheets

Working with comma-separated numbers inside a single cell is a common scenario in Google...

How to Count Merged Cells in Google Sheets (and Get Their Size)

Sometimes, you may have blocks of merged cells in a column or row. But...

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.