0

I have a list of data in which the 'time' column is a list of decimal hours over a year. In other words Midnight on the 31st December 2016 is 0 and midnight on 31st December 2017 has the value 8784. As I want to plot this data against other data from this year, I need to convert the decimal hours to a date and time but have had extreme difficulty figuring out how to do it.

Example:

Time        AHU heating coil power, W
0               2.43E+05
2.78E-09        2.43E+05
0.160000003     2.42E+05
0.197173831     2.42E+05
0.197173834     2.42E+05
0.325173834     2.42E+05
0.453173834     2.42E+05
0.702904765     2.42E+05
1.075566739     2.42E+05
1.699476191     2.44E+05
2.644876374     2.45E+05

I also have a copy where the Time column is in whole hours, but I don't think it will make a difference to the method. I'm also open to a solution using python.

1 Answer 1

1

In Excel, you can add a number to a date, in which case the number is interpreted as the number of days, i.e. (Jan. 1st 2020 0:00) + 2.5 = (Jan. 2nd 2020 12:00)

All you need to do is add the number of hours divided by 24 to 2017/1/1

Example: =DATE(2017,1,1)+A2/24, where the number of hours is in column A.

1
  • Thanks! That was a lot easier than I thought
    – Andy Grey
    Commented Feb 5, 2021 at 11:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .