+ Reply to Thread
Results 1 to 7 of 7

need help in MID & RIGHT function

  1. #1
    Forum Contributor
    Join Date
    01-14-2004
    Location
    India
    MS-Off Ver
    365
    Posts
    264

    need help in MID & RIGHT function

    Hello everyone
    I am using the following formula in C1 to get the file name.
    =CELL("filename",A1) and I am getting the following result. That is fine


    C:\Users\tom\Desktop\list(1)\[list dec 2012.xlsx]CLIST (4)

    I need a formula to place in D1 where I should get the result 4.
    That is the number appear in the braket. I know, I should use MID and RIGHT and FIND functions. Sometimes it is 2digit number. I am lost when I connect all together.
    Can someone fix for me.
    Thanks
    Appreciate clicking the * Add Reputation button on your left side, if you want say thanks to me

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: need help in MID & RIGHT function

    If the brackets are always at the end preceded by a space try this formula

    =RIGHT(C1,4)*-1
    Audere est facere

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,609

    Re: need help in MID & RIGHT function

    There can be several "(" but rather no nore than one "]"
    so you can start with locating ] and then find ( and ) in what is right from ]

  4. #4
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: need help in MID & RIGHT function

    try this :

    Please Login or Register  to view this content.
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

  5. #5
    Forum Contributor
    Join Date
    01-14-2004
    Location
    India
    MS-Off Ver
    365
    Posts
    264

    Re: need help in MID & RIGHT function

    @daddylonglegs..
    Thanks for the solution, but that formula works only if the number in the braket is one digit.
    What about if the file name is C:\Users\tom\Desktop\list(1)\[list dec 2012.xlsx]CLIST (423). I need a solution where the number varies.
    Thanks

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: need help in MID & RIGHT function

    Quote Originally Posted by SMILE View Post
    Sometimes it is 2digit number.
    I assumed that meant it would be limited to 2 digits - my suggestion should work for 1 or 2

    For up to 5 digits try this

    =LOOKUP(10^6,RIGHT(C1,{3,4,5,6,7})*-1)
    Last edited by daddylonglegs; 01-26-2014 at 05:49 AM.

  7. #7
    Forum Contributor
    Join Date
    01-14-2004
    Location
    India
    MS-Off Ver
    365
    Posts
    264

    Re: need help in MID & RIGHT function

    @daddylonglegs... again your formula limits number of digits... but thanks for the help
    @Xlbiznes.. your formula works ok...

    More than the solution, I got idea from you all...
    Thanks a lot

+ 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. Replies: 2
    Last Post: 01-15-2014, 11:40 PM
  2. index function error using match function to get data from a cell in an array
    By mabildgaard in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-17-2013, 02:21 AM
  3. Replies: 1
    Last Post: 03-21-2012, 11:22 AM
  4. Replies: 2
    Last Post: 03-20-2009, 01:29 PM
  5. [SOLVED] Excel - User Defined Function Error: This function takes no argume
    By BruceInCalgary in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2006, 04:05 PM

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