MS Excel automatically converts numeric fields to date format

I have at least 2 different spreadsheets where this happens.  I maintain them for months, adding, changing, deleting data.  They contain lots of data elements (numeric, text, date, etc).   Some columns are all numeric, some all dates,
etc.  Then suddenly when I open the spreadsheet, my numeric formatted data has been converted to date format.  I see lots of # signs in cells, which is an indication that this happened, and selecting an affected cell shows a date, generally in the
early 1900s, depending on the original numeric value that was in the cell.  I convert the fields back to numeric, but sometime later the same problem occurs -- numeric fields are now date formatted.  I cannot identfy any specific change that I make
that would cause this.  And I only recognize it as having occurred when I open the spreadsheet, not anytime during its maintenance.  I am using MS Excel 2007 SP2 in a Windows XP SP3 environment.  The machine is well maintained and updated /
kept current by our corporate IT group.  I have done numerous Internet searches and cannot find anything like this in any other blog.  Thanks for your help.

Hi,
Were some of the these data imported from a .csv file? As far as I know, data formats cannot be saved in .csv file. If this is the situation, try this:
Save a copy of your .csv file changing the extension of your file from .csv to .txt
open excel.
go to DATA --> Import external data --> Import data --> browse to find the .txt file you made earlier
The text import wizard should open.
Click on delimited, click next
click comma, click next
You should now see all columns appear with heading GENERAL --> highlight the columns with the values that are changing to date and click TEXT (top right) instead. The heading of these columns should now change to TEXT.
click finish
Excel will now treat the column as text when it imports the data and will not change them to dates
If this is not the situation, this issue might be caused by some add-ins.
Start Excel in safe mode:  Press and hold the
CTRL key, and then click the Excel program to start. Then, click File > Open to open the Excel file.
If the problem does not occur in the safe mode, this issue might be related to some third-party add-ins in the Office program, we can try to disable them.
Best Regards,
Sally Tang

Similar Messages

  • Convert varchar2 field into date formatted: DD-MON-YYYY

    Thanks in advance for anyone's help on this matter as I know it takes your time and expertise. I am pretty new to SQL but learning my way through it just have an issue with a text to date field conversion. It is an Oracle 10g database and I am writing in SQL. There is a field called Demand which is formatted in varchar2 format of ddmmyy. There is also a field that is formatted as a date called Payment which is formatted as DD-MON-YYYY.
    Essentially I need to do a simple Payment >= Demand, however as you can see that is some issue with that being a varchar2 field. Does anyone know if it is possible to do that type of expression against those two fields. Was thinking about possibly converting the varchar2 to a date but not sure how to get to that DD-MON-YYYY format.
    Also there are situations where this Demand field will often times be null as it would have never recieved any outbound correspondence in the past and would not have a date at all.
    Thanks
    Edited by: user10860766 on Aug 18, 2009 8:14 AM
    Edited by: user10860766 on Aug 18, 2009 8:19 AM

    Hi,
    It's hard to detect bad dates in pure SQL, especially if you need to be precise about when February 29 is valid.
    It's easy with a user-define function, like the one in [this thread|http://forums.oracle.com/forums/thread.jspa?messageID=3669932&#3669932].
    Edited by: Frank Kulash on Aug 18, 2009 3:50 PM
    To create a stand-alone function:
    CREATE OR REPLACE FUNCTION     to_dt
    (     in_txt          IN     VARCHAR2                    -- to be converted
    ,     in_fmt_txt     IN     VARCHAR2     DEFAULT     'DD-MON-YYYY'     -- optional format
    ,     in_err_dt     IN     DATE          DEFAULT     NULL
    RETURN DATE
    DETERMINISTIC
    AS
    BEGIN
         -- Try to convert in_txt to a DATE.  If it works, fine.
         RETURN     TO_DATE (in_txt, in_fmt_txt);
    EXCEPTION     -- If TO_DATE caused an error, then this is not a valid DATE: return in_err_dt
         WHEN OTHERS
         THEN
              RETURN in_err_dt;
    END     to_dt
    /To use it:
    SELECT  primary_key  -- and/or other columns to identify the row
    ,       demand
    FROM    table_x
    WHERE   demand          IS NOT NULL
    AND     to_dt ( demand
               , 'DDMMYY'
               )          IS NULL;

  • Excel converts numeric values to date

    Hi,
    I have a JSP page which is sending data to excel.
    response.setContentType("application/vnd.ms-excel");
    response.addHeader("Content-Disposition", "attachment;filename=\"a.xls\"");
    I am using codes above. But excel converts numeric values to date. for example I send "18.5" but excel convert it to "18.May". But when I add " " before the value there is no problem. But I dont want to use this
    how can I fix it. Thanks in advance.

    hi,
    the problem is not with your jsp encoding but with excel settings
    enter the mathe-statistics block in your excel program change setting from date to numbers
    that is all

  • How can change numeric value to date format? example value 1070131(CYYMMDD)

    in the datatable can i change numeric value to date format . in database date value is like 1070131 (CYYMMDD). I want to see 31/01/07(DD/MM/YY) or 31 Jan 07 . Is it possible?
    Thanks,

    Did you solve your problem?

  • Convert Number to the date format

    Hello,
    In CRM, i want to input the number as a parameter and convert the number into Date format. Is there any function module in CRM which accepts the number and gives the date as output .
    Example.
    suppose input given is 734484
    output : 12-12-2011  .
    The number  734484 reflects  the total number of days from '0000' to 12-12-2011
    Regards,
    Rohini

    920575 wrote:
    I have a sql like this:
    select to_date('MAR','Mon', 'NLS_DATE_LANGUAGE=American') m from dualI want to display '3' instead of showing MAR...
    I tried to use to_char(date,'MM') but the result will return '03'.
    I would like to have the output exactly equal to 3.3 (without single-quotes) is a NUMBER. It is exactly equal to the NUMBER 03.
    '3' is a string. It is not equalt to the string '03'.
    Do you want a NUMBER or a string?
    If you want the 1-character string '3', then use 'fmMM' instead of 'MM'.
    select  TO_CHAR ( to_date ('MAR', 'Mon', 'NLS_DATE_LANGUAGE=American')
                    , 'FMMM'
                    )   AS m
    from    dualTO_CHAR sometimes adds padding (sometimes spaces, sometimes '0's) to make elements a constant width. For example, some months need 2 characters for the 'MM' format, so TO_CHAR, by default, left-pads with '0's to make all months 2 characters, whether they need 2 characters or not. Using 'FM' (case insensitive) IN the format string changes whether or not this kind of padding will be added.
    You could also use LTRIM to remove the leading '0's in this case, but why remove them when it's easier not to generate them in the first place?

  • Converting float fields to date Time

    I have an application that stores datetimes into float fields, the data is formatted yyyymmddhhmmss or 20081122091030. I need to convert this data to a datetime data type so I can do datetime calculations (differences) for reporting purposes. It would be preferable to have the data formatted yyyy/mm/dd hh:mms. I have tried numerous methods with out success. As I understand it I need to CONVERT to a VARCHAR first.  I am new to TSQL & this one turning out to be a knotty problem so I would really appreciate anyone’s assistance,
    SELECT (
      LEFT(CAST(IS_DUE_DATE AS VARCHAR(14)),8) + ' ' +
        SUBSTRING(CAST(IS_DUE_DATE AS VARCHAR(14)),9,2) + ':' +
        SUBSTRING(CAST(IS_DUE_DATE AS VARCHAR(14)),11,2) + ':' +
        SUBSTRING(CAST(IS_DUE_DATE AS VARCHAR(14)),13,2))
    FROM  ISSUES
    However when I try to Covert to DATETIME it all goes pear shaped.

    Try this
    Code Snippet
    DECLARE @MyDate float
    SET @MyDate = 20090922112143997
    SELECT CONVERT(DATETIME,
    LEFT(CAST(CAST(@MyDate as BigInt) as varchar(20)),8)+' '+
    SUBSTRING(CAST(CAST(@MyDate as BigInt) as varchar(20)),9,2)+':'+
    SUBSTRING(CAST(CAST(@MyDate as BigInt) as varchar(20)),11,2)+':'+
    SUBSTRING(CAST(CAST(@MyDate as BigInt) as varchar(20)),13,2) + '.' +
    SUBSTRING(CAST(CAST(@MyDate as BigInt) as varchar(20)),15,3)
    Added using a temp table:
    Code Snippet
    CREATE TABLE #T
    fdate float
    go
    INSERT INTO #T VALUES (20090922112143997)
    INSERT INTO #T VALUES (20090921182143997)
    INSERT INTO #T VALUES (20090921012323997)
    SELECT CONVERT(DATETIME,
    LEFT(CAST(CAST(fdate as BigInt) as varchar(20)),8)+' '+
    SUBSTRING(CAST(CAST(fdate as BigInt) as varchar(20)),9,2)+':'+
    SUBSTRING(CAST(CAST(fdate as BigInt) as varchar(20)),11,2)+':'+
    SUBSTRING(CAST(CAST(fdate as BigInt) as varchar(20)),13,2) + '.' +
    SUBSTRING(CAST(CAST(fdate as BigInt) as varchar(20)),15,3)
    FROM #T
    DROP TABLE #T

  • Converting varchar field to date

    I got a varchar field in DB with format YYYY/MM/DD HH:MI:SS in DB . I want to convert this to date field in RPD. When I did
    CAST ( VarChar field AS DATE) in RPD it is not working I am getting sql error.
    Thanks for your help.

    Hi,
    can you try once to cast your char as a timestamp.
    Hope that works.
    Kr,
    A

  • Converting a string into Date format

    I am currently using a JSP.
    I currently need to convert a string that holds a date in "dd/mm/yyyy" format to the jva.sql.Date format.
    Any ideas as to what the proper way of doing this is?
    Many thanks ppl

    public java.sql.Date parseDate(String s) {
         java.text.DateFormat dateFormatter= new java.text.SimpleDateFormat("dd/MM/yyyy");
         return new java.sql.Date(dateFormatter.parse(s).getTime());

  • Character field with date format alike & character entered

    Hi all,
    I got one character field created ( varchar2 ) for the purposed to let user the enter the date and also any character since it is a character field.
    Hence, my field may contain the following data :-
    Ship_date
    01/10/2010
    07/02/2011
    15/01/2011
    25/01/2011
    31/01/2011
    TBA
    STOP
    11/01/2011
    TBA
    Hence when come to sorting, I will like it to be date format like sorting so that the earlier date will display first then only follow by the character. The expected result will be :-
    ship_date
    01/10/2011
    11/01/2011
    15/01/2011
    25/01/2011
    31/01/2011
    07/02/2011
    STOP
    TBA
    Trying to do the normal sorting, it does not exactly sort on the date format, as it only sort on the first two character on the date hence I am not getting the correct sorting on this.
    01/10/2011
    07/02/2011
    11/01/2011
    15/01/2011
    25/01/2011
    31/01/2011
    STOP
    TBA
    Could someone help me on this. Thanks.
    Lim

    Hi, Lim,
    sm**** wrote:
    Hi all,
    I got one character field created ( varchar2 ) for the purposed to let user the enter the date and also any character since it is a character field.That's a very bad idea. Use a DATE column for storing dates. Have another, separate column for VARCHAR2 data.
    Hence when come to sorting, I will like it to be date format like sorting so that the earlier date will display first then only follow by the character. The expected result will be :-
    If you must deal with the table as it is:
    ORDER BY  CASE
              WHEN  TRANSLATE ( ship_date
                        , '012345678'
                        , '999999999'
                        ) = '99/99/9999'
              THEN  SUBSTR (ship_date, 7)
                 || SUBSTR (ship_date, 4, 2)
           END
    ,       ship_dateThe CASE expressionj sorts anything the looks like a date ('99/99/9999' where '9' stands for any digit) first, in order by the last 4 digits, then the middle 2 digits. The first 2 digits are sorted by the second ORDER BY expression.
    I will like it to be date format like sorting so that the earlier date will display first then only follow by the character. The expected result will be :-
    ship_date
    01/10/2011
    11/01/2011
    15/01/2011
    25/01/2011
    31/01/2011
    07/02/2011That must be a mistake. I don't believe you want January to come after October and before February, but if you do, you can change what comes after THEN in the CASE expression.

  • How to convert a String to Date format?

    the user enter a date in string format and the date is save in the database.
    The problem i am facing is i want to change from String to Date format.
    Here is my codes:
            public boolean insertData() throws Exception {
            boolean validFlag = false;
            DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
            Date d = df.parse("05/18/05");
            String MY_DATE_FORMAT = "yyyy-MM-dd";
            String jobAdvertisementDate = new SimpleDateFormat(MY_DATE_FORMAT).format(d);
            String sql = "INSERT INTO companyjob (CompanyID,JobID, JobAdvertisementDate ) " +
                    " VALUES ('" + companyID + "','" + jobID + "', '" + jobAdvertisementDate + "')";
            System.out.println(sql);
            validFlag = executeSQL(sql);
            return validFlag;
        }The date is save under jobAdvertisementDate.
    My netbeans shows an error. There's a red line under DateFormat and parse inside my codes.
    PLease help me. Reply asap!!

    BebeGirl wrote:
    My netbeans shows an error. There's a red line under DateFormat and parse inside my codes.
    Red Line? Sounds ominous. I wonder what it means.
    So...what does the error say?

  • Using USB NI-6008 on LV7.1 the results data has to be in Excel. It looks as cluster data format that i can not insert into excel VI

    I am Using USB 6008 with LV 7.1. The application is voltage logger and i would like to use excel and upload the data . The Columns will be the channels and the rows will be the data.
    The data comes from the DAQmx vi not like a simple string or an number it is kind of cluster data
    which contains strings and numbers and more for each measurement.
    I tryed to work with spraedshit and it goes ok but it is not conveniant to convert later to excel.
    Do you have a solution for that please?
    (How to extract the data from the cluster type format that is used with USB6008).
    TX arik
    Attachments:
    USB-6008-r3.vi ‏80 KB

    Arik:
    I hope all is well. If you are trying to write data to a text file along with the header information, you could do the following:
    1. Open a reference to a file and write the header information right away.
    2. Do your continuous acquisition (in a loop) using the 6008 and write the data to a file everytime.
    3. With the proper formatting, your colums will represent channels and your rows data.
    Please take a look at the attached example and let me know if you have any other questions.
    Regards,
    Rudi N.
    Attachments:
    WriteFilewHeaders.vi ‏64 KB

  • Convert Creationtime column to date format in table cwsys.cw_workspaces_tab

    How to convert the creationtime column value to date in the table cwsys.cw_workspaces_table using sql or otherwise.
    -Tarun

    I'm pretty interested in this one as several reports can be created using this field, any inside help??

  • Converting the char into date format?

    Hi!!! Guru's
       i am using std DS of SD 2LIS_11_VAITM, in that the date fields are in the the char format, so i wann show the difference of the to dates in Days into the report, can any body put some light on this thread.
    wil assign pts for sure
    thanks in adv
    mohan

    Hello,
    I think u can achieve this at query level.
    You can try variable with replacement path . In your scenario you will have to have 2 variables one for ex. 0SHIPDATE and another one for ex. 0GIDATE .
    After that create formula ( Number of days ) of subtraction on this two variables .
    Gimme ur mail-id , i will forward a doc on this if u want...
    Regards,
    SRIKANTH
    Message was edited by:
            KANTH SRI

  • Add (concatenate) a string to the end of a numerical field value (custom format script)?

    Hello All!
    1) I have a form field where a customer can input mileage (e.g. 48,000)
    I would like to be able to dynamically place the comma in the proper place as well as add " miles" to the end of the value the user input.
    For example:
    If the user types "123456" into the field, I would like for it to display as "123,456 miles"
    I assume this will require some custom format javascript... I'm familiar with the general syntax of JavaScript, but don't really know specific keywords/object names to use, I have a few custom calculation scripts in the form, and I've done some simple thing like concatenate two fields into one, etc.
    But this is a little different, because I'm only working with data from one field. I tried:
    event.value += " miles";
    However, this causes " miles" to get added everytime ANY field changes... so I end up getting "123,456 miles miles miles miles" as the user makes changes to other fields.
    2) Also, to further complicate things, is it possible to "remove" the custom formatting when the field gains focus? For example, if you use Acrobat's default number format ($1,394.00) on a field, when the user selects that field to edit the value, the formatting "disappears" so that the user would only see "1394".
    I would like to achieve the same with my custom field, so when the user selected the field that displays "123,456 miles" to change the value, they would only see/edit "123456"
    A bit wordy, I know, but thanks for any help!

    Here's a simple way. Begin by creating a new document-level JavaScript and include the following code:
    function my_format() {
        // Format number (no decimal point, comma thousands separator, etc.)
        AFNumber_Format(0, 0, 0, 0, "", false);
        // Add " miles" if there is an entry
        event.value = event.value ? event.value + " miles" : "";
    function my_keystroke() {
        // Restrict entry to characters consistent with a number
        AFNumber_Keystroke(0, 0, 0, 0, "", false);
    For the field in question, add the following as the custom Format script:
    my_format();
    and the following as the custom Keystroke script:
    my_keystroke();
    George

  • Converting from the windows date format

    Folks,
    I have no doubt this has been answered before somewhere in deep dark recesses of these forums, but I'm having trouble finding a solution...
    I have a csv file that contains a date and time field that has been stored in what I gather is a Microsoft format whereby the date and time are represented as a flaoting point number. The data can look something like 38410.25 which turns out to be 27/02/2005 06:00:00. Anyone been through this movie before?
    Thanks,
    overcanyon.

    Peter,
    From snippets I've seen about the place, the microsfot calendar started in 1 jan 1900. I'm not even gonna think about the timezone but there is leap years an' stuff to think about and I'm feeling lazy in a kinda 'this code must be done before sorta way'.
    You're making me feel guilty now. Like maybe there's not as much to it as I think.
    Nah, thinking about leap years is makin' my brain ache. Yeah, Y2K flashbacks comin' on...
    Any takers on where a ready made class might be living? :)
    overcanyon

Maybe you are looking for

  • Photoshop CS quits unexpectedly

    I don't understand this. It was working fine for me, but all of a sudden Photoshop just keeps crashing. Someone help me, please! Also, on a side note, has Apple ever released a .10 version of OS X before? MacBook 2.0 GHz, White   Mac OS X (10.4.10)  

  • Error converting XML to String

    I'm trying to use getXMLString() to put my XML document in a String variable. I get the following when I try to output the String: <?xml version = '1.0'?> <ERROR>oracle.xml.sql.OracleXMLSQLException: This object has been closed. If the close() was im

  • What are the *smw files? Will they reinstall the original applications of my Toshiba laptop?

    I did a clean installation of Windows 7 (64 bits) in my E105-S1402. I installed the Toshiba Software Installer for Windows 7 and I got the drives and updates from it. I also download all the drives, updates and patches from Toshiba for Windows 7 (64

  • Time to enhance music

    OK, I have been using Apple products for almost 8 years and i havent found any simplest change to the audio quality over these years. Apple you got to think on this front as well/ Why not give a dolby digital output from the i devices etc or any othe

  • Outbound Corresponence with Archivelink

    Hello, I am trying to Archive outbound correspondence (SAP Adobe Form) to a content repository that I set up for Inbound correspondence using Archivelink. Archivelink is configured and working for Inbound corresponence that resides on my local drive,