How to Replace Spaces with Dashes in Google Sheets

To replace spaces with dashes in Google Sheets, you can use the SUBSTITUTE function. Follow these steps:

  1. Open your Google Sheets document or create a new one.
  2. Click on an empty cell where you want to display the text with dashes instead of spaces.
  3. Type the following formula:
=SUBSTITUTE(A1, " ", "-")

Replace A1 with the cell reference containing the text you want to modify.

  1. Press Enter to apply the formula.

The text from the specified cell will appear in the selected cell with dashes instead of spaces.

Example

Here's an example to illustrate the process:

  1. Suppose you have the following text in cell A1: Hello World
  2. Click on an empty cell, let's say B1.
  3. Type the formula:
=SUBSTITUTE(A1, " ", "-")
  1. Press Enter.

The text in cell B1 will now display as Hello-World, with the space replaced by a dash.

Did you find this useful?