Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Picking out 1st letter of names

I have been using the following formula to pick out the 1st letter of words.

=CONCATENATE(LEFT(A2,1),MID(A2,FIND(" ",A2)+1,1))

This has been working fine until there are 3 words in the cell.

I would like to be able to pick out the 1st letter of each word in the cell
no matter how many letters there are. Or to be able to pick out the 1st
letter of the first and last words only.

Words I am using a
Project Manager
Ongoing Specialist Support
Monitoring and Evaluation

I would like the adjacent cells to show:
PM
OSS
ME

Is this possible without going down the route of coding?

Many thanks for your time.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Picking out 1st letter of names

Note that your examples are inconsistent.

Ongoing Specialist Support == OSS
Monitoring and Evaluation == ME

FIrst and last is easy:

=LEFT(A2,1) & MID(A2, FIND("%",SUBSTITUTE(A2," ","%", LEN(A2) -
LEN(SUBSTITUTE(A2," ",""))))+1,1)



In article ,
DianeandChipps wrote:

I have been using the following formula to pick out the 1st letter of words.

=CONCATENATE(LEFT(A2,1),MID(A2,FIND(" ",A2)+1,1))

This has been working fine until there are 3 words in the cell.

I would like to be able to pick out the 1st letter of each word in the cell
no matter how many letters there are. Or to be able to pick out the 1st
letter of the first and last words only.

Words I am using a
Project Manager
Ongoing Specialist Support
Monitoring and Evaluation

I would like the adjacent cells to show:
PM
OSS
ME

Is this possible without going down the route of coding?

Many thanks for your time.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Picking out 1st letter of names

Two or three is easy too:

=LEFT(A2,1) & MID(A2,FIND(" ",A2)+1,1)&IF(LEN(A2)-LEN(SUBSTITUTE(A2," ",
""))1, MID(A2,FIND(" ",A2,FIND(" ",A2)+1)+1,1),"")

but it will produce "MaE", not "ME"

In article ,
JE McGimpsey wrote:

Note that your examples are inconsistent.

Ongoing Specialist Support == OSS
Monitoring and Evaluation == ME

FIrst and last is easy:

=LEFT(A2,1) & MID(A2, FIND("%",SUBSTITUTE(A2," ","%", LEN(A2) -
LEN(SUBSTITUTE(A2," ",""))))+1,1)

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Picking out 1st letter of names

=CONCATENATE(LEFT(A2,1),MID(A2,FIND(" ",A2)+1,1))

First off, for future reference, you don't need to use the CONCATENATE
function to concatenate text together... you can simply join the strings
together with ampersands. Also, if looking for the first character in a LEFT
(or RIGHT) function, you don't need to specify the character count... if you
leave out the 2nd argument, Excel automatically assumes 1 character. So
then, the above is identical to this...

=LEFT(A2)&MID(A2,FIND(" ",A2)+1,1)

Now, to answer your main question... you could probably construct a formula
to do what you want (up to a limit of 30 words I would guess), but the logic
will get messy if you have to skip over lower case leading letters (such as
your "and"). I may look at doing a formula later, but in the meantime, here
is a UDF (User Defined Function) which will do what you want for an
unlimited number of words...

Function FirstLetters(S As String) As String
Dim X As Long
Dim Letter As String
Dim Words() As String
Words = Split(S)
For X = 0 To UBound(Words)
Letter = Left(Words(X), 1)
If Letter = UCase(Letter) Then FirstLetters = FirstLetters & Letter
Next
End Function

If you are unfamiliar with how to install a UDF, it is quite simple. Press
Alt+F11 to go into the VB editor, click Insert/Module on its menu bar and
copy/paste the above UDF into the code window that appears. That is it. Go
back to your worksheet and enter this formula...

=FirstLetters(A2)

and copy it down as needed (you can copy it past your last data if desired).

--
Rick (MVP - Excel)


"DianeandChipps" wrote in message
...
I have been using the following formula to pick out the 1st letter of
words.

=CONCATENATE(LEFT(A2,1),MID(A2,FIND(" ",A2)+1,1))

This has been working fine until there are 3 words in the cell.

I would like to be able to pick out the 1st letter of each word in the
cell
no matter how many letters there are. Or to be able to pick out the 1st
letter of the first and last words only.

Words I am using a
Project Manager
Ongoing Specialist Support
Monitoring and Evaluation

I would like the adjacent cells to show:
PM
OSS
ME

Is this possible without going down the route of coding?

Many thanks for your time.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Picking out 1st letter of names

On Thu, 5 Feb 2009 07:32:30 -0800, DianeandChipps
wrote:

I have been using the following formula to pick out the 1st letter of words.

=CONCATENATE(LEFT(A2,1),MID(A2,FIND(" ",A2)+1,1))

This has been working fine until there are 3 words in the cell.

I would like to be able to pick out the 1st letter of each word in the cell
no matter how many letters there are. Or to be able to pick out the 1st
letter of the first and last words only.

Is this possible without going down the route of coding?


I think *any* number of letters would be difficult without code. However,
you can brute force four letters with this formula

=LEFT(A1,1)&IF(NOT(ISERR(FIND(" ",A1,1))),MID(A1,FIND("
",A1,1)+1,1),"")&IF(NOT(ISERR(FIND(" ",A1,FIND(" ",A1,1)+1))),MID(A1,FIND("
",A1,FIND(" ",A1,1)+1)+1,1),"")&IF(NOT(ISERR(FIND(" ",A1,FIND(" ",A1,FIND("
",A1,FIND(" ",A1,1)+1)+1)))),MID(A1,FIND(" ",A1,FIND(" ",A1,FIND("
",A1,FIND(" ",A1,1)+1)+1))+1,1),"")
--
Dick Kusleika
Microsoft MVP-Excel
http://www.dailydoseofexcel.com


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Picking out 1st letter of names

Many thanks to all that responded, sorry I haven't replied before now as I
have had sight problems.

All suggestions work picking out the first letter of each word.

I even managed Ricks UDF and it ignored the lower case 'and'.

Many thanks again

Diane

"DianeandChipps" wrote:

I have been using the following formula to pick out the 1st letter of words.

=CONCATENATE(LEFT(A2,1),MID(A2,FIND(" ",A2)+1,1))

This has been working fine until there are 3 words in the cell.

I would like to be able to pick out the 1st letter of each word in the cell
no matter how many letters there are. Or to be able to pick out the 1st
letter of the first and last words only.

Words I am using a
Project Manager
Ongoing Specialist Support
Monitoring and Evaluation

I would like the adjacent cells to show:
PM
OSS
ME

Is this possible without going down the route of coding?

Many thanks for your time.

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I include names in formula by picking up names from rows Dilip Excel Worksheet Functions 6 June 8th 09 05:51 PM
Picking names from a hat in Excel? Ashley[_2_] Excel Discussion (Misc queries) 0 May 9th 07 09:37 PM
how to put 'SUM' formula in VB after picking up certain names and their bonus [email protected] Excel Discussion (Misc queries) 11 January 31st 07 10:19 AM
how do i sort a list from cells by picking a specific letter? abecus Excel Discussion (Misc queries) 2 July 4th 06 02:47 PM
FIRST letter of the names, mi and the whole last name. Shadowofthedarkgod Excel Discussion (Misc queries) 11 June 9th 05 11:26 AM


All times are GMT +1. The time now is 05:19 PM.

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

About Us

"It's about Microsoft Excel"