SUBSTITUTE

Textintermediate

SUBSTITUTE finds every occurrence of a text string and replaces it with another. Unlike Find & Replace (Ctrl+H), SUBSTITUTE works in formulas so you can transform data without modifying the source. It's case-sensitive and can target a specific occurrence if needed.

Syntax

Excel:=SUBSTITUTE(text, old_text, new_text, [instance_num])
Google Sheets: Same syntax

Parameters

textThe text or cell to modify.
old_textThe text to find.
new_textThe replacement text.
instance_num?Which occurrence to replace. If omitted, replaces all.

? = optional parameter

Worked Example

Replace 'Software' with 'SaaS' in the category field.

Row numbersC
Header rowcategoryafter SUBSTITUTE
2SoftwareSaaS
3ConsultingConsulting
4Office SuppliesOffice Supplies
5SoftwareSaaS

Formula

=SUBSTITUTE(A2, "Software", "SaaS")

Result

SaaS

SUBSTITUTE looks at A2, finds the text 'Software', and replaces it with 'SaaS'. In this sample, A2 changes from 'Software' to 'SaaS'.

Practice Exercises

2 exercises - work through each one using the data table below

Exercise 1 of 2beginner
#SUBSTITUTE-001

Question

The company is rebranding 'Operations' to 'Business Operations' in all reports. Write a formula that would transform the department name. What's the result for a row with department 'Operations'?

Dataset

Showing rows 1-10

Download CSV
Row numbersABC
Header row
2INV-1001Cloudline SoftwareEngineering
3INV-1002Apex Office SupplyOperations
4INV-1003Summit Consulting GroupFinance
5INV-1004Meridian Travel Co.Sales
6INV-1005Forge & Frame CreativeMarketing
7INV-1006NovaTech SolutionsEngineering
8INV-1007Atlas Hardware Co.Operations
9INV-1008Clearview Data SystemsEngineering
10INV-1009Redstone MarketingMarketing
11INV-1010Keystone Legal AdvisorsFinance
12

Scroll to explore the table, then sort or filter by column as needed.

Hints

Your Answer

Exercise 2 of 2intermediate
#SUBSTITUTE-002

Question

Remove all spaces from the vendor name 'Summit Consulting Group' using SUBSTITUTE. What's the result?

Dataset

Showing rows 1-10

Download CSV
Row numbersAB
Header row
2INV-1001Cloudline Software
3INV-1002Apex Office Supply
4INV-1003Summit Consulting Group
5INV-1004Meridian Travel Co.
6INV-1005Forge & Frame Creative
7INV-1006NovaTech Solutions
8INV-1007Atlas Hardware Co.
9INV-1008Clearview Data Systems
10INV-1009Redstone Marketing
11INV-1010Keystone Legal Advisors
12

Scroll to explore the table, then sort or filter by column as needed.

Hints

Your Answer

Want more practice?

Test Me mode randomizes exercises across all formulas without telling you which formula to use.

Try Test Me ->