+ Reply to Thread
Results 1 to 3 of 3

Finding the final occurence of a space in a string

  1. #1
    Registered User
    Join Date
    01-12-2012
    Location
    NY
    MS-Off Ver
    Excel 2007
    Posts
    4

    Finding the final occurence of a space in a string

    I'll apologize in advance if this has already been done. I did a search for "final occurence of a space in a string" and didn't see anything that matched.

    I have a cell that has a string with multiple spaces.

    I need to find the position of the last space.

    So

    AAA BB CC DD EEE FF

    I need to find the value of the space between EEE and FF

    Basically, a find or search function, but that searches right to left instead of left to right.
    Last edited by barts185; 01-12-2012 at 09:04 PM. Reason: Solved

  2. #2
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Finding the final occurence of a space in a string

    Try,

    =FIND("^",SUBSTITUTE(A1," ","^",LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))

    Or,

    =LOOKUP(9E300,FIND("^",SUBSTITUTE(A1," ","^",ROW(A$1:A$1000))))
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  3. #3
    Registered User
    Join Date
    01-12-2012
    Location
    NY
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Finding the final occurence of a space in a string

    Thank you! They both worked.

+ 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