+ Reply to Thread
Results 1 to 5 of 5

Taking out numbers in a cell

  1. #1
    Registered User
    Join Date
    07-16-2008
    Location
    NH
    Posts
    2

    Taking out numbers in a cell

    Is it possible to take just the numbers in a cell and calculate them?

    For Example if I have 'Price: $50' in cell A1, is there a formula to take just the 50 then divide it by 2 or something like that?

  2. #2
    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
    Maybe

    =LOOKUP(99^99,--(0&MID(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&1234567890)),ROW(INDIRECT("1:"&LEN(A1)+1)))))/2
    Formula from this link

    http://www.excelforum.com/showthread.php?t=630231

    Always worth searching the site first

    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 !!!

  3. #3
    Registered User
    Join Date
    07-16-2008
    Location
    NH
    Posts
    2
    Thanks

    I tried searching and I just got a blank page. I'm not sure if it was because it didn't find it or it had an error. I probably did something wrong or didn't search the right thing.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Just click the link and give the page enough time to load.

    That said, unless you're dealing with legacy data and have absolutely no alternative, mixing words and numbers is terrible practice.
    Last edited by shg; 07-16-2008 at 03:01 PM.

  5. #5
    Forum Expert
    Join Date
    12-24-2004
    Location
    Sweden
    Posts
    1,256

    One alternative

    If the text starts with a $ sign and has a 1000 Separator:
    "The price is $50,000 for the car."

    You could use:
    =SUBSTITUTE(LEFT(MID(A1,1+FIND("$",A1),256)&" ",FIND(" ",MID(A1,1+FIND("$",A1),256)&" ")-1),",","")
    //Ola

+ 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