+ Reply to Thread
Results 1 to 4 of 4

Cell number formatting doesn't work

  1. #1
    Registered User
    Join Date
    11-15-2012
    Location
    Middle East
    MS-Off Ver
    Excel 2010
    Posts
    60

    Cell number formatting doesn't work

    hi guys,

    See in the attached file, when i try to sum up using sum function in B4, the values in B2 and B3, it doesn't work for me, even though I changed to format to number.
    I think it's related to the - (negative) characters.
    I'm trying to understand the reason for this one. How can i change B2 and B3 cells to be considered as numbers (without manually changing - sign with other - sign).


    Thanks,

    Moty
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,425

    Re: Cell number formatting doesn't work

    I put ISTEXT(B2) in column C, and both values came up TRUE() indicating that the actual cell values are text (note that simply changing number formatting by itself cannot change a number stored as text to a number). The SUM() function ignores text (including numbers stored as text), so the sum of two text strings is 0.

    I put LEN(B2) into column D, which returns 4 (for what looks like a 3 character string). There is obviously a non-printing character in these values somewhere.

    I put =CODE(MID(B2,1,1)) into column E and got 63 which is a ? character or the default value that the non-unicode ascii functions seem to return for any unicode character that is not also on the ascii list.

    Since my older version of Excel does not have UNICODE() functions, that was as far as I got. The solution to your problem is to figure out how to get rid of that first character and then convert the text to a number. Something like =VALUE(RIGHT(B2,3)) would probably work, if your numbers are always 3 characters long and the first character in the string is always the non-printing extraneous character. If the possibilities are more varied, then you will need a more complex function to remove only the numeric part of the string. One way or another, getting rid of those extraneous characters is what you need to do.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Cell number formatting doesn't work

    Try this
    There is a char(63) attached before "-"
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    v A B
    1 date profit
    2 9.10.2016 ?-10
    3 8.10.2016 ?-20
    4 -30.00
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  4. #4
    Registered User
    Join Date
    11-15-2012
    Location
    Middle East
    MS-Off Ver
    Excel 2010
    Posts
    60

    Re: Cell number formatting doesn't work

    Thanks guys. I really appriciate your answers. Very helpful!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 12
    Last Post: 03-30-2016, 08:37 AM
  2. Replies: 6
    Last Post: 02-28-2014, 07:12 AM
  3. Excel VBA Formatting doesn't work on protected sheets?
    By meissen in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-01-2013, 12:09 PM
  4. Conditional Formatting doesn't work after copy and insert
    By amarus99 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-01-2012, 02:52 PM
  5. Excel 2007 : AND doesn't work in Conditional Formatting
    By cellarir in forum Excel General
    Replies: 2
    Last Post: 03-21-2012, 06:10 PM
  6. Replies: 3
    Last Post: 09-09-2009, 03:35 PM
  7. Formatting a range of cells doesn't work
    By Stefi in forum Excel General
    Replies: 6
    Last Post: 08-15-2005, 08:05 AM

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