+ Reply to Thread
Results 1 to 3 of 3

Right Function

  1. #1
    Registered User
    Join Date
    04-23-2004
    Posts
    28

    Right Function

    Hi guys,

    I have to get the last word from text cell.

    For example,

    Mr. and Mrs. Smith

    I need to get Smith. The number of words is changeable.

    Thanks a lot in advance,

    Irina.

  2. #2
    Elkar
    Guest

    RE: Right Function

    Try this:

    =MID(A1,FIND("~",SUBSTITUTE(A1," ","~",LEN(A1)-LEN(SUBSTITUTE(A1,"
    ",""))))+1,1024)

    This basically replaces all spaces in your text with the ~ tilde character,
    except the last one. It then looks for the one remaining space and returns
    all text to the right of that. Note that if your text already contains
    tildes, then you should use a different symbol.

    HTH,
    Elkar


    "Irina" wrote:

    >
    > Hi guys,
    >
    > I have to get the last word from text cell.
    >
    > For example,
    >
    > Mr. and Mrs. Smith
    >
    > I need to get Smith. The number of words is changeable.
    >
    > Thanks a lot in advance,
    >
    > Irina.
    >
    >
    > --
    > Irina
    > ------------------------------------------------------------------------
    > Irina's Profile: http://www.excelforum.com/member.php...fo&userid=8685
    > View this thread: http://www.excelforum.com/showthread...hreadid=501197
    >
    >


  3. #3
    Bob Phillips
    Guest

    Re: Right Function


    "Elkar" <[email protected]> wrote in message
    news:[email protected]...
    > Try this:
    >
    > =MID(A1,FIND("~",SUBSTITUTE(A1," ","~",LEN(A1)-LEN(SUBSTITUTE(A1,"
    > ",""))))+1,1024)
    >
    > This basically replaces all spaces in your text with the ~ tilde

    character,
    > except the last one.


    Actually, it only replaces the last space with tilde.



+ 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