+ Reply to Thread
Results 1 to 5 of 5

Capture right text string

  1. #1
    Registered User
    Join Date
    07-12-2004
    Posts
    32

    Capture right text string

    Hi there

    Please can someone advise how I can grab the right-most text string after a space e.g.

    North West London NW - I would want to grab 'NW'.

    Many thanks

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,902
    Try

    =MID(A1,FIND("#",SUBSTITUTE(A1," ","#",LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))+1,255)


    Where A1 houses original string
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    07-12-2004
    Posts
    32
    Thanks very much!!

  4. #4
    Cheeky Forum Moderator Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Capture right text string

    With A1 containing text

    This formula returns the text following the last space in that cell:
    B1: =TRIM(VLOOKUP(" *",INDEX(RIGHT(" "&A1,ROW($A$1:INDEX($A:$A,LEN(" "&A1),1))),0),1,0))

    Does that help?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  5. #5
    Forum Moderator daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,676
    Assuming your last "word" has less than 99 characters

    =TRIM(RIGHT(SUBSTITUTE(TRIM(A1)," ",REPT(" ",99)),99))

+ 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