New Excel Forum

This forum has been moved to TeachExcel.com

Ask all future questions in the New Excel Forum.

ExcelKey

Placing a "." after single characters only

Macros, VBA, Excel Automation, etc.

Placing a "." after single characters only

Postby ddenn98 » Thu Jul 07, 2016 12:29 pm

Hello All:

I have a spreadsheet with peoples' names. They are separated by Last name, first name and middle name in different cells.

Some of the middle names have more than one character and some of the people's middle name fields are blank.

I wish to place a "." next the a middle initial ONLY if the middle name contains only one character. If the middle name contains more than one character, it must be ignored as well as a blank middle name field.

Is there a formula I can use to accomplish this?

Thank you all very much

Dee
  • 0

ddenn98
Rookie
 
Posts: 2
Joined: Jul 7, 2016
Reputation: 0
Excel Version: 10

Re: Placing a "." after single characters only

Postby ConneXionLost » Thu Jul 07, 2016 2:04 pm

Hi Dee,

Try this:

Code: Select all
=IF(LEN(A2)=1,A2&".",IF(A2="","",A2))


Cheers,
  • 0

ConneXionLost
Regular
 
Posts: 68
Joined: May 9, 2013
Location: Canada
Reputation: 19
Excel Version: 2003, 2010

Re: Placing a "." after single characters only

Postby ddenn98 » Thu Jul 07, 2016 2:14 pm

ConneXionLost:

Wow!! Worked like a charm!

Many, many thanks and be well.

Dee :D
  • 0

ddenn98
Rookie
 
Posts: 2
Joined: Jul 7, 2016
Reputation: 0
Excel Version: 10


Return to Macros and VBA Questions

Who is online

Users browsing this forum: No registered users and 3 guests

cron