{"id":1199,"date":"2018-07-02T17:01:29","date_gmt":"2018-07-02T17:01:29","guid":{"rendered":"http:\/\/officetuts.net\/excel\/?p=1199"},"modified":"2023-11-02T19:58:22","modified_gmt":"2023-11-02T19:58:22","slug":"datedif","status":"publish","type":"post","link":"https:\/\/officetuts.net\/excel\/functions\/datedif\/","title":{"rendered":"DATEDIF function"},"content":{"rendered":"\n

Excel DATEDIF Function is a useful tool for calculating the difference between two dates in a simple and straightforward way. It allows you to find the number of years, months, or days between two dates, making it handy for various tasks like tracking project timelines, calculating age, or determining the duration of an event.<\/p>\n\n\n\n

Syntax<\/h2>\n\n\n\n

The syntax for the DATEDIF function is:<\/p>\n\n\n\n

DATEDIF(start_date, end_date, “unit”)<\/strong><\/p>\n\n\n\n

Arguments<\/h2>\n\n\n\n

Here are the arguments you can use with the DATEDIF function:<\/p>\n\n\n\n

start_date<\/strong><\/td>The initial date.<\/td><\/tr>
end_date<\/strong><\/td>The ending date.<\/td><\/tr>
“unit”<\/strong><\/td>The unit of time for calculation, such as “Y” for years, “M” for months, or “D” for days.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

How to Use<\/h2>\n\n\n\n

Using the DATEDIF function is quite simple. Let’s see some examples to understand it better:<\/p>\n\n\n\n

Example 1: Calculate the number of years between two dates<\/strong><\/p>\n\n\n\n

=DATEDIF(A1, B1, \"Y\")<\/code><\/pre>\n\n\n\n

This formula calculates the number of complete years between the dates in cells A1 and B1.<\/p>\n\n\n\n

Example 2: Calculate the number of months between two dates<\/strong><\/p>\n\n\n\n

=DATEDIF(A2, B2, \"M\")<\/code><\/pre>\n\n\n\n

This formula computes the number of full months between the dates in cells A2 and B2.<\/p>\n\n\n\n

Example 3: Calculate the number of days between two dates<\/strong><\/p>\n\n\n\n

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

Here, the formula determines the number of complete days between the dates in cells A3 and B3.<\/p>\n\n\n\n

Additional Information<\/strong><\/p>\n\n\n\n

The DATEDIF function is not officially documented in Excel, but it is a well-known and widely used function. However, be cautious when using it, as it may not be supported in some Excel versions. In addition, be mindful of the formatting of your dates, as this can affect the results. For more information on date formats and Excel functions, you can refer to Microsoft Excel’s official support page<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"

Excel DATEDIF Function is a useful tool for calculating the difference between two dates in a simple and straightforward way. It allows you…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[180],"yoast_head":"\nDATEDIF function<\/title>\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\/functions\/datedif\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"DATEDIF function\" \/>\n<meta property=\"og:description\" content=\"Excel DATEDIF Function is a useful tool for calculating the difference between two dates in a simple and straightforward way. It allows you...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/officetuts.net\/excel\/functions\/datedif\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-07-02T17:01:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-02T19:58:22+00:00\" \/>\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\/functions\/datedif\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/officetuts.net\/excel\/functions\/datedif\/\"},\"author\":{\"name\":\"Tomasz Decker\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"headline\":\"DATEDIF function\",\"datePublished\":\"2018-07-02T17:01:29+00:00\",\"dateModified\":\"2023-11-02T19:58:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/officetuts.net\/excel\/functions\/datedif\/\"},\"wordCount\":277,\"publisher\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"keywords\":[\"done\"],\"articleSection\":[\"functions\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/officetuts.net\/excel\/functions\/datedif\/\",\"url\":\"https:\/\/officetuts.net\/excel\/functions\/datedif\/\",\"name\":\"DATEDIF function\",\"isPartOf\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#website\"},\"datePublished\":\"2018-07-02T17:01:29+00:00\",\"dateModified\":\"2023-11-02T19:58:22+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/officetuts.net\/excel\/functions\/datedif\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/officetuts.net\/excel\/functions\/datedif\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/officetuts.net\/excel\/functions\/datedif\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/officetuts.net\/excel\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DATEDIF function\"}]},{\"@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":"DATEDIF function","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\/functions\/datedif\/","og_locale":"en_US","og_type":"article","og_title":"DATEDIF function","og_description":"Excel DATEDIF Function is a useful tool for calculating the difference between two dates in a simple and straightforward way. It allows you...","og_url":"https:\/\/officetuts.net\/excel\/functions\/datedif\/","article_published_time":"2018-07-02T17:01:29+00:00","article_modified_time":"2023-11-02T19:58:22+00:00","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\/functions\/datedif\/#article","isPartOf":{"@id":"https:\/\/officetuts.net\/excel\/functions\/datedif\/"},"author":{"name":"Tomasz Decker","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"headline":"DATEDIF function","datePublished":"2018-07-02T17:01:29+00:00","dateModified":"2023-11-02T19:58:22+00:00","mainEntityOfPage":{"@id":"https:\/\/officetuts.net\/excel\/functions\/datedif\/"},"wordCount":277,"publisher":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"keywords":["done"],"articleSection":["functions"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/officetuts.net\/excel\/functions\/datedif\/","url":"https:\/\/officetuts.net\/excel\/functions\/datedif\/","name":"DATEDIF function","isPartOf":{"@id":"https:\/\/officetuts.net\/excel\/#website"},"datePublished":"2018-07-02T17:01:29+00:00","dateModified":"2023-11-02T19:58:22+00:00","breadcrumb":{"@id":"https:\/\/officetuts.net\/excel\/functions\/datedif\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/officetuts.net\/excel\/functions\/datedif\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/officetuts.net\/excel\/functions\/datedif\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/officetuts.net\/excel\/"},{"@type":"ListItem","position":2,"name":"DATEDIF function"}]},{"@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\/1199"}],"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=1199"}],"version-history":[{"count":3,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/1199\/revisions"}],"predecessor-version":[{"id":16400,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/1199\/revisions\/16400"}],"wp:attachment":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/media?parent=1199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/categories?post=1199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/tags?post=1199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}