+ Reply to Thread
Results 1 to 6 of 6

Extract numbers before first instance of text

  1. #1
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,702

    Extract numbers before first instance of text

    Hi,

    I have a cell which contains "49423011June14"

    I would like a formula which just extracts the first number up to an occurance of a letter e.g. 49423011

    Can anyone help please?

    Paul

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,076

    Re: Extract numbers before first instance of text

    This array formula seems to work

    =1*MID(A1,MATCH(TRUE,ISNUMBER(1*MID(A1,ROW($1:$9),1)),0),COUNT(1*MID(A1,ROW($1:$9),1)))

    This is limited to 9 numbers
    Increase the $9s if you want more numbers
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,702

    Re: Extract numbers before first instance of text

    Perfect - thank you!!

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Extract numbers before first instance of text

    Also, non-array:

    =LEFT(A1,MATCH(1,INDEX(0+ISERR(0+MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)),,),0)-1)

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,937

    Re: Extract numbers before first instance of text

    =LOOKUP(9^9,LEFT(A1,ROW(1:256))*1,LEFT(A1,ROW(1:256))*1)
    Try this
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Extract numbers before first instance of text

    Quote Originally Posted by nflsales View Post
    =LOOKUP(9^9,LEFT(A1,ROW(1:256))*1,LEFT(A1,ROW(1:256))*1)
    Try this
    You always have to be careful with this type of solution. In general, it will work in 99.9% of cases, but what, for example, if the OP had this string in A1:

    23June14

    (formatted as text, of course), and wanted to extract 23?

    What does your formula give then?

    Regards

+ 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. Extract numbers from Text
    By suhabthan in forum Excel General
    Replies: 6
    Last Post: 01-28-2014, 08:39 AM
  2. How to Extract Text Before Second Instance of a Symbol
    By lionsdeal in forum Excel General
    Replies: 2
    Last Post: 08-04-2009, 02:28 PM
  3. Extract numbers from cell with Text and Numbers
    By wiredwrx in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 04-18-2006, 06:00 PM
  4. [SOLVED] How do I extract numbers from a cell with both text and numbers?
    By SHANNON in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-01-2005, 10:35 PM
  5. [SOLVED] extract numbers from cell containing text & numbers
    By transferxxx@gmail.com in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-14-2005, 03:10 AM

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