+ Reply to Thread
Results 1 to 5 of 5

extracting just numbers from a cell

  1. #1
    Registered User
    Join Date
    10-09-2006
    Posts
    13

    extracting just numbers from a cell

    Hey guys,

    I have a problem. I have cells that look like this: "MBU_23.5" and alternatively some that look like this "34.0"

    Is there any way I can just extract the numbers from these cells? ie, in the first example, I need just "23.5" and in the second "34.0".

    Any simple way to do this? Does excel have a built in function for this?

    Thanks!

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482
    Go to this site for a VBA function that works..

    http://www.ozgrid.com/VBA/ExtractNum.htm

  3. #3
    Forum Contributor
    Join Date
    10-14-2004
    Location
    San Diego, CA
    Posts
    213
    Hello Dermot81

    If the "_", character is a constant then use this.

    =--MID(A1,FIND("_",A1)+1,LEN(A1))


    Matt

  4. #4
    Valued Forum Contributor
    Join Date
    03-25-2004
    Location
    Boston, MA US
    Posts
    1,094
    Dermot81,

    Dave Peterson posted this solution for the same problem a while back.

    =VALUE(MID(A1,MIN(IF(ISNUMBER(--MID(A1,ROW($1:$10000),1)),ROW($1:$10000))),MAX(IF(ISNUMBER(--MID(A1,ROW($1:$10000),1)),ROW($1:$10000)))-MIN(IF(ISNUMBER(--MID(A1,ROW($1:$10000),1)),ROW($1:$10000)))+1))

    This is an array formula and must be commited with Ctrl+Shift+Enter not just Enter.

    HTH

    Steve

  5. #5
    Registered User
    Join Date
    10-09-2006
    Posts
    13
    Thanks all for the help.

    Got it to work

    Edit: Quick question, though; what does the "--" do?

+ 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