How can I extract numbers from a string using Google Sheets? 2

How can I extract numbers from a string using Google Sheets?

To extract numbers from a string using Google Sheets, one can use the “REGEXEXTRACT” function. This function allows users to specify a pattern to search for within a string and extract only the matching numbers. By utilizing this function, users can easily extract and manipulate numerical data from a larger string of text in their Google Sheets spreadsheet. This feature is particularly useful for organizing and analyzing numerical data within a larger dataset.

Google Sheets: Extract Numbers from String


You can use the following formula to extract numbers from a string in Google Sheets:

=REGEXEXTRACT(A1,"-*d*.?d+")

This formula will extract integers, decimals, and negative signs from a string.

The following example shows how to use this formula in practice.

Example: Extract Numbers from String in Google Sheets

Suppose we have the following list of strings in Google Sheets:

We can use the following formula to extract numbers (including integers, decimals, and negative signs) from the strings:

=REGEXEXTRACT(A2,"-*d*.?d+")

The following screenshot shows how to use this formula in practice:

extract number from string in Google Sheets

Notice that the values in column B only contain the integers, decimals, and negative signs from the values in column A.

If you ever attempt to use this formula and you receive #VALUE! as a result, make sure that the strings are formatted as Plain text.

To convert the strings to Plain text, highlight the cell range that contains the strings, then click the Format tab along the top ribbon, then click Number and then click Plain text.

This should resolve any #VALUE! issues.

Additional Resources

Cite this article

stats writer (2024). How can I extract numbers from a string using Google Sheets?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-extract-numbers-from-a-string-using-google-sheets/

stats writer. "How can I extract numbers from a string using Google Sheets?." PSYCHOLOGICAL SCALES, 1 Jul. 2024, https://scales.arabpsychology.com/stats/how-can-i-extract-numbers-from-a-string-using-google-sheets/.

stats writer. "How can I extract numbers from a string using Google Sheets?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-i-extract-numbers-from-a-string-using-google-sheets/.

stats writer (2024) 'How can I extract numbers from a string using Google Sheets?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-extract-numbers-from-a-string-using-google-sheets/.

[1] stats writer, "How can I extract numbers from a string using Google Sheets?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, July, 2024.

stats writer. How can I extract numbers from a string using Google Sheets?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.

Download Post (.PDF)
PDF
Scroll to Top