Excel Study · Module 5: Text functions

Class 44SUBSTITUTE & REPLACE

Intermediate1:50 videoFree

SUBSTITUTE swaps the text you name: =SUBSTITUTE(A2,"-","") swaps every dash in a phone number for nothing, so only the digits are left.

Try this AI prompt

Works in ChatGPT, Gemini, Copilot or Claude.

In Excel, A2 has a phone number written with dashes, like 050-111-2233. Write a formula for B6 that removes all the dashes.

The answer that works

✓ checked in Excel
=SUBSTITUTE(A2,"-","")

AI can get Excel wrong. Paste its answer into Excel and test it before you trust it.

Sources: Microsoft support