Calculate time difference in excel

后端 未结 3 1621
梦毁少年i
梦毁少年i 2021-01-28 13:11

I have a two dates in excel \"1/2/2016 01:56:05\" and \"8/3/2016 06:21:46\". How do I calculate the time difference between them in a format of days and hours?

Thanks!

3条回答
  •  感情败类
    2021-01-28 13:17

    Try this to include the spelled out hours and minutes:

    =INT(A2-A1) & " days, " & TEXT(A2-A1,"h "" hours, ""m "" minutes""")
    

    Note that since the m comes immediately (ignoring the separator text in quotes) after the h it will be interpreted as minutes and not months

提交回复
热议问题