+ Reply to Thread
Results 1 to 12 of 12

Various length alphanumeric field with and without a dash - need to extract numbers

Hybrid View

  1. #1
    Registered User
    Join Date
    12-12-2012
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Various length alphanumeric field with and without a dash - need to extract numbers

    Sorry, I'm just now realizing that the posts were from two different people. Thought it was the same source.

    Ok, I just tested......for the example BSHPFRSUR46020-200, it is returning 020 versus just 20. And it is making the answer all text, whereas they need to be values, so that I can calculate on them. I could just multiple the result by 1 to turn into a value. But, what about the 020 versus the needed 20?

    Thanks

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Various length alphanumeric field with and without a dash - need to extract numbers

    I'd assumed you might want to see the leading zeros.
    Since you don't, try this slight variation:
    B2: =INDEX(--RIGHT(LEFT(A1,FIND("-",A1&"-")-1),{3,2,2}),MATCH(1,--ISNUMBER(--RIGHT(LEFT(A1,FIND("-",A1&"-")-1)
    ,{5,4,3})),0))
    or 
    B2: =IFERROR(INDEX(--RIGHT(LEFT(A1,FIND("-",A1&"-")-1),{3,2,2}),MATCH(1,--ISNUMBER(--RIGHT(LEFT(A1,FIND("-",A1&"-")-1)
    ,{5,4,3})),0)),"")
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

+ 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