+ Reply to Thread
Results 1 to 3 of 3

Convert text string, to single number based on number in string.

  1. #1
    Registered User
    Join Date
    04-09-2013
    Location
    US
    MS-Off Ver
    Office 2010, amd 365
    Posts
    30

    Convert text string, to single number based on number in string.

    I am attempting to convert a field with a sting to an interger based off the first number after the hypen.

    17-103456 -> 1
    17-123456 -> 1
    17-201265 -> 2
    17-202222 -> 2

    I have tried using =TEXT but I haven't been to able get the right formula.

    I would appreciate any help you could provide.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Convert text string, to single number based on number in string.

    Try this.

    =MID(A1,SEARCH("-",A1)+1,1)

    Note, this will return text value, if you need to convert it to a numeric value try one of these.

    =MID(A1,SEARCH("-",A1)+1,1)+0

    =MID(A1,SEARCH("-",A1)+1,1)*1

    =VALUE(MID(A1,SEARCH("-",A1)+1,1))
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    04-09-2013
    Location
    US
    MS-Off Ver
    Office 2010, amd 365
    Posts
    30

    Re: Convert text string, to single number based on number in string.

    the top one worked like a charm.

    Thanks so much for the help. saves me from going through 3600 records.

    Kent

+ 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: 5
    Last Post: 01-19-2017, 12:44 AM
  2. Generating random number string based on Alphanumeric String
    By ridemeve in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-15-2014, 04:56 PM
  3. Convert Number to Text string
    By jonesad in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-24-2014, 05:46 AM
  4. How to convert a text string to a number?
    By drkenrich in forum Excel General
    Replies: 1
    Last Post: 11-15-2012, 10:16 PM
  5. Replies: 1
    Last Post: 01-25-2010, 12:48 PM
  6. RE: How to COnvert text string to number
    By Anki in forum Excel General
    Replies: 0
    Last Post: 06-04-2005, 12:05 AM
  7. [SOLVED] Re: How to COnvert text string to number
    By timtak in forum Excel General
    Replies: 2
    Last Post: 06-03-2005, 01:05 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