{"id":142,"date":"2014-09-11T13:43:00","date_gmt":"2014-09-11T17:43:00","guid":{"rendered":"http:\/\/www.dev-notes.com\/blog\/2014\/09\/11\/calculating-time-difference-in-excel\/"},"modified":"2014-09-11T13:43:00","modified_gmt":"2014-09-11T17:43:00","slug":"calculating-time-difference-in-excel","status":"publish","type":"post","link":"https:\/\/www.dev-notes.com\/blog\/2014\/09\/11\/calculating-time-difference-in-excel\/","title":{"rendered":"Calculating time difference in Excel"},"content":{"rendered":"<p>For the purpose of the demonstration, in an Excel spreadsheet, let&#8217;s say we have a date-time value of &#8220;9\/13\/14 3:02 PM&#8221; in cell A2 and &#8220;9\/13\/14 5:43 PM&#8221; in cell B2.  Even though the screen displays them in a format friendly to me at my location in the United States, in the background Excel actually treats them as a decimal number that is universal regardless of the display formatting.  In this case the two values are actually 41895.63<br \/>\nand 41895.74, respectively; the details on this number is outside the scope of this particular article.  Getting back on track, in order to calculate the number of days, hours, or minutes that has elapsed between these two values, we can simply use these formulas:<\/p>\n<pre class=\"code\">\nDifference in days:    =(B2-A2)\nDifference in hours:   =(B2-A2)*24\nDifference in seconds: =(B2-A2)*24*60\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This article demonstrates how to calculate the difference between two date, time, or date-time fields in Excel using simple formulas.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-142","post","type-post","status-publish","format-standard","hentry","category-excel"],"_links":{"self":[{"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/posts\/142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/comments?post=142"}],"version-history":[{"count":0,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/posts\/142\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/media?parent=142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/categories?post=142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/tags?post=142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}