+ Reply to Thread
Results 1 to 10 of 10

Fromula to take employee # out of employee name field

  1. #1
    Forum Contributor
    Join Date
    06-23-2005
    Posts
    253

    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

  2. #2
    Dave O
    Guest

    Re: Fromula to take employee # out of employee name field

    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. #3
    CLR
    Guest

    RE: Fromula to take employee # out of employee name field

    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
    >
    >


  4. #4
    Don Guillett
    Guest

    Re: Fromula to take employee # out of employee name field

    see if this works to get a number from the string

    =VALUE(RIGHT(A1,LEN(A1)-FIND(" ",A1)))
    --
    Don Guillett
    SalesAid Software
    [email protected]
    "mikeburg" <[email protected]> wrote in
    message news:[email protected]...
    >
    > 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. #5
    Max
    Guest

    Re: Fromula to take employee # out of employee name field

    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" <[email protected]> wrote in
    message news:[email protected]...
    >
    > 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. #6
    Dave Peterson
    Guest

    Re: Fromula to take employee # out of employee name field

    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" <[email protected]> wrote in
    > message news:[email protected]...
    > >
    > > 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. #7
    Domenic
    Guest

    Re: Fromula to take employee # out of employee name field

    Here's another way...

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

    Hope this helps!

    In article <[email protected]>,
    mikeburg <[email protected]>
    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


  8. #8
    Max
    Guest

    Re: Fromula to take employee # out of employee name field

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



  9. #9
    Forum Contributor
    Join Date
    06-23-2005
    Posts
    253
    Thank you for everyones wonderful help.

    mikeburg

  10. #10
    Max
    Guest

    Re: Fromula to take employee # out of employee name field

    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
    --



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1