+ Reply to Thread
Results 1 to 3 of 3

Extracting data from a text string

  1. #1
    Forum Contributor
    Join Date
    02-08-2005
    MS-Off Ver
    Microsoft 365
    Posts
    810

    Extracting data from a text string

    Hi,

    I have a few hundred rows of text in the fomat below:

    1.23456 xxxxxxxxxxxxxxxxxxxx

    The “x’s” represent text which is unique to each row. Can someone please tell me what formula I need to extract the number (1.23456) at the start of the string? To complicate things the number may be reported to any number of decimal places, so the formula needs to be able to extract the first block of digits at the start of each row and report it as a number that can be used in calculations.

    Thanks!
    Last edited by andrewc; 09-08-2009 at 08:12 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Extracting data from a text string

    This formula will extract everything before the first space character:

    =LEFT(A1,FIND(" ",A1)-1)

    Although the result is still a text string, you can do math on it, Excel is pretty slick about recognizing the string is a usable number. Or you can add +0 to the end to get an actual number.

    =LEFT(A1,FIND(" ",A1)-1)+0
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    02-08-2005
    MS-Off Ver
    Microsoft 365
    Posts
    810

    Re: Extracting data from a text string

    Perfect! Thanks very much!!!

+ 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