Placing a period after a middle initial

G

Guest

Guest
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
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Have you tried the formula in my last post?

It worked out for a sample I made.

Keep me posted.

Samfolds

EDIT : Sorry didn't see you had written back ;)

Glad I could help
 
Upvote 0
Another question...if you don't mind:biggrin:

What if I wanted to pull the middle initial out all together and also check and make sure there is a middle initial to pull.

The same setup: Last name, first name m. or Last name, first name.

Can you help me with a formula for that?
I know at the beginning of this they were trying to pull the middle initial out of the center of the name not the end. Thanks,
Nostrovia69:eek:
 
Upvote 0
Just need a simple modification :

=IF(mid(A1,LEN(A1)-1,1)=" ",mid(A1,1,LEN(A1)-2),A1)

It checks wether there is a space at the end (meaning a middle name initial). If so, it returns A1 minus the 2 last characters (aka the middle name initial and the space). If there are not any middle name initial, it returns the current name.

Hope this will do the trick :D

Samfolds

EDIT : This is assuming you did not add the (.) at the end of the initial.
 
Upvote 0
samfolds:
I haven't tried out your formula, but if you are going to use MID starting at the first character, why not just use LEFT?

=IF(LEFT(RIGHT(A1,2))=" ",LEFT(A1,LEN(A1)-2),A1)
 
Last edited:
Upvote 0
samfolds:
I haven't tried out your formula, but if you are going to use MID starting at the first character, why not just use LEFT?

=IF(LEFT(RIGHT(A1,2))=" ",LEFT(A1,LEN(A1)-2),A1)

Indeed that is a good idea. But I think the first one is ok considering it is starting on the LEN(A1)-1 character... Hehe anyway "All roads lead to Rome".

Samfolds
 
Upvote 0
Does anyone know the proper coding to achieve the above response?
 
Upvote 0

Forum statistics

Threads
1,214,588
Messages
6,120,409
Members
448,959
Latest member
camelliaCase

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top