Mastering Microsoft Excel: A Comprehensive Guide to Using the SUBSTITUTE Function
Mastering Microsoft Excel: A Comprehensive Guide to Using the SUBSTITUTE Function
Quick Links
- What to Know When Using the SUBSTITUTE Function
- Replace Occurrences of a String Using SUBSTITUTE in Excel
To replace a string of text, numbers, or symbols, Microsoft Excel offers a function called SUBSTITUTE
. This function replaces the specified string with your choice of string. We’ll show you how to use it in your spreadsheets.
Related: How to Replace Any Character with Newlines in Notepad++
What to Know When Using the SUBSTITUTE Function
When you use the SUBSTITUTE
function, know that it’s case-sensitive and so you’ll have to use it accordingly. Also, you can’t specify wildcard entries in the function. You can use the function with your hard-coded values as well as cell references .
The function even lets you choose the instances of your specified string to change. This way, if you only want to change the first occurrence of a string, you can do so.
Replace Occurrences of a String Using SUBSTITUTE in Excel
To start using the function, open your spreadsheet with Microsoft Excel.
In the spreadsheet, select the cell in which you want to display the result. In the below example, we’ll replace
`HTG`
with
`How-To Geek`
.
In your selected cell, type the following function and press Enter.
In this function:
- B2: It’s the cell with the content that you want to replace.
- HTG: This is the original string that you want to find and replace with the new string.
- How-To Geek: This is the new string that will replace the old string.
=SUBSTITUTE(B2,”HTG”,”How-To Geek”)
You’ll see that the function has replaced the values as defined in the arguments.
Another scenario where you may want to use this function is when you want to change the country code for phone numbers. For example, if you have a list of phone numbers containing +91
as the country code, you can use the SUBSTITUTE
function to make all these phone numbers use +1
as the country code.
To do so, use the SUBSTITUTE
function with the following arguments:
=SUBSTITUTE(B2,”91”,”1”,1)
As you can see, in the above function, we’ve specified 1
at the end. This tells the function to only change the first occurrence of 91
to 1
. If the remaining numbers in a phone number contain 91
, the function won’t change that. This helps you avoid ending up with incorrect phone numbers.
And that’s how you use Excel’s SUBSTITUTE
function to change various strings in your spreadsheets.
Another way to change your spreadsheet’s contents is by using Excel’s find and replace feature . Check out our guide on that if you’re interested.
Related: How to Find and Replace Text and Numbers in Excel
Also read:
- [New] In 2024, Engage Efficiently Leading Insta Filters
- [New] Rapid Share Tactics for YouTube Lists
- [Updated] The Blueprint for TikTok Profitability – Mastering Filmmaker Funds for 2024
- [Updated] Visionary Logo Tactics Elevating Your Podcast's Look
- 3 Solutions to Hard Reset Realme Narzo N55 Phone Using PC | Dr.fone
- A Step-by-Step Guide for Creating Channel Trailers that Convert Viewers Into Customers for 2024
- Fixing Microsoft Store Error 0X80072EFD on PCs
- Guidelines to Correct Err 87 on Windows LoadLib
- In 2024, Cutting-Edge Simple Win 11 Recorders
- In 2024, Does Airplane Mode Turn off GPS Location On Vivo T2x 5G? | Dr.fone
- In 2024, Honor 90 ADB Format Tool for PC vs. Other Unlocking Tools Which One is the Best?
- Optimize Command Execution: Setting Terminal Preference
- Safeguarding Your OS: Managing USB Device Use
- Techniques to Reinstate Lost McUICnt File in Windows
- The Rotation Rulebook: Six Secrets to Snap-Spins in Windows 11
- Turbo Steam Downloads: Overcoming Frustrating Speed Halts
- Title: Mastering Microsoft Excel: A Comprehensive Guide to Using the SUBSTITUTE Function
- Author: Joseph
- Created at : 2024-10-26 17:05:59
- Updated at : 2024-10-30 16:48:53
- Link: https://windows11.techidaily.com/mastering-microsoft-excel-a-comprehensive-guide-to-using-the-substitute-function/
- License: This work is licensed under CC BY-NC-SA 4.0.