+ Reply to Thread
Results 1 to 2 of 2

Problem with formatting numbers as text, in Excel 2007

  1. #1
    Registered User
    Join Date
    11-07-2011
    Location
    Stoughton, MA
    MS-Off Ver
    Excel 2007
    Posts
    1

    Problem with formatting numbers as text, in Excel 2007

    I've got a very strange anomaly going on, in Excel 2007.

    It has to do with numbers intended to be formatted as text. Normally, if you want to enter a number formatted as text, you preceed the number with an apostrophe, and Excel interprets that as an intention to store the number as text. When you do this, a little green triangle appears in the upper left corner of the cell, and when you highlight the cell, a little diamond with an '!' mark expands to tell you that the number is stored as text.

    However, I've got a spreadsheet with a column on integer numbers which look, on casual examination, to be formatted as text; first of all, the numbers are left-aligned, which is what happens to numbers that are formatted as text. Secondly, when you highlight one of these numbers, and select 'format..'/'format cells...', it shows as text.... yet they aren't actually being interpreted as text, when I access them via my own program (independent of Excel). The only numbers which are being correctly interpreted as text are ones that I entered with the apostrophe....

    Another way to format a cell is to highlight the cell, select 'Format...'/'Format cells...', and select 'text' as the format rule.

    However, when I try this on a blank spreadsheet, it doesn't work. I enter a number, and it is right-justified, as numbers ordinarily are. If I select the cell, and execute 'Format...'/'Format cells...'/'text', the number becomes left justified.... but it's not really text; no little green triangle, etc.

    So, the dilemma is this: why doesn't the 'Format...'/'Format cells...'/'Text' function actually work? Is it possible that there's some sort of optional switch (which I haven't found) that affects the way cell formatting operates?

    Anyone?

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,832

    Re: Problem with formatting numbers as text, in Excel 2007

    Quote Originally Posted by Tidetracker View Post
    ...they aren't actually being interpreted as text, when I access them via my own program (independent of Excel).
    What is your program and how is it reading the Excel content? Is it reading the actual Excel file directly? How is it a problem for this software that it interprets these fields as numbers rather than text? I'm trying to figure out if there is a workaround.

    Excel does data conversions freely when possible. If I enter this in A1

    '123

    and then in another cell enter this

    =A1+1

    I get 124 as a numeric result, even though I am doing arithmetic on text (if it can't do a conversion then you get a #VALUE! error). Formatting as text is usually important if you are doing things like numeric version numbers or section numbers (e.g., you are listing software version numbers that go from 1.0 to 1.10, and you want 1.1 to be a distinct version from 1.10).

    I discuss all this only because I am wondering what your need is to format numbers as text.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ 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