---
title: "Keep only digits with REGEXREPLACE in Google Sheets | PracticeExcel"
description: "Practice REGEXREPLACE in Google Sheets: clean a phone number down to its digits with one formula."
canonical_url: "https://practiceexcelonline.com/sheets/practice/regex/regexreplace-digits"
locale: en
meta:
  "og:description": "Practice REGEXREPLACE in Google Sheets: clean a phone number down to its digits with one formula."
  "og:image": "https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_Keep%2Bonly%2Bdigits%2Bwith%2BREGEXREPLACE%2Bin%2BGoogle%2BSheets%2Cdescription_~UHJhY3RpY2UgUkVHRVhSRVBMQUNFIGluIEdvb2dsZSBTaGVldHM6IGNsZWFuIGEgcGhvbmUgbnVtYmVyIGRvd24gdG8gaXRzIGRpZ2l0cyB3aXRoIG9uZSBmb3JtdWxhLg%2Ceyebrow_REGEX%2Bfunctions%2Csite_practiceexcel%2Cprops_eyJncmlkIjp7ImNvbHMiOlsiQSIsIkIiXSwicm93cyI6W3sibiI6MSwiY2VsbHMiOlsiUGhvbmUgYXMgdHlwZWQiLCJEaWdpdHMgb25seSJdfSx7Im4iOjIsImNlbGxzIjpbIlRlbDogMDIwIDc5NDYgMDAxOCIsIiJdfV0sInRhcmdldCI6WzEsMV19fQ%2Cp_Ii9zaGVldHMvcHJhY3RpY2UvcmVnZXgvcmVnZXhyZXBsYWNlLWRpZ2l0cyI%2Cs_7TAbhpJ-SBq-NODv.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Keep only digits with REGEXREPLACE in Google Sheets | PracticeExcel"
  "twitter:image": "https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_Keep%2Bonly%2Bdigits%2Bwith%2BREGEXREPLACE%2Bin%2BGoogle%2BSheets%2Cdescription_~UHJhY3RpY2UgUkVHRVhSRVBMQUNFIGluIEdvb2dsZSBTaGVldHM6IGNsZWFuIGEgcGhvbmUgbnVtYmVyIGRvd24gdG8gaXRzIGRpZ2l0cyB3aXRoIG9uZSBmb3JtdWxhLg%2Ceyebrow_REGEX%2Bfunctions%2Csite_practiceexcel%2Cprops_eyJncmlkIjp7ImNvbHMiOlsiQSIsIkIiXSwicm93cyI6W3sibiI6MSwiY2VsbHMiOlsiUGhvbmUgYXMgdHlwZWQiLCJEaWdpdHMgb25seSJdfSx7Im4iOjIsImNlbGxzIjpbIlRlbDogMDIwIDc5NDYgMDAxOCIsIiJdfV0sInRhcmdldCI6WzEsMV19fQ%2Cp_Ii9zaGVldHMvcHJhY3RpY2UvcmVnZXgvcmVnZXhyZXBsYWNlLWRpZ2l0cyI%2Cs_7TAbhpJ-SBq-NODv.png"
---

> Index of every page on this site: [llms.txt](https://practiceexcelonline.com/llms.txt)

# **Keep only digits with REGEXREPLACE**

**Premium**

In B2, use REGEXREPLACE to remove everything from A2 that is not a digit. \\D (capital D) means any character that is not a digit.

B2fx

|  | A | B | C | D | E | F |
| --- | --- | --- | --- | --- | --- | --- |
| 1 | Phone as typed | Digits only |  |  |  | |
| 2 | Tel: 020 7946 0018 |  |  |  |  | |
| 3 |  |  |  |  |  | |
| 4 |  |  |  |  |  | |
| 5 |  |  |  |  |  | |
| 6 |  |  |  |  |  | |
| 7 |  |  |  |  |  | |
| 8 |  |  |  |  |  | |

**Premium lesson**

## **Unlock REGEX functions and every other lesson**

This is a premium lesson. Premium lets you solve it and every other lesson, take the timed mock tests, and earn certificates you can share on LinkedIn.

Next with premium:**IF****COUNTIF**

[**See plans, from $5/month**](https://practiceexcelonline.com/pricing) [**Already premium? Sign in**](https://practiceexcelonline.com/login?next=/sheets/practice/regex/regexreplace-digits)

Need help?

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://practiceexcelonline.com/#identity","@type":"Organization","name":"PracticeExcel","url":"https://practiceexcelonline.com/","logo":{"@id":"https://practiceexcelonline.com/#logo"}},{"@id":"https://practiceexcelonline.com/#website","@type":"WebSite","inLanguage":"en-US","name":"PracticeExcel","url":"https://practiceexcelonline.com/","alternateName":["Practice Excel Online","PracticeExcelOnline.com"],"publisher":{"@id":"https://practiceexcelonline.com/#identity"},"workTranslation":{"@id":"https://excelopgaver.dk/#website"}},{"@id":"https://practiceexcelonline.com/sheets/practice/regex/regexreplace-digits#webpage","@type":"WebPage","description":"Practice REGEXREPLACE in Google Sheets: clean a phone number down to its digits with one formula.","name":"Keep only digits with REGEXREPLACE in Google Sheets","url":"https://practiceexcelonline.com/sheets/practice/regex/regexreplace-digits","breadcrumb":{"@id":"https://practiceexcelonline.com/sheets/practice/regex/regexreplace-digits#breadcrumb"},"isPartOf":{"@id":"https://practiceexcelonline.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://practiceexcelonline.com/sheets/practice/regex/regexreplace-digits"]}],"primaryImageOfPage":{"@id":"https://practiceexcelonline.com/#logo"}},{"@id":"https://practiceexcelonline.com/sheets/practice/regex/regexreplace-digits#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://practiceexcelonline.com","position":1},{"@type":"ListItem","name":"Google Sheets practice exercises","item":"https://practiceexcelonline.com/sheets","position":2},{"@type":"ListItem","name":"REGEX functions","item":"https://practiceexcelonline.com/sheets/practice/regex","position":3},{"@type":"ListItem","name":"Keep only digits with REGEXREPLACE in Google Sheets","position":4}]},{"@id":"https://practiceexcelonline.com/sheets/practice/regex/regexreplace-digits#/schema/learning-resource/1","@type":"LearningResource","description":"Practice REGEXREPLACE in Google Sheets: clean a phone number down to its digits with one formula.","educationalLevel":"intermediate","isAccessibleForFree":false,"learningResourceType":"exercise","name":"Keep only digits with REGEXREPLACE","teaches":"REGEX functions"},{"@id":"https://practiceexcelonline.com/#logo","@type":"ImageObject","caption":"PracticeExcel","contentUrl":"https://practiceexcelonline.com/brand/practiceexcel/icon-512.png","inLanguage":"en-US","url":"https://practiceexcelonline.com/brand/practiceexcel/icon-512.png"}]}
```

## Sitemap

See the full [sitemap](https://practiceexcelonline.com/sitemap.md) for all pages.
