Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to re-format column of text from space delinitation to hyphen?

So here is what the data looks like:

enter image description here

What I need is a way to convert the spaces in the Title column, which would be easy if I also didn’t have a | character. This appears to need some VBA to conver it to the format of the Handle column?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I tried this =TRIM(SUBSTITUTE(B2," ","-",4)) with no luck.

Thanks!

>Solution :

Well, use substitute() twice:

enter image description here

To save you typing:

SUBSTITUTE(SUBSTITUTE(B1," | "," ")," ","-")

Edit based on comments:
And if you need the final result in lower case then:

=lower(SUBSTITUTE(SUBSTITUTE(B1," | "," ")," ","-"))

I used the inner substitute:

SUBSTITUTE(B1," | "," ")

to replace the space pipe space " | " with just a space,

Then the outer substitute to replace all the spaces with "-".

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading