+ Reply to Thread
Results 1 to 5 of 5

Find last space in a cell

  1. #1
    Registered User
    Join Date
    07-28-2004
    Posts
    8

    Smile Find last space in a cell

    Hi all,

    I am looking for a formula that will find the last dash ("-" character) in a cell, which allows me to use that in a RIGHT or MID function to isolate that cell contents right of that "-" character into a new cell.

    E.g.
    Cell A1: "Abbar & Zainy Cold Stores-Maintenance-Warehouse Maintenance Manager.doc"

    Using the formula, cell B1 would contain "Warehouse Maintenance Manager.doc"

    Many thanks,
    Basz
    Last edited by Basz; 01-31-2011 at 09:25 AM. Reason: Question solved

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

    Re: Find last space in a cell

    Try:

    =TRIM(MID(A1,FIND("^^",SUBSTITUTE(A1,"-","^^",LEN(A1)-LEN(SUBSTITUTE(A1,"-",""))))+1,255))
    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
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Find last space in a cell

    one possibility:

    Please Login or Register  to view this content.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,810

    Re: Find last space in a cell

    Try this:

    =RIGHT(A1,LEN(A1)-FIND("-",A1,FIND("-",A1)+1))

    Alan
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Registered User
    Join Date
    07-28-2004
    Posts
    8

    Re: Find last space in a cell

    Brilliant!

    All solutions worked fine, thanks everybody!
    Basz

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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