The easiest way to replace spaces with dashes in Google Sheets is to use the Find and replace function within the Edit tab.
The following example shows how to use this function in practice.
Example: Replace Space with Dash in Google Sheets
Suppose we have the following dataset that shows the total sales of various companies:
Suppose we would like to replace the blank cells in the Company column with dashes.
To do so, highlight the cell range A2:A10 as follows:
Next, click the Edit tab and then click Find and replace.
In the new window that appears, type a space in the Find box, then type a dash in the Replace with box:
Then click Replace all and then click Done.
Each of the spaces in the Company column will automatically be replaced by dashes:
Note: Make sure you click Replace all before clicking the Done button. This is a common mistake that people make, which causes the spaces not to be replaced by dashes.
The following tutorials explain how to perform other common tasks in Google Sheets:
How to Replace #N/A Values in Google Sheets
How to Replace Text in Google Sheets
How to Replace Blank Cells with Zero in Google Sheets