HomeGoogle DocsSpreadsheetHow to Split Number from Text When No Delimiter Present in Google...

How to Split Number from Text When No Delimiter Present in Google Sheets

Published on

If there is a delimiter present in a text that separates a number, we can use the SPLIT function to split that number from text. But how can we split a number from a text when there is no delimiter present in Google Sheets?

See the below table. I have text strings in the first column without any delimiters, even space characters, to separate numbers from text.

Splitting Number from Text When No Delimiter in Google Sheets

If there is a comma or any other delimiter present between the text and number we can use the SPLIT function to split the numbers from text strings in Google Sheets.

For example, let’s consider the value in cell A1. If it is Sunday,500 we can use the following SPLIT formula.

=split(A1,",")

In order to split numbers from a text when there is no delimiter present, we must insert a delimiter using a formula. In Google Sheets, we can use a REGEXREPLACE formula for that.

That means splitting number from text without delimiter in Google Sheets involves the below two things.

  1. First, insert a delimiter(s) into the text using a formula to separate numbers from text.
  2. Then use a split formula to split numbers from text.

In concise we can’t directly split a number from a text when there is no delimiter present in Google Sheets. We must insert a delimiter with a Regex formula then split.

How to Insert a Comma Delimiter into a Text to Separate a Number from Text in Google Sheets

We may have different types of texts that contain numbers.

The numbers may be at the beginning of the text, middle of the text or at some other position. Also, there may be multiple separate numbers within a text string. You can see the same in column A in my example above.

Considering all these aspects, we must insert comma delimiters before the beginning of the number and also at the end of it. Then only we can split a number surrounded by texts.

For the text in cell A1, we can use the below REGEXREPLACE formula in cell C1 to insert comma delimiters into the text to separate numbers.

REGEXREPLACE(A1,"([0-9\.]+)",",$1,")

To an entire column range like A1:A, we can make it as an array formula with the help of the IF and ArrayFormula combo.

=ArrayFormula(if(A1:A="",,REGEXREPLACE(A1:A,"([0-9\.]+)",",$1,")))
Inserting a Comma Delimiter into a Text to Separate a Number from Text

The ArrayFormula covers column A whereas the IF formula limits the ArrayFormula to the cell contain values.

This way we can insert comma delimiters into text strings to separate numbers from texts in Google Sheets.

Split Formula to Split Numbers from Text without Physical Delimiter

We have inserted delimiters using a formula to separate numbers from text in Google Sheets.

So it’s not wise to say splitting numbers from texts is possible when there is no delimiter present in Google Sheets. Instead, we can say there is no physical delimiter present.

Simply wrapping the above array formula with SPLIT won’t bring the expected result. Then?

The SPLIT function should be inserted just before the REGEXMATCH as below.

=ArrayFormula(if(A1:A="",,split(REGEXREPLACE(A1:A,"([0-9\.]+)",",$1,"),",")))

This formula is in cell C1 and for the result, please refer to the very first screenshot on this page.

I hope, you have found the formula to split numbers from a text without delimiters in Google Sheets useful.

Related Resources

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.

Creating Sequential Dates in Equally Merged Cells in Google Sheets

Do you know how to create sequential dates in equally merged cells across a...

Running Total By Month in Excel

This tutorial demonstrates how to calculate the running total by month in a range...

SORT and SORTBY – Excel Vs Google Sheets

While Excel offers the SORT and SORTBY functions for sorting a table, Google Sheets...

Get Top N Values Using Excel’s FILTER Function

When using the FILTER function in Excel to extract the top N values, it's...

More like this

Creating Sequential Dates in Equally Merged Cells in Google Sheets

Do you know how to create sequential dates in equally merged cells across a...

Interactive Random Task Assigner in Google Sheets

You have multiple tasks and multiple people. Here's a fun way to randomly assign...

Google Sheets Bar and Column Chart with Target Coloring

To color each data point in the column or bar chart according to the...

4 COMMENTS

  1. Hi Prashanth,

    I would like to request your help with the expected split output. I have attached a link to the data that I am working with.

    [URL removed by Admin]

    Thank you!

    • Hi Bahar,

      I can’t access your sheet because it is view only and I can’t make a copy of it.

      However, I can share the sample text and formula with you:

      Sample Text in Cell A1: 3 apple 12 orange 7 pear pt9 2 water melon 43 grape wb7 5 starfruit
      Formula: =ARRAYFORMULA(TOCOL(TRIM(SPLIT(REGEXREPLACE(A1,"\s\d+",",$0"),","))))

      I hope this helps!

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.