Search code examples
exceldatetimeexcel-formuladifference

How to calculate difference between dateTime in excel


How Can I Calculate Difference between 2 DateTime in this format 2020-03-28T18:50:56.8778877Z | 2020-03-28T20:04:13.6788341Z and get the difference including milliseconds.


Solution

  • Replace the T with a space and remove the Z then just subtract one from the other.

    =LEFT(REPLACE(A2,11,1," "),LEN(A2)-1)-LEFT(REPLACE(A1,11,1," "),LEN(A1)-1)
    

    The format it [hh]:mm:ss.000 (Excel will only show three decimal places on seconds) or any other format you desire.

    enter image description here