Reputation: 2441
I wrote a formula that calculates the time difference between two datetime cells in Google Sheets.
Here is the formula for the time difference in minutes.
=(HOUR(B2)-HOUR(A2)+DAYS(B2,A2)*24)*60 + MINUTE(B2)-MINUTE(A2)
where A2
is the start datetime, and B2
is the end datetime.
I feel like Google Sheets should have a simpler method of calculating time differences, but I can't find out what function to use. Does google sheets convert to and from unix timestamps, for example? Is there a better way?
Upvotes: 1
Views: 3022
Reputation: 1
use in row 2:
=INDEX(IFERROR(1/(1/(ROUND(24*(B2:B-A2:A), 2)))))
=INDEX(IFERROR(1/(1/(ROUND(1440*(B2:B-A2:A), 2)))))
Upvotes: 1