+ Reply to Thread
Results 1 to 4 of 4

Cannot format data after using mid() function

  1. #1
    ()
    Guest

    Cannot format data after using mid() function

    Have a strange problem after doing the following with Excel 2000 on a
    PC:
    1. split up cell using text-to-column on: "(391.281, 15.220)"
    2. Use MID(), e.g. "=MID(A11,2,8)" to strip off the parenthesis on
    "(391.281"
    I use Num_chars=8 because that is the maximum string length I
    encounter

    After that the cells containing those values cannot be reformatted to a
    number by any menu or toolbar actions, and there is no warning that it
    does not succeed.

    Only thing that works is to apply "=VALUE()" to the result.

    Is this expected behavior?
    Thanks


  2. #2
    Ron Coderre
    Guest

    RE: Cannot format data after using mid() function

    Yes....The MID function converts its first argument to text and returns a
    value AS text. To have a number returned, you need to either use the MID
    fundtion result in a numeric function OR....the generally accepted method is
    to use a double-negative operator:

    =--MID(A11,2,8)

    Does that help?

    ***********
    Regards,
    Ron

    XL2002, WinXP-Pro


    "()" wrote:

    > Have a strange problem after doing the following with Excel 2000 on a
    > PC:
    > 1. split up cell using text-to-column on: "(391.281, 15.220)"
    > 2. Use MID(), e.g. "=MID(A11,2,8)" to strip off the parenthesis on
    > "(391.281"
    > I use Num_chars=8 because that is the maximum string length I
    > encounter
    >
    > After that the cells containing those values cannot be reformatted to a
    > number by any menu or toolbar actions, and there is no warning that it
    > does not succeed.
    >
    > Only thing that works is to apply "=VALUE()" to the result.
    >
    > Is this expected behavior?
    > Thanks
    >
    >


  3. #3
    MH
    Guest

    Re: Cannot format data after using mid() function

    Yep, MID() returns a string, not a number. Use the function
    =Value(Mid(A11,2,8))

    You had already solved your own problem!


    "()" <gary.moffat@gmail.com> wrote in message
    news:1143054615.700755.91710@j33g2000cwa.googlegroups.com...
    > Have a strange problem after doing the following with Excel 2000 on a
    > PC:
    > 1. split up cell using text-to-column on: "(391.281, 15.220)"
    > 2. Use MID(), e.g. "=MID(A11,2,8)" to strip off the parenthesis on
    > "(391.281"
    > I use Num_chars=8 because that is the maximum string length I
    > encounter
    >
    > After that the cells containing those values cannot be reformatted to a
    > number by any menu or toolbar actions, and there is no warning that it
    > does not succeed.
    >
    > Only thing that works is to apply "=VALUE()" to the result.
    >
    > Is this expected behavior?
    > Thanks
    >




  4. #4
    Duke Carey
    Guest

    RE: Cannot format data after using mid() function

    In addition to Ron's & MH's answers, you could do a search & replace BEFORE
    the Text-to-Columns, ridding the data of the open & close parens. Then the
    text-to-columns would likely give you #s instead of text


    "()" wrote:

    > Have a strange problem after doing the following with Excel 2000 on a
    > PC:
    > 1. split up cell using text-to-column on: "(391.281, 15.220)"
    > 2. Use MID(), e.g. "=MID(A11,2,8)" to strip off the parenthesis on
    > "(391.281"
    > I use Num_chars=8 because that is the maximum string length I
    > encounter
    >
    > After that the cells containing those values cannot be reformatted to a
    > number by any menu or toolbar actions, and there is no warning that it
    > does not succeed.
    >
    > Only thing that works is to apply "=VALUE()" to the result.
    >
    > Is this expected behavior?
    > Thanks
    >
    >


+ 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