Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
gh gh is offline
external usenet poster
 
Posts: 8
Default AddPeriodToCharaceter

I have a column with a middle initial in some of the cells. I would
like to add a period after the initial and the cells without an initial,
leave empty. Is there a function for this?

TIA
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 623
Default AddPeriodToCharaceter

Substitute might work for you. If the formatting is consistent, it shouldn't be
too hard.

Is the format always FirstName<spaceInitial<spaceLastName?
And without an initial, it's always FirstName<spaceLastName?

If so, you can use Substitute to change the second space to <period<space

If you still need help, post back. Make sure you specify what format the names
are in.

--
Regards,
Fred


"gh" wrote in message
...
I have a column with a middle initial in some of the cells. I would like to
add a period after the initial and the cells without an initial, leave empty.
Is there a function for this?

TIA



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,510
Default AddPeriodToCharaceter

Assume John M Doe is in cell A1. Use following following formula in an
adjacent cell to replace the second instance of a space with a period and a
space. Requires there to be only one space between John M and between M Doe
or ir will place the comma at the second space.

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

For names without the initial and second space, it will simply return the
name as is.

If you have instances of 2 spaces between the names and initials, you can
use Find and Replace to replace all instances of 2 spaces with one space.
Simply type 2 spaces in Find what and one space in Replace with.

--
Regards,

OssieMac


"gh" wrote:

I have a column with a middle initial in some of the cells. I would
like to add a period after the initial and the cells without an initial,
leave empty. Is there a function for this?

TIA

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
gh gh is offline
external usenet poster
 
Posts: 8
Default AddPeriodToCharaceter

Fred Smith wrote:
Substitute might work for you. If the formatting is consistent, it shouldn't be
too hard.

Is the format always FirstName<spaceInitial<spaceLastName?
And without an initial, it's always FirstName<spaceLastName?

If so, you can use Substitute to change the second space to <period<space

If you still need help, post back. Make sure you specify what format the names
are in.

Fred:

The cell only has a middle initial in it or it is empty. There is not a
first or last name. So I want to check the cell for a character and if
it has one, then add a period to it. If not then do nothing.

TIA

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,510
Default AddPeriodToCharaceter

Hi,

It appears that Fred and I both answered simultaneously on your last post
and we both interpreted you request similarly. However, if the cell only
contains one character or empty then assuming that B1 is the cell to test,
you could insert the following into an adjacent cell:-

=IF(B1<"",B1&".","")

You can then Copy the columnwith the formulas and Paste Special - Values
over the original column and then remove the column with the formula.

--
Regards,

OssieMac


"gh" wrote:

Fred Smith wrote:
Substitute might work for you. If the formatting is consistent, it shouldn't be
too hard.

Is the format always FirstName<spaceInitial<spaceLastName?
And without an initial, it's always FirstName<spaceLastName?

If so, you can use Substitute to change the second space to <period<space

If you still need help, post back. Make sure you specify what format the names
are in.

Fred:

The cell only has a middle initial in it or it is empty. There is not a
first or last name. So I want to check the cell for a character and if
it has one, then add a period to it. If not then do nothing.

TIA


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"