Excel tutorial
/

Functions

Intermediate

Excel SUBSTITUTE function: replace and clean up characters in text

Use SUBSTITUTE to strip dashes from phone numbers, remove “soum” and turn text into numbers, and count characters in a cell — with examples.

SUBSTITUTE replaces one piece of text with another: a dash with a space, “st.” with “street”, or an unwanted character with nothing — which simply deletes it.

It shines when you clean up exports from other systems: phone numbers from a CRM arrive as “+998 (90) 123-45-67”, prices copied from a website as “12 500 soum”. Fixing them by hand takes hours; SUBSTITUTE cleans the whole column with one formula.

Your source data stays untouched: the result appears in the next column, and if something is off you only fix the formula.

Книга1 - Excel
—☐✕
B2fx=ПОДСТАВИТЬ(A2;"-";"")
ABCD
1PhoneClean number
290-123-45-67901234567
393-555-12-34935551234
497-700-00-11977000011
599-010-20-30990102030
6
ГотовоКоличество: 4
The dash was replaced with "" (empty text) — in other words, removed

Syntax

=ПОДСТАВИТЬ(text; old_text; new_text; [instance_num])

  • text — the original text or a cell (A2).
  • old_text — what to replace, in quotes: "-".
  • new_text — what to put instead. To delete, use empty quotes: "".
  • instance_num — optional. Which occurrence to replace. If omitted, all occurrences are replaced.

The function is case-sensitive: “Tashkent” and “tashkent” are different strings to it.

Removing dashes from phone numbers

1

Select the result cell — B2.

2

On the Формулы tab click Текстовые and pick SUBSTITUTE from the list.

Книга1 - Excel
—☐✕
ФайлГлавнаяВставкаРазметка страницыФормулыДанныеРецензированиеВидСправка
Вставить функциюАвтосуммаФинансовыеЛогическиеТекстовыеДата и времяСсылки и массивыМатематические
Библиотека функций
Диспетчер имён
Определённые имена
B2fx
ABCD
1PhoneClean number
290-123-45-67
393-555-12-34
4
5
Готово

3

In the arguments dialog enter Text A2, Old_text "-", New_text "". Leave Instance_num empty so every dash is removed. Click OK.

Книга1 - Excel
—☐✕
B2fx=ПОДСТАВИТЬ(A2;"-";"")
ABCD
1PhoneClean number
290-123-45-67901234567
393-555-12-34
4
5
Готово

4

Double-click the fill handle in the bottom-right corner of B2 — the formula is copied down the column. Experienced users just type it: =ПОДСТАВИТЬ(A2;"-";"").

Книга1 - Excel
—☐✕
B2fx=ПОДСТАВИТЬ(A2;"-";"")
ABCD
1PhoneClean number
290-123-45-67901234567
393-555-12-34935551234
497-700-00-119770000111
5
ГотовоКоличество: 3
Книга1 - Excel
—☐✕
B2fx=ПОДСТАВИТЬ(ПОДСТАВИТЬ(ПОДСТАВИТЬ(ПОДСТАВИТЬ(A2;" ";"");"(";"");")";"");"-";"")
ABCD
1Phone (from CRM)Digits only
2+998 (90) 123-45-67+998901234567
3+998 (93) 555-12-34+998935551234
4+998 (97) 700-00-11+998977000011
5
Готово
Example 1: nested SUBSTITUTE — spaces, brackets and dashes are removed one after another
Книга1 - Excel
—☐✕
B2fx=ПОДСТАВИТЬ(A2;"-";"/";2)
ABCD
1ContractNew format
2CT-2025-0145CT-2025/0145
3CT-2025-0146CT-2025/0146
4CT-2024-0099CT-2024/0099
5
Готово
Example 2: instance_num = 2 — only the second dash became “/”, the first one stayed
Книга1 - Excel
—☐✕
B2fx=ДЛСТР(A2)-ДЛСТР(ПОДСТАВИТЬ(A2;",";""))+1
ABCD
1OrderItems
2bread, milk, yogurt3
3rice1
4apples, pears, grapes, pomegranate4
5
Готово
Example 3: remove the commas and see how much shorter the text got. Commas + 1 = number of items

Pro level: turning a price stored as text into a number

“12 500 soum” copied from a website or Telegram is text to Excel, so it cannot be added up. Two SUBSTITUTEs plus VALUE fix it: first remove “ soum”, then the space, and finally convert the text into a number:

=ЗНАЧЕН(ПОДСТАВИТЬ(ПОДСТАВИТЬ(A2;" soum";"");" ";""))

Three more pro moves:

  • Non-breaking space. Numbers from websites and accounting software often contain a “special” space (code 160). TRIM ignores it, SUBSTITUTE removes it: =ПОДСТАВИТЬ(A2;CHAR(160);"").
  • Line breaks. Replace the Alt + Enter break inside a cell with a comma: =ПОДСТАВИТЬ(A2;CHAR(10);", ").
  • SUBSTITUTE or REPLACE? SUBSTITUTE looks for what is written; REPLACE works by position: =REPLACE(A2;1;4;"") deletes the first 4 characters, whatever they are.
Книга1 - Excel
—☐✕
B2fx=ЗНАЧЕН(ПОДСТАВИТЬ(ПОДСТАВИТЬ(A2;" soum";"");" ";""))
ABCD
1Price (from site)Number
212 500 soum12 500
38 000 soum8 000
4145 900 soum145 900
5Total166 400
6
Готово
The text became numbers — now SUM adds them up

Try it in the simulator

Column A has phone numbers with dashes. Type =ПОДСТАВИТЬ(A2;"-";"") in B2 and fill it down to B5. Then in C2 replace only the first dash with a space: =ПОДСТАВИТЬ(A2;"-";" ";1).

Книга1 - Excel
—☐✕
Буфер обмена
Шрифт
Выравнивание
Число
Стили
Ячейки
Редактирование
✕✓fx
ABCDEFGHIJKLMNOPQRSTUVWX
1PhoneClean numberOne space
290-123-45-67
393-555-12-34
497-700-00-11
599-010-20-30
6
7
8
9
10
Лист1
Готово

Has ExcelLab been useful?

Support the project and help us release new lessons and exercises.

Support us
Previous

113 / 154