Forum Discussion

Raxmon2023's avatar
Raxmon2023
Copper Contributor
Aug 11, 2023
Solved

Error when subtracting dates in excel

I have an excel file with a register of the entry and exit times of a site and there is a cell in which I get #### and if I display it I get a very small negative number. It doesn't cause me any prob...
  • Detlef_Lewin's avatar
    Detlef_Lewin
    Aug 11, 2023

    Raxmon2023 

    I can only repeat myself: Negative time value are displayed with ########.

     

    If I put the "same" data in my spreadsheet it looks a little different.

     

    The reason behind the tiny decimal number is the "floating point error".

    You could round your result. Or you could convert the time values into decimal minutes (x60x24) and convert the result back into a time value (/60/24). Change the number format accordingly.

    =D5*24*60-C5*24*60-($F$2*24*60+$F$3*24*60)

     

Resources