+ Reply to Thread
Results 1 to 13 of 13

[SOLVED] Need a formula only pick up the name between - and :

  1. #1
    Forum Contributor
    Join Date
    06-07-2013
    Location
    US
    MS-Off Ver
    Excel 365
    Posts
    485

    [SOLVED] Need a formula only pick up the name between - and :

    Hello,

    I am looking for a formula that will pick up the names in between a - and a :

    I have attached a sample file here.

    Thank you for the help.
    Attached Files Attached Files
    Last edited by jackson_hollon; 01-18-2016 at 10:23 PM.

  2. #2
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Need a formula only pick up the name between - and :

    Try this

    Please Login or Register  to view this content.
    Happy with my advice? Click on the * reputation button below

  3. #3
    Forum Contributor
    Join Date
    06-07-2013
    Location
    US
    MS-Off Ver
    Excel 365
    Posts
    485

    Re: Need a formula only pick up the name between - and :

    Crooza,

    It works as needed. Thank you very much.

  4. #4
    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,946

    Re: [SOLVED] Need a formula only pick up the name between - and :

    Another version...
    =LEFT(MID(A1,FIND(" - ",A1,1)+3,99),FIND(":",MID(A1,FIND(" - ",A1,1)+3,99),1)-1)
    or this...
    =MID(A1,FIND(" - ",A1,1)+3,FIND(":",A1)-FIND("-",A1)-2)
    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

  5. #5
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: [SOLVED] Need a formula only pick up the name between - and :

    @Ford

    those two formulas only seem to work when there is a colon. Some of the examples in the spreadsheet were of the form

    Exp Rpt - Simbu, Carol

  6. #6
    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,946

    Re: [SOLVED] Need a formula only pick up the name between - and :

    Good catch Crooza....
    =MID(A1,FIND(" - ",A1,1)+3,IFERROR(FIND(":",A1)-FIND("-",A1)-2,99))

  7. #7
    Forum Contributor
    Join Date
    06-07-2013
    Location
    US
    MS-Off Ver
    Excel 365
    Posts
    485

    Re: [SOLVED] Need a formula only pick up the name between - and :

    Ford,

    It works perfect as well.

    Thanks for the help.

    Jackson

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2405
    Posts
    13,424

    Re: [SOLVED] Need a formula only pick up the name between - and :

    And for good measure ... the kitchen sink.

    =TRIM(MID(SUBSTITUTE(SUBSTITUTE(A1,":",REPT(" ",256)),"-",REPT(" ",256)),256,256))
    Dave

  9. #9
    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,946

    Re: [SOLVED] Need a formula only pick up the name between - and :

    Happy to help and thanks for the feedback

  10. #10
    Forum Contributor
    Join Date
    06-07-2013
    Location
    US
    MS-Off Ver
    Excel 365
    Posts
    485

    Re: [SOLVED] Need a formula only pick up the name between - and :

    Dave,

    Could you please tell me what is the 256 mean? Why do we need to use 256? Thanks for the help.

    jackson

  11. #11
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2405
    Posts
    13,424

    Re: [SOLVED] Need a formula only pick up the name between - and :

    Jackson,

    The 256 is there to insert an arbitrarily large number of spaces. This introduces enough "padding" into the string to allow ease of string functions like LEFT, RIGHT and of course MID without chopping off desirable portions of the string as you step through it. Typically this is followed with TRIM wrapped around the formula. This removes all leading / trailing and repeating spaces.

    The choice of 256 is one of my habits. It is almost always large enough .... you will sometimes see 99, 20 .... other. The choice depends largely upon what the risk is of chopping off the "keeper" parts. The smaller the number usually the greater that risk. I find the longer the string, the more parsing to be done, the longer the "keeper" parts usually the larger the number I use. 256 is almost always comfortable and safe.

    Did this help?

  12. #12
    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,946

    Re: [SOLVED] Need a formula only pick up the name between - and :

    Ft used 256, if you look at the end of my suggestion, I used 99 (for a slightly different function, but for the same reason)

  13. #13
    Forum Contributor
    Join Date
    06-07-2013
    Location
    US
    MS-Off Ver
    Excel 365
    Posts
    485

    Re: [SOLVED] Need a formula only pick up the name between - and :

    FlameRetired,

    It really helped. Thank you for the explanation.

    Ford,

    Now I got why you used 99. Thanks for the help again.

    Jackson

+ 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. Formula to Pick data
    By Sri.n in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-22-2014, 01:43 PM
  2. Help regarding a formula to pick details
    By MYEM1983 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-22-2014, 07:02 AM
  3. Pick diff pick list as per column value
    By ROHAN999 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 11-10-2013, 12:10 PM
  4. MAX don't pick up MID formula range
    By micope21 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-17-2013, 06:45 AM
  5. Pick a name from a list for use in a formula
    By junglehat in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-03-2013, 08:34 PM
  6. Replies: 3
    Last Post: 05-21-2013, 06:02 AM
  7. Excel 2007 : Pick-List pick fills in another cell
    By hpasso217 in forum Excel General
    Replies: 0
    Last Post: 02-28-2011, 05:38 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