{"id":9049,"date":"2022-02-17T17:32:51","date_gmt":"2022-02-17T17:32:51","guid":{"rendered":"https:\/\/officetuts.net\/excel\/?p=9049"},"modified":"2024-02-19T14:52:26","modified_gmt":"2024-02-19T14:52:26","slug":"calculate-the-amount-of-time-between-two-dates","status":"publish","type":"post","link":"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/","title":{"rendered":"Calculate the Amount of Time Between Two Dates in Excel"},"content":{"rendered":"\n
Calculate-the-Amount-of-Time-Between-Two-Dates<\/a>Download File<\/a><\/div>\n\n\n\n

If you want to calculate the time between two dates, you have to remember that\u2019s a bit more complicated than calculating the difference between two numbers.<\/p>\n\n\n\n

The things that we need to take into consideration are a different number of days in months, or that February is a leap month. Other factors also must be taken into consideration.<\/p>\n\n\n\n

Fortunately, Excel can make it much easier with functions that calculate the time between dates<\/a>.<\/p>\n\n\n\n

DATEDIF<\/h2>\n\n\n\n

When you start typing the function name, you will notice that it doesn\u2019t show up from the available options.<\/p>\n\n\n\n

\"Table,<\/figure>\n\n\n\n

If you go to Formulas >> Function Library >> Date & Time<\/strong> you can see that there\u2019s no such function as DATEDIF<\/strong>.<\/p>\n\n\n\n

\"Graphical<\/figure>\n\n\n\n

There is no help from Excel there. But if you know the parameters, you can enter them and it will work.<\/p>\n\n\n\n

\"Graphical<\/figure>\n\n\n\n

In the following example, the first and second arguments are the start and end dates. The third one is the unit. In our case, it\u2019s a day (D)<\/strong>.<\/p>\n\n\n\n

=DATEDIF(B2,B3,\"D\")<\/code><\/pre>\n\n\n\n

You can also choose M<\/strong> for months<\/strong> and Y<\/strong> for years<\/strong>.<\/p>\n\n\n\n

DATEDIF function examples<\/h2>\n\n\n\n

This is an example with additional units, where you ignore part of a date.<\/p>\n\n\n\n

Start<\/strong><\/td>End<\/strong><\/td>Difference<\/strong><\/td>Formula<\/strong><\/td>Returns<\/strong><\/td><\/tr>
2014-01-01<\/td>2022-02-25<\/td>2977<\/td>=DATEDIF(A2,B2,”D”)<\/td>days (same as B2 – A2)<\/td><\/tr>
 <\/td> <\/td>97<\/td>=DATEDIF(A2,B2,”M”)<\/td>months<\/td><\/tr>
 <\/td> <\/td>8<\/td>=DATEDIF(A2,B2,”Y”)<\/td>years<\/td><\/tr>
 <\/td> <\/td>24<\/td>=DATEDIF(A2,B2,”MD”)<\/td>days (ignores months and years)<\/td><\/tr>
 <\/td> <\/td>1<\/td>=DATEDIF(A2,B2,”YM”)<\/td>months (ignores years)<\/td><\/tr>
 <\/td> <\/td>55<\/td>=DATEDIF(A2,B2,”YD”)<\/td>days (ignores years)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

Arithmetic operators<\/h2>\n\n\n\n

As I wrote at the beginning, math on dates it\u2019s more complicated than on numbers, but it doesn\u2019t mean that you can\u2019t use standard arithmetic operators to calculate the difference.<\/p>\n\n\n\n

Let\u2019s see how it looks in our example.<\/p>\n\n\n\n

\"Graphical<\/figure>\n\n\n\n

The result is the same as with the DATEDIF<\/strong> function, but if you switch B2<\/strong> with B3<\/strong> values, you are going to have a negative number of operators and errors for the function.<\/p>\n\n\n\n

\"Graphical<\/figure>\n","protected":false},"excerpt":{"rendered":"

If you want to calculate the time between two dates, you have to remember that\u2019s a bit more complicated than calculating the difference…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[170],"yoast_head":"\nCalculate the Amount of Time Between Two Dates in Excel<\/title>\n<meta name=\"description\" content=\"Learn how to calculate the amount of time between two dates in Excel using the DATEDIF function. Download the Excel file for a step-by-step guide.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Calculate the Amount of Time Between Two Dates in Excel\" \/>\n<meta property=\"og:description\" content=\"Learn how to calculate the amount of time between two dates in Excel using the DATEDIF function. Download the Excel file for a step-by-step guide.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-02-17T17:32:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-19T14:52:26+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2022\/02\/table-excel-description-automatically-generated-2.png\" \/>\n<meta name=\"author\" content=\"Tomasz Decker\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tomasz Decker\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/\"},\"author\":{\"name\":\"Tomasz Decker\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"headline\":\"Calculate the Amount of Time Between Two Dates in Excel\",\"datePublished\":\"2022-02-17T17:32:51+00:00\",\"dateModified\":\"2024-02-19T14:52:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/\"},\"wordCount\":350,\"publisher\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"image\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2022\/02\/table-excel-description-automatically-generated-2.png\",\"keywords\":[\"file\"],\"articleSection\":[\"formulas\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/\",\"url\":\"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/\",\"name\":\"Calculate the Amount of Time Between Two Dates in Excel\",\"isPartOf\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2022\/02\/table-excel-description-automatically-generated-2.png\",\"datePublished\":\"2022-02-17T17:32:51+00:00\",\"dateModified\":\"2024-02-19T14:52:26+00:00\",\"description\":\"Learn how to calculate the amount of time between two dates in Excel using the DATEDIF function. Download the Excel file for a step-by-step guide.\",\"breadcrumb\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/#primaryimage\",\"url\":\"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2022\/02\/table-excel-description-automatically-generated-2.png\",\"contentUrl\":\"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2022\/02\/table-excel-description-automatically-generated-2.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/officetuts.net\/excel\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Calculate the Amount of Time Between Two Dates in Excel\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/officetuts.net\/excel\/#website\",\"url\":\"https:\/\/officetuts.net\/excel\/\",\"name\":\"\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/officetuts.net\/excel\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\",\"name\":\"Tomasz Decker\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g\",\"caption\":\"Tomasz Decker\"},\"logo\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/\"},\"description\":\"Spreadsheet and Python enthusiast.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Calculate the Amount of Time Between Two Dates in Excel","description":"Learn how to calculate the amount of time between two dates in Excel using the DATEDIF function. Download the Excel file for a step-by-step guide.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/","og_locale":"en_US","og_type":"article","og_title":"Calculate the Amount of Time Between Two Dates in Excel","og_description":"Learn how to calculate the amount of time between two dates in Excel using the DATEDIF function. Download the Excel file for a step-by-step guide.","og_url":"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/","article_published_time":"2022-02-17T17:32:51+00:00","article_modified_time":"2024-02-19T14:52:26+00:00","og_image":[{"url":"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2022\/02\/table-excel-description-automatically-generated-2.png"}],"author":"Tomasz Decker","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Tomasz Decker","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/#article","isPartOf":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/"},"author":{"name":"Tomasz Decker","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"headline":"Calculate the Amount of Time Between Two Dates in Excel","datePublished":"2022-02-17T17:32:51+00:00","dateModified":"2024-02-19T14:52:26+00:00","mainEntityOfPage":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/"},"wordCount":350,"publisher":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"image":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/#primaryimage"},"thumbnailUrl":"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2022\/02\/table-excel-description-automatically-generated-2.png","keywords":["file"],"articleSection":["formulas"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/","url":"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/","name":"Calculate the Amount of Time Between Two Dates in Excel","isPartOf":{"@id":"https:\/\/officetuts.net\/excel\/#website"},"primaryImageOfPage":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/#primaryimage"},"image":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/#primaryimage"},"thumbnailUrl":"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2022\/02\/table-excel-description-automatically-generated-2.png","datePublished":"2022-02-17T17:32:51+00:00","dateModified":"2024-02-19T14:52:26+00:00","description":"Learn how to calculate the amount of time between two dates in Excel using the DATEDIF function. Download the Excel file for a step-by-step guide.","breadcrumb":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/#primaryimage","url":"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2022\/02\/table-excel-description-automatically-generated-2.png","contentUrl":"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2022\/02\/table-excel-description-automatically-generated-2.png"},{"@type":"BreadcrumbList","@id":"https:\/\/officetuts.net\/excel\/formulas\/calculate-the-amount-of-time-between-two-dates\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/officetuts.net\/excel\/"},{"@type":"ListItem","position":2,"name":"Calculate the Amount of Time Between Two Dates in Excel"}]},{"@type":"WebSite","@id":"https:\/\/officetuts.net\/excel\/#website","url":"https:\/\/officetuts.net\/excel\/","name":"","description":"","publisher":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/officetuts.net\/excel\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42","name":"Tomasz Decker","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g","caption":"Tomasz Decker"},"logo":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/"},"description":"Spreadsheet and Python enthusiast."}]}},"_links":{"self":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/9049"}],"collection":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/comments?post=9049"}],"version-history":[{"count":5,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/9049\/revisions"}],"predecessor-version":[{"id":15800,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/9049\/revisions\/15800"}],"wp:attachment":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/media?parent=9049"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/categories?post=9049"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/tags?post=9049"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}