+ Reply to Thread
Results 1 to 4 of 4

Return 2 digit numeral from either side of - in an alpha numeric string

  1. #1
    Registered User
    Join Date
    07-22-2017
    Location
    Toowoomba
    MS-Off Ver
    2010
    Posts
    23

    Return 2 digit numeral from either side of - in an alpha numeric string

    Hi Everyone

    I am trying to write a formula to return the 1-2 digit numeral to the left and right of a - in an alpha numeric string

    e.g., Group 12-18 returns 12 and 18

    Thanks

    Scott

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,493

    Re: Return 2 digit numeral from either side of - in an alpha numeric string

    Easy for the example you have given us, but I'd like to bet the real problem is much more complex. Nonetheless, here we go for starters, assuming your text string is in A1:

    Excel 2016 (Windows) 32 bit
    B
    C
    1
    =MID(A1,FIND("-",A1)-2,2) =RIGHT(A1,2)
    Sheet: Sheet1
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    07-22-2017
    Location
    Toowoomba
    MS-Off Ver
    2010
    Posts
    23

    Re: Return 2 digit numeral from either side of - in an alpha numeric string

    You are great!! I was stumped on the MID formula and just couldn't work it out. I am writing a conditional formatting formula that turns red if the client's age is outside a given are range or becomes outside the age range. The age ranges change depending on the group assigned. Thank you.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,493

    Re: Return 2 digit numeral from either side of - in an alpha numeric string

    So it WAS as simple as that - great!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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: 20
    Last Post: 09-27-2019, 10:11 AM
  2. Replies: 6
    Last Post: 05-19-2017, 05:34 PM
  3. [SOLVED] Return latest Alpha / Numeric / Numeric Alpha Revision
    By cthompson30 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-16-2017, 10:31 AM
  4. Return Location of Alpha/Numeric String
    By Greg777 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-27-2011, 08:18 PM
  5. Extracting Numeric Values from an Alpha/Numeric String
    By Delkath in forum Excel General
    Replies: 5
    Last Post: 10-27-2010, 02:36 PM
  6. Replies: 2
    Last Post: 06-18-2010, 05:10 PM
  7. sorting alpha numeric list by first left digit
    By kaduna in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 01-13-2006, 07:15 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