+ Reply to Thread
Results 1 to 8 of 8

Find/len function

  1. #1
    Registered User
    Join Date
    07-19-2013
    Location
    houston
    MS-Off Ver
    Excel 2010
    Posts
    56

    Find/len function

    I have a string tu4-0367-6-3-p16-g. I want to find the text between the u and -. The only problem is sometimes it could be 1 character and sometimes it could be two. I don't think i can use mid and find functions because the character count would change.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,111

    Re: Find/len function

    Is there always a "u" and is there always a hyphen?

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Find/len function

    Try this:

    Please Login or Register  to view this content.
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  4. #4
    Registered User
    Join Date
    07-19-2013
    Location
    houston
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Find/len function

    yes there will always be a u and -

  5. #5
    Registered User
    Join Date
    07-19-2013
    Location
    houston
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Find/len function

    @connexionlost, that returned #value!

  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
    53,048

    Re: Find/len function

    or, if the "u" might be upper case...
    =MID(A1,SEARCH("u",A1,1)+1,SEARCH("-",A1,1)-SEARCH("u",A1,1)-1)
    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

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,111

    Re: Find/len function

    works for me with the sample you provided.

    Of course, the MID function will produce a text string. If you want a numeric value, use:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    ... from ConneXionLost

    or

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    ... from FD


    Regards, TMS

  8. #8
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Find/len function

    Make sure that your text string is in A2 to use the original formula by ConneXionlost.

    All the formulae from everyone worked perfectly.
    Last edited by newdoverman; 07-31-2013 at 07:31 PM.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

+ 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] Problem with Find function. Need to find Exact match
    By SMILE in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-06-2012, 07:07 AM
  2. How does excels find function actually "find" values?
    By 111StepsAhead in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-15-2011, 11:53 AM
  3. find function doesnt find imported info
    By dscott2479 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 07-12-2011, 07:11 PM
  4. Replies: 2
    Last Post: 03-30-2009, 04:04 AM
  5. Using find function to find entries in multiple cells
    By stanigator in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-11-2007, 08:45 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