+ Reply to Thread
Results 1 to 3 of 3

Extract String

  1. #1
    Registered User
    Join Date
    05-08-2010
    Location
    Akron, OH
    MS-Off Ver
    Excel 2007
    Posts
    1

    Extract String

    I have a string of the for nn:nnn and I want to extract the digits represented by n's. The number to the right of the colon is always 3 digits. The number to the left of the colon is either 1,2, or 3 digits. How can I extract these two numbers.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Extract String

    is this a time? well probably not since there are 3 to right so

    =LEFT(A1,FIND(":",A1)-1) and
    =right(a1,3)
    Last edited by martindwilson; 05-08-2010 at 08:24 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Extract String

    Hi and welcome to the forum

    For the left two numbers: =LEFT(A1,SEARCH(":",A1)-1)
    For th right 3 numbers =RIGHT(A1,LEN(A1)-SEARCH(":",A1))
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

+ 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