+ Reply to Thread
Results 1 to 5 of 5

left, mid?

  1. #1
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    left, mid?

    Hello. What would be a good formula for turning this Daily Numbers Report - Summary_2014-01-26-06-02-17.xls into this Daily Numbers Report - Summary_2014-01-26.xls

    I imagine it would be something with left, or mid, or something but not very good at those formulas. Thanks.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: left, mid?

    If that is in a cell - say A1, then maybe...
    =LEFT(A1,SEARCH("_",A1,1)+10)&".xls"
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    Re: left, mid?

    Thanks. That works. Can you explain what the formula is doing? : )

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: left, mid?

    This one should work too

    =SUBSTITUTE(A1,RIGHT(A1,13),"")&".xls"
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: left, mid?

    Nice shortcut, Al

    =LEFT(A1,SEARCH("_",A1,1)+10)&".xls"

    Using your sample...Daily Numbers Report - Summary_2014-01-26-06-02-17.xls
    1st thing, it searches for the position of the underscore in the string...
    SEARCH("_",A1,1).....31
    Then, we know that you have a date with "-" in it, that is 10 characters long, so...
    SEARCH("_",A1,1)+10....41

    This gives us the number of characters we need to use in teh LEFT() fucntion
    =LEFT(A1,SEARCH("_",A1,1)+10).....Daily Numbers Report - Summary_2014-01-26

    Finally, we add .xls to the end of that string...
    =LEFT(A1,SEARCH("_",A1,1)+10)&".xls"

    Hope that helps?

+ 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. [SOLVED] If 5 days left then MsgBox "5 Days Left"
    By HerryMarkowitz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-12-2014, 11:59 AM
  2. Collapse columns from left to right (not right to left)
    By SiriS in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-26-2013, 04:00 PM
  3. [SOLVED] LEFT(A1,3) or LEFT(RC[-1],3) which one is more speedy ?
    By nur2544 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-27-2013, 02:23 AM
  4. Automated =Left, =Left(Right), =Right & Concatenate
    By mikeconomy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-29-2011, 08:07 AM
  5. Replies: 1
    Last Post: 07-04-2005, 09:05 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