+ Reply to Thread
Results 1 to 5 of 5

Excluding text up to the last capital letter from the right

  1. #1
    Registered User
    Join Date
    07-28-2017
    Location
    London
    MS-Off Ver
    2010
    Posts
    5

    Excluding text up to the last capital letter from the right

    Hi all,

    I have had some great help in the past, I’m afraid I need some more…… I have been using the formula below, which will extract the first word up until a 2nd capital letter, for instance ThomsonTravel and it will return Thomson, great. But it does not pick up anyone with a double barrelled name or a name with an apostrophe in it, so I need to tweak the formula but I can’t manage it. What I need it to do is to exclude everything up to the first capital letter starting from the right, so then any funny names shall be picked up and the mode of transport excluded.

    {=TRIM(LEFT(N6,SMALL(FIND(CHAR(ROW(INDIRECT("65:90"))),"x"&MID(N6,2,999)&"ABCDEFGHIJKLMNOPQRSTUVWXYZ"),1)-1))}

    Really appreciate any help with this.

    Cheers,

  2. #2
    Forum Expert Tsjallie's Avatar
    Join Date
    09-15-2012
    Location
    NL
    MS-Off Ver
    2010, 2013, 2016
    Posts
    2,077

    Re: Excluding text up to the last capital letter from the right

    Would this formula work for you?
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    The formula can be extended with any condition needed.
    Notice that it's an array formula. Close it with [Ctrl]+[Shift]+[Enter]
    A1 holds the string you want to split.
    Last edited by Tsjallie; 10-02-2018 at 02:39 PM. Reason: better formula
    Cheers!
    Tsjallie




    --------
    If your problem is solved, pls mark the thread SOLVED (see Thread Tools in the menu above). Thank you!

    If you think design is an expensive waste of time, try doing without ...

  3. #3
    Forum Contributor
    Join Date
    09-19-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    208

    Re: Excluding text up to the last capital letter from the right

    Another option is to use a custom function like the one below, inserted into a standard module. You could then put a simple formula into a cell, e.g. =exclude(N6)
    Please Login or Register  to view this content.
    Last edited by ¯\_(ツ)_/¯; 10-02-2018 at 02:35 PM. Reason: Adjusted code to confirm the char is between A and Z, as lower/upper case SPACE is apparently equivalent too! :)

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Excluding text up to the last capital letter from the right

    Administrative Note:
    HTH
    Regards, Jeff

  5. #5
    Registered User
    Join Date
    07-28-2017
    Location
    London
    MS-Off Ver
    2010
    Posts
    5

    Re: Excluding text up to the last capital letter from the right

    Hi all,

    Thanks very much for the replies, they are very detailed I will try them out.

    Admin - Apologies, I admit I didn't read the rules and I posted this question on another excel forum. Won't do it again, honest guv!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. how do I convert text in excel to 1st letter capital,only
    By Don Guillett in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 07:05 AM
  2. [SOLVED] how do I convert text in excel to 1st letter capital,only
    By Don Guillett in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 06:05 AM
  3. [SOLVED] how do I convert text in excel to 1st letter capital,only
    By Don Guillett in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 04:05 AM
  4. [SOLVED] how do I convert text in excel to 1st letter capital,only
    By jmfp in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  5. how do I convert text in excel to 1st letter capital,only
    By jmfp in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  6. [SOLVED] how do I convert text in excel to 1st letter capital,only
    By jmfp in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM
  7. how do I convert text in excel to 1st letter capital,only
    By jmfp in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-16-2005, 04:05 PM
  8. capital letter in text Box
    By Syed Haider Ali in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-21-2005, 10:51 AM

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