Certain Time Values in a .xlsx not Changing When I convert to a .csv

1

I am trying to convert from an Excel spreadsheet (.xlsx) file to a .csv file. The software I am using is Excel 2007. The issue I am having is I have a column of date and time values for every hour of every day, yet for some reason every 24th hour does not convert from the .xlsx to the .csv.

For example, one section of the column of my .csv says this:

screenshot of my .csv spreadsheet

1) So how would I change the cell in row 25 to follow the same 24 hour date time format as the rest of the cells in the column?

2) And could anyone please explain why it is converting from a date time in the .xlsx to this number in the .csv in the first place?

3) And is there a formula I could apply to Excel so that the rest of the 24-hour cells are also converted from .xlsx to .csv correctly as well?

Thanks so much!

Zain Raza

Posted 2019-07-12T14:52:30.150

Reputation: 13

This looks like a bug, caused by the date and time field being an exact integer. If you select the whole column and format in the date and time format you want, does this correct it? – AFH – 2019-07-12T15:02:42.577

Yeah, it does actually! – Zain Raza – 2019-07-12T20:11:27.100

I'll submit it as an answer, so that if it is a bug people can see there is a work-round. – AFH – 2019-07-12T21:16:05.890

Answers

0

This looks like a bug, caused when the date and time field is an exact integer.

Date/time fields are stored as an integer number of days, with the time as a fraction of a day, so when the time is midnight there is no fraction, and the field is an integer.

It is not clear how your data were imported, but I can imagine that auto-formatting during import could be misinterpreted.

It appears that selecting the whole column and formatting in the required date and time format will work round whatever is causing the abnormality.

AFH

Posted 2019-07-12T14:52:30.150

Reputation: 15 470