pluginguin
New Member
- Joined
- Aug 10, 2016
- Messages
- 21
- Office Version
- 2019
- Platform
- Windows
I have a formula that replaces all spaces in a string with a dash "-".
The problem with this is, is that when the original string already contains a dash between spaces " - " the endresult now is "---"
I would like to modify my formula to prevent this from happening and in those cases just remove the spaces.
Example string: "Trampolines - A great way to train your equilibrium"
Current formula:
Current result: "Trampolines---A-great-way-to-train-your-equilibrium"
Desired result: "Trampolines-A-great-way-to-train-your-equilibrium"
How to modify the formula?
The problem with this is, is that when the original string already contains a dash between spaces " - " the endresult now is "---"
I would like to modify my formula to prevent this from happening and in those cases just remove the spaces.
Example string: "Trampolines - A great way to train your equilibrium"
Current formula:
Excel Formula:
=SUBSTITUTE(D71," ","-")
Current result: "Trampolines---A-great-way-to-train-your-equilibrium"
Desired result: "Trampolines-A-great-way-to-train-your-equilibrium"
How to modify the formula?