Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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,"+")

share|improve this question
up vote 18 down vote accepted

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.

share|improve this answer

If you want to replace all spaces with the '+' character, try:

share|improve this answer
An example is worth a thousand function definitions. – Even Mien Jan 9 '12 at 13:11

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.

share|improve this answer
it's not just a one time thing. Users will put in human friendly strings, but I need them in a different form for URLs. – Nick Heiner Oct 18 '09 at 1:13

protected by BinaryMisfit Oct 12 '10 at 16:31

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.