Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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 have a long list of name with addresses and phone numbers in this format:

Barn Jeffery 123 Sunny Ln. Pulaski ,315-555-5555
Sarah 456 Bull Blvd. Memphis ,256-555-5555
Tara C. 7894 Pringle St. Clw. ,813-555-5555
Barnes Mathew 5821 Melody Ln. Tmp ,562-555-5555
Matthew 23B 189th St. Brooklyn ,718-555-5555
Castor Abby B. 7459 71st St. Stn ,210-555-5555
Karen 120 Tabby Trl. Seattle ,965-555-5555
Nick K. 4141 Fulton Ave. Missouri ,478-555-5555

What is the Find and Replace formula to add a comma before all the first names and/or a comma after all the last names?

share|improve this question

I would venture to say that there is no formula for something like that. There is no consistency and therefore no solution.

share|improve this answer
Isn't their a formula to at least add a comma before the first names? I've done it before and completely forgot how...Thx for taking the time to answer my question. – Stacey Y. Jul 6 '11 at 22:33
No, not to my knowledge. I'm sorry. – imtheman Jul 6 '11 at 23:44

Word takes accepts regular expressions in it's Find and Replace. There is a chart in here.

share|improve this answer

If "add a comma before all the first names" means to add a comma at the beginning of each line, you can do this:

In the "find" column, paste this ^p and in the "replace" column, paste this ^p, then click "replace all" to carry out the replacement.

Finally you will need to add a comma at the first line and delete the comma at the last line manually.

Hope it helps.

share|improve this answer
Sorry but I didn't notice that this is a question asked about 2 years ago.. – Paul Allen Apr 10 '13 at 5:05

I'd recommend putting this in Excel and adding the commas there. Once in Excel, you can use the Text to columns wizard to split the names into separate columns (use the "delimted" method and check the box for "space").

Use CONCATENATE to add the commas (as shown in the screenshot below).

enter image description here

Copy the column containing the formulas (col B in the screenshot) then "Paste values" to keep just the text with the commas. Use CONCATENATE again in the next blank column to put it all back together and restore the spaces (screenshot below).

enter image description here

Keep in mind that this method will involve some manual cleanup on the names with middle initials.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .