Wednesday, June 19, 2013

Google Spreadsheet Calculate Date and Time Difference

Google Spreadsheet Calculate Date and Time Difference


Question:

(by Czar Augusto)



I'm trying subtract date+hour between two cells.

In one of the cells, i would like insert manually date and times values. In other cells i used the function =NOW which automatically insert values of date and time current.

How to achieve this using google spreadsheet?


Solution:

Now, have a look at the following screenshot:




Here in the above sheet,

Cell B1 contains following formula:
=now()


Cell B2 contains following value:
6/1/2012 20:27:20


Now, put the following formula in Cell B5:
=rounddown(B1-B2) & " days, " & hour(B1-B2) & " hours, " & minute(B1-B2) & " minutes and " & second(B1-B2) & " seconds."


Or use the following formula:
=rounddown(B1-B2) & " days and " & time(hour(B1-B2);minute(B1-B2);second(B1-B2)) & " hours."


I hope the above solution will help you, and if you need more help then please do comment below on this blog itself, I will try to help you out.


I also take up private and confidential projects:


If this blog post was helpful to you, and if you think you want to help me too and make my this blog survive then please donate here: http://igoogledrive.blogspot.com/2012/09/donate.html 



1 comment: