+ Reply to Thread
Results 1 to 4 of 4

Extract a specific portion of a text string in Excel?

  1. #1
    Registered User
    Join Date
    05-17-2010
    Location
    Calgary
    MS-Off Ver
    Excel 2007
    Posts
    12

    Extract a specific portion of a text string in Excel?

    I'm positive this is possible to do, but I can't seem to figure out the right functions and order.

    I want to extract a specific portion of a text, namely if I have the following in a cell as a result of using =CELL("filename",A1):

    C:\Personal Files\[Filename Rev. CCC.xls]
    or
    C:\Personal Files\[Filename Rev. 23.xls]

    I want to get a cell to have only the information between "Rev." and ".xls" (i.e. get CCC or 23 in the above examples). How would I accomplish this?

    (As a side note, when I do =CELL("filename",A1) the filename has an extra space at the end. Any way to get rid of that?)
    Last edited by drawkcaB; 05-18-2010 at 01:58 PM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Extract a specific portion of a text string in Excel?

    Hi,

    One way

    Please Login or Register  to view this content.
    HTH
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Extract a specific portion of a text string in Excel?

    Try this formula, where A1 is where you have your =CELL formula.

    To eliminate extra blanks use the TRIM function.

    =SUBSTITUTE(RIGHT(A1,LEN(A1)-FIND("Rev.",A1)-4),".xls]","")
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Registered User
    Join Date
    05-17-2010
    Location
    Calgary
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Extract a specific portion of a text string in Excel?

    6StringerJazzer's formula did the trick. Richard's would have worked but I didn't supply the full path name. Since it has some other period in it it returned the wrong bit of information.

    Thanks for the help from both of you!

+ 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