I want an excel formula that will change
Haverford, PA to
haverford,+pa. (Text is to lowercase, and spaces are replaced with plus characters.)
The following will get the first space, but not all of them:
=REPLACE(E19, SEARCH(" ", E19),1,"+")
Part of what you want to do can be accomplished with the "SUBSTITUTE" function.
This will replace specific characters in a text string with the characters you specify, in this case spaces with the + symbol.
Then to change case use the "LOWER" function.
If you nest "SUBSTITUTE" within "LOWER" you should get the change you are looking for.
The text below is taken from Excel Help.
Substitutes new_text for old_text in a text string. Use SUBSTITUTE when you want to replace specific text in a text string; use REPLACE when you want to replace any text that occurs in a specific location in a text string.
Text is the text or the reference to a cell containing text for which you want to substitute characters.
Old_text is the text you want to replace.
New_text is the text you want to replace old_text with.
Instance_num specifies which occurrence of old_text you want to replace with new_text. If you specify instance_num, only that instance of old_text is replaced. Otherwise, every occurrence of old_text in text is changed to new_text.
Converts all uppercase letters in a text string to lowercase.
Text is the text you want to convert to lowercase. LOWER does not change characters in text that are not letters.
If you want to replace all spaces with the '+' character, try:
Why not just use find and replace to replace the entire Haverford, PA string with the one you want. You shouldn't need a formula for this, just the built in find and replace tool.
Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.
Would you like to answer one of these unanswered questions instead?