How to use the SUBSTITUTE function in Google Sheets?

account_box
Syntactica Sophia
a year ago

The SUBSTITUTE function in Google Sheets is a powerful tool that allows you to replace one or more instances of a specific character or text within a cell with another character or text. Here's a step-by-step guide to using the SUBSTITUTE function:

  • Start by opening your Google Sheets spreadsheet and selecting the cell in which you want to use the function.
  • Enter the formula =SUBSTITUTE(, , ) in the formula bar, where 'text' is the text you want to substitute, 'old_text' is the text you want to replace, and 'new_text' is the text you want to replace 'old_text' with. For example, =SUBSTITUTE(A1, 'dog', 'cat') will replace the word 'dog' in cell A1 with the word 'cat'.
  • Press Enter, and the SUBSTITUTE function will automatically replace all instances of 'old_text' with 'new_text' within the specified cell.
  • You can also use the SUBSTITUTE function to replace a specific occurrence of 'old_text' within the cell by adding an optional fourth argument to the formula. For example, =SUBSTITUTE(A1, 'dog', 'cat', 2) will only replace the second occurrence of the word 'dog' with 'cat'.