Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
mikeburg
 
Posts: n/a
Default Fromula to take employee # out of employee name field


I have employee names & numbers in column A. For example, in A1 there
is

John A Doe 157

What would be the best formula or function to put only the employee
(without the employee number) in cell B1?

I tried =Left(A1, 10) but the number of characters from the left is not
always 10. They can vary from 6 to 30.

Any ideas? mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=466249

  #2   Report Post  
Dave O
 
Posts: n/a
Default

If the white space after Doe is a series of spaces, you can use this
formula:
=MID(A1,1,FIND(" ",A1,1)-1)
This uses the MID() function and returns the characters that occur
ahead of 3 blank spaces in the cell.

  #3   Report Post  
CLR
 
Posts: n/a
Default

If the format was always the same, ie FirstName MiddleInitial LastName
EmployeeNumber, then you could use the Data TextToColums Delimited, using
space as a delimiter......this would separate each secion of the text into
it's own column.......then you could just CONCATENATE the name back together
if you wish..

Vaya con Dios,
Chuck CABGx3

"mikeburg" wrote:


I have employee names & numbers in column A. For example, in A1 there
is

John A Doe 157

What would be the best formula or function to put only the employee
(without the employee number) in cell B1?

I tried =Left(A1, 10) but the number of characters from the left is not
always 10. They can vary from 6 to 30.

Any ideas? mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=466249


  #5   Report Post  
Max
 
Posts: n/a
Default

Think you could also try this option taken from a post by Harlan:
( http://tinyurl.com/amdm3 )

" .. If the ending substring could be variable length but always preceded by
a space, it's possible to use

=LEFT(TRIM(A1),LOOKUP(2,1/(MID(TRIM(A1),ROW(INDIRECT("1:256")),1)="
"),ROW(INDIRECT("1:256")))-1)

This relies on the functionality of the LOOKUP formula as it's worked
from Excel 97 through Excel 2003 (and probably in earlier versions as
well). "

--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"mikeburg" wrote in
message ...

I have employee names & numbers in column A. For example, in A1 there
is

John A Doe 157

What would be the best formula or function to put only the employee
(without the employee number) in cell B1?

I tried =Left(A1, 10) but the number of characters from the left is not
always 10. They can vary from 6 to 30.

Any ideas? mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile:

http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=466249





  #6   Report Post  
Dave Peterson
 
Posts: n/a
Default

An unfortunate linebreak.

=LEFT(TRIM(A1),LOOKUP(2,1/(MID(TRIM(A1),ROW(INDIRECT("1:256")),1)=" "),
ROW(INDIRECT("1:256")))-1)

(all one cell)

Max wrote:

Think you could also try this option taken from a post by Harlan:
( http://tinyurl.com/amdm3 )

" .. If the ending substring could be variable length but always preceded by
a space, it's possible to use

=LEFT(TRIM(A1),LOOKUP(2,1/(MID(TRIM(A1),ROW(INDIRECT("1:256")),1)="
"),ROW(INDIRECT("1:256")))-1)

This relies on the functionality of the LOOKUP formula as it's worked
from Excel 97 through Excel 2003 (and probably in earlier versions as
well). "

--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"mikeburg" wrote in
message ...

I have employee names & numbers in column A. For example, in A1 there
is

John A Doe 157

What would be the best formula or function to put only the employee
(without the employee number) in cell B1?

I tried =Left(A1, 10) but the number of characters from the left is not
always 10. They can vary from 6 to 30.

Any ideas? mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile:

http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=466249


--

Dave Peterson
  #7   Report Post  
Max
 
Posts: n/a
Default

Thanks, Dave !
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--


  #8   Report Post  
mikeburg
 
Posts: n/a
Default


Thank you for everyones wonderful help.

mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=466249

  #9   Report Post  
Max
 
Posts: n/a
Default

You're welcome, Mike !

With the plethora of responses,
you're really spoilt for choice here ! <g
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--


  #10   Report Post  
Domenic
 
Posts: n/a
Default

Here's another way...

=TRIM(LEFT(A1,SEARCH("^^",SUBSTITUTE(A1,"
","^^",LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))))

Hope this helps!

In article ,
mikeburg
wrote:

I have employee names & numbers in column A. For example, in A1 there
is

John A Doe 157

What would be the best formula or function to put only the employee
(without the employee number) in cell B1?

I tried =Left(A1, 10) but the number of characters from the left is not
always 10. They can vary from 6 to 30.

Any ideas? mikeburg



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
employee annual sick leave tracker with hours owing not used Melanie Excel Discussion (Misc queries) 0 July 21st 05 06:33 AM
Referencing a newly created worksheet Charyn Excel Worksheet Functions 2 May 2nd 05 04:13 AM
if sum rb Excel Worksheet Functions 2 April 20th 05 09:28 PM
employee scheduling Phil Excel Worksheet Functions 1 March 28th 05 10:00 PM
Employee schedule: I want it to calculate time entered such as 11. Atlanta Rudy Excel Discussion (Misc queries) 2 January 6th 05 05:19 AM


All times are GMT +1. The time now is 01:25 AM.

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"