Premium exercise · Excel text and date functions
SUBSTITUTE practice: strip dashes
Practice Excel SUBSTITUTE by removing dashes from phone numbers so only the digits remain.
Column A has phone numbers with dashes. A downstream system wants digits only.
In column B, use SUBSTITUTE to replace every dash with nothing.
Dataset
Starter sheet. Cells marked formula are where the formula goes.
| Row | A | B |
|---|---|---|
| 1 | Phone | Digits |
| 2 | 555-010-1234 | Formula goes in B2. formula |
| 3 | 555-019-9876 | Formula goes in B3. formula |
Hint
SUBSTITUTE takes the text, the characters to find, and the characters to use instead.
Explanation
This exercise practices SUBSTITUTE in Excel. The formula goes in B2, B3.
SUBSTITUTE swaps each dash for an empty string. 555-010-1234 becomes 5550101234, and 555-019-9876 becomes 5550199876. The digits stay in their original order.
The interactive sheet and a worked solution are part of Formula Drills Premium. The instructions and starter data on this page are the full problem.