How to Replace Text in Google Sheets
To replace text in Google Sheets, you can use the "Find and replace" feature or the "SUBSTITUTE" function. Here's how to use both methods:
Find and replace
- Open your Google Sheet.
- Click on "Edit" in the menu bar.
- Select "Find and replace" from the dropdown menu, or press Ctrl+H (Cmd+Shift+H on Mac) to open the Find and replace dialog box.
- In the "Find" field, type the text you want to replace.
- In the "Replace with" field, type the text you want to replace the original text with.
- Choose the range in which you want to perform the replacement. You can choose "All sheets", "This sheet", or "This range". If you choose "This range", you will need to select the range in your sheet.
- You can also use additional options by clicking on "More options". Here, you can check "Match case" and "Match entire cell contents" if needed.
- Click on "Replace all" to replace all instances of the text, or click "Replace" to replace one instance at a time.
SUBSTITUTE function
The SUBSTITUTE function can be used to replace specific text in a cell with another text. The syntax for the SUBSTITUTE function is:
SUBSTITUTE(text, search, replacement, [occurrence])
text
: The cell containing the text you want to replace.search
: The text you want to replace.replacement
: The text you want to replace the original text with.occurrence
(optional): The specific occurrence of the search text you want to replace. If omitted, all occurrences will be replaced.
Example
Let's say we have the following data in column A:
A
1 The quick brown fox
2 The quick brown dog
3 The quick brown cat
We want to replace the word "quick" with "fast" in the text. In column B, use the SUBSTITUTE function as follows:
B
1 =SUBSTITUTE(A1, "quick", "fast")
2 =SUBSTITUTE(A2, "quick", "fast")
3 =SUBSTITUTE(A3, "quick", "fast")
The result will be:
A B
1 The quick brown fox The fast brown fox
2 The quick brown dog The fast brown dog
3 The quick brown cat The fast brown cat
In this example, we replaced the word "quick" with "fast" using the SUBSTITUTE function.
Did you find this useful?