+ Reply to Thread
Results 1 to 5 of 5

formula to remove text at end of string???

  1. #1
    Registered User
    Join Date
    11-28-2006
    Posts
    55

    formula to remove text at end of string???

    Hi

    I am importing some data into a spreadsheet from a .txt file.
    The data is imported with the unit identifier as text where as i just need the number.
    i.e.
    imported value: 1316 ML
    Required value: 1316

    The values imported change i.e. could be 10 ML or 50000 ML therefore i cant just use a LEFT or RIGHT formula.

    Any ideas?

    Must be a simple fix to this.

    Thanks

  2. #2
    Registered User
    Join Date
    11-28-2006
    Posts
    55

    P.s.

    It must do this by linking a formula to the cell so that it is automatic.
    I cant just select the data and select text to columns etc.

    Many thanks

  3. #3
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Try something like this,

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


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Select the Column > press ctrl + H > find box press the space bar once for the space then enter ML > leave the replace box empty and replace all

    Or with formulas

    =LEFT(A1,FIND(" ",A1))
    or
    =SUBSTITUTE(A1," ML","")
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  5. #5
    Registered User
    Join Date
    11-28-2006
    Posts
    55

    Cheers

    Thanks very much. The substitute formula worked a treat.

    Cheers

+ 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