MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Feb 25th, 2002, 09:25 AM   #1
Guest
 
Posts: n/a
Default

Hello Folks!

I have a unique situation that requires me to find and place a period in a string after the middle name. For example, in cell A2, I have the test Jonathan J McGuire. I need the text to read Jonathan J. McGuire. I think I need to start with the Find formula but after that I'm coming up short.

Thanks in advance.

Jonathan McGuire
  Reply With Quote
Old Feb 25th, 2002, 09:31 AM   #2
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

=LEFT(A1,SEARCH(" ? ",A1)+1)&"."&RIGHT(A1,LEN(A1)-SEARCH(" ? ",A1)-1)
Mark W. is offline   Reply With Quote
Old Feb 25th, 2002, 09:36 AM   #3
jonathanm
New Member
 
Join Date: Feb 2002
Posts: 2
Default

Hello Mark!

That worked like a champ. The only issue is when they don't have a middle initial it returns the old Excel favorite #VALUE. I tried placing an If in front to no avail.

Thanks again for your time.

Jonathan McGuire
jonathanm is offline   Reply With Quote
Old Feb 25th, 2002, 09:45 AM   #4
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

=IF(ISNUMBER(SEARCH(" ? ",A3)),LEFT(A3,SEARCH(" ? ",A3)+1)&"."&RIGHT(A3,LEN(A3)-SEARCH(" ? ",A3)-1),A3)
Mark W. is offline   Reply With Quote
Old Feb 25th, 2002, 09:48 AM   #5
jonathanm
New Member
 
Join Date: Feb 2002
Posts: 2
Default

God Bless You! That worked as needed.

Again, thanks for taking your time to assist in these oddball issues.

Have a great day! Jonathan
jonathanm is offline   Reply With Quote
Old Feb 25th, 2002, 11:42 AM   #6
IML
MrExcel MVP
 
Join Date: Feb 2002
Location: Denver, CO
Posts: 1,744
Default

You may also be able to get away with

=SUBSTITUTE(A1," ",". ",2)

good luck.

Just saw the distinction Mark put in. His specically looks for a sole character. Very nice.

[ This Message was edited by: IML on 2002-02-25 10:50 ]
IML is offline   Reply With Quote
Old Jun 10th, 2010, 10:45 AM   #7
Nostrovia69
New Member
 
Join Date: Jun 2010
Posts: 4
Default Re: Placing a period after a middle initial

Hello, I'm trying to place a period after the entire name as follows:
Smith, James F

I would also like it to differenciate to not do so if the person does not have a middle initial.
Nostrovia69 is offline   Reply With Quote
Old Jun 10th, 2010, 10:48 AM   #8
samfolds
Board Regular
 
Join Date: Jul 2009
Posts: 188
Default Re: Placing a period after a middle initial

Can you be a little more specific ? Does your input look like :
Smith James F all the time?

And did you mean a comma (,) instead of a period (.).

Give us a little more details and we'll be happy to help.

Samfolds

PS : Welcome to the board :D

EDIT : Nvm about the comma thing -_-

Last edited by samfolds; Jun 10th, 2010 at 10:58 AM.
samfolds is offline   Reply With Quote
Old Jun 10th, 2010, 10:57 AM   #9
samfolds
Board Regular
 
Join Date: Jul 2009
Posts: 188
Default Re: Placing a period after a middle initial

Ok I think I got a bit more of what you're saying.

Assuming your input (i.e. the names) are always of the form :

"Last Name", "Name" "Initial" (and this is in column A)

Copy in B1 :

=IF(mid(A1,LEN(A1)-1,1)=" ",A1 & ".",A1)

And drag down.

Hope this helps!

Samfolds
samfolds is offline   Reply With Quote
Old Jun 10th, 2010, 11:17 AM   #10
Nostrovia69
New Member
 
Join Date: Jun 2010
Posts: 4
Default Re: Placing a period after a middle initial

Sure, sorry.

The example: Smith, James F
is the entries that have a middle initial....there are also entries that do not have a middle initial but are set up the same way i.e. last name, first name
I would like to have the function differenciate between not having an initial and having one...I just want to make sure it doesn't place a period after the first name. I would like it to only place a period after the middle initial if the name contains it. Thanks
Nostrovia69 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 02:08 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes