{"id":129,"date":"2025-07-15T13:34:46","date_gmt":"2025-07-15T13:34:46","guid":{"rendered":"https:\/\/functiontranslator.com\/2021\/02\/12\/datedif\/"},"modified":"2021-02-13T11:33:32","modified_gmt":"2021-02-13T11:33:32","slug":"datedif","status":"publish","type":"post","link":"https:\/\/functiontranslator.com\/en\/datedif\/","title":{"rendered":"DATEDIF"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>Welcome to an in-depth guide on the DATEDIF function, a hidden yet incredibly useful feature in both Microsoft Excel and Google Sheets. The DATEDIF function allows you to calculate the difference between two dates in days, months, or years. Although it doesn&#8217;t appear in Excel\u2019s function library, it remains fully operational.<\/p>\n<h2>Basic Syntax<\/h2>\n<p>The syntax for the DATEDIF function is as follows:<\/p>\n<pre><code>DATEDIF(start_date, end_date, \"unit\")<\/code><\/pre>\n<ul>\n<li><code>start_date<\/code>: The starting date of the period.<\/li>\n<li><code>end_date<\/code>: The ending date of the period.<\/li>\n<li><code>unit<\/code>: A text parameter that defines the type of interval to return:\n<ul>\n<li>&#8220;d&#8221; or &#8220;D&#8221;: The total number of days between the two dates.<\/li>\n<li>&#8220;m&#8221; or &#8220;M&#8221;: The total number of months between the two dates.<\/li>\n<li>&#8220;y&#8221; or &#8220;Y&#8221;: The total number of years between the two dates.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>Examples of Calculations<\/h2>\n<p>Let\u2019s explore several practical examples to showcase the utility of the DATEDIF function:<\/p>\n<h3>Example 1: Calculate the Number of Days Between Two Dates<\/h3>\n<p>Consider the start date is in cell A1 (01-Jan-2022) and the end date is in cell B1 (05-Jan-2022). To calculate the number of days between these dates, use the formula:<\/p>\n<pre><code>=DATEDIF(A1, B1, \"d\")<\/code><\/pre>\n<table>\n<tr>\n<th>Start Date<\/th>\n<th>End Date<\/th>\n<th>Result (Days)<\/th>\n<\/tr>\n<tr>\n<td>01-Jan-2022<\/td>\n<td>05-Jan-2022<\/td>\n<td>4<\/td>\n<\/tr>\n<\/table>\n<h3>Example 2: Calculate the Number of Months Between Two Dates<\/h3>\n<p>To estimate the number of months between two dates, use the formula:<\/p>\n<pre><code>=DATEDIF(A1, B1, \"m\")<\/code><\/pre>\n<table>\n<tr>\n<th>Start Date<\/th>\n<th>End Date<\/th>\n<th>Result (Months)<\/th>\n<\/tr>\n<tr>\n<td>01-Jan-2022<\/td>\n<td>01-Mar-2022<\/td>\n<td>2<\/td>\n<\/tr>\n<\/table>\n<h3>Example 3: Calculate the Number of Years Between Two Dates<\/h3>\n<p>For determining the number of years between two specific dates, apply:<\/p>\n<pre><code>=DATEDIF(A1, B1, \"y\")<\/code><\/pre>\n<table>\n<tr>\n<th>Start Date<\/th>\n<th>End Date<\/th>\n<th>Result (Years)<\/th>\n<\/tr>\n<tr>\n<td>01-Jan-2020<\/td>\n<td>01-Jan-2022<\/td>\n<td>2<\/td>\n<\/tr>\n<\/table>\n<h2>Conclusion<\/h2>\n<p>The DATEDIF function is a robust tool for computing differences in dates, whether in days, months, or years, across Excel and Google Sheets. While it is important to note that DATEDIF is not listed in the official documentation and may not be supported in future updates, it currently serves as an effective solution for date-related calculations.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Calculates the number of days, months, or years between two dates This function is useful in formulas where you need to calculate an age<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[209],"tags":[],"class_list":["post-129","post","type-post","status-publish","format-standard","hentry","category-date-and-time"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Excel DATEDIF Function \u2013 How It Works, Formula Examples and Syntax<\/title>\n<meta name=\"description\" content=\"Learn what the Excel DATEDIF function does. Clear syntax explanation and useful formula examples.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/functiontranslator.com\/en\/datedif\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Excel DATEDIF Function \u2013 How It Works, Formula Examples and Syntax\" \/>\n<meta property=\"og:description\" content=\"Learn what the Excel DATEDIF function does. Clear syntax explanation and useful formula examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/functiontranslator.com\/en\/datedif\/\" \/>\n<meta property=\"og:site_name\" content=\"Function Translator\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-15T13:34:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-13T11:33:32+00:00\" \/>\n<meta name=\"author\" content=\"glavadmin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Excel DATEDIF Function \u2013 How It Works, Formula Examples and Syntax\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"glavadmin\" \/>\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\":\"WebPage\",\"@id\":\"https:\/\/functiontranslator.com\/en\/datedif\/\",\"url\":\"https:\/\/functiontranslator.com\/en\/datedif\/\",\"name\":\"Excel DATEDIF Function \u2013 How It Works, Formula Examples and Syntax\",\"isPartOf\":{\"@id\":\"https:\/\/functiontranslator.com\/no\/#website\"},\"datePublished\":\"2025-07-15T13:34:46+00:00\",\"dateModified\":\"2021-02-13T11:33:32+00:00\",\"author\":{\"@id\":\"https:\/\/functiontranslator.com\/no\/#\/schema\/person\/87663eece497ca58643166ecb09f1389\"},\"description\":\"Learn what the Excel DATEDIF function does. Clear syntax explanation and useful formula examples.\",\"breadcrumb\":{\"@id\":\"https:\/\/functiontranslator.com\/en\/datedif\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/functiontranslator.com\/en\/datedif\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/functiontranslator.com\/en\/datedif\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Function Excel\",\"item\":\"https:\/\/functiontranslator.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Date and time\",\"item\":\"https:\/\/functiontranslator.com\/en\/date-and-time\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"DATEDIF\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/functiontranslator.com\/no\/#website\",\"url\":\"https:\/\/functiontranslator.com\/no\/\",\"name\":\"Function Translator\",\"description\":\"Excel function translator\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/functiontranslator.com\/no\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/functiontranslator.com\/no\/#\/schema\/person\/87663eece497ca58643166ecb09f1389\",\"name\":\"glavadmin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/functiontranslator.com\/no\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/03ccd9347c5339db75deede5a8c5b2bf1d40e0bce26a5251fcaac6331d381db8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/03ccd9347c5339db75deede5a8c5b2bf1d40e0bce26a5251fcaac6331d381db8?s=96&d=mm&r=g\",\"caption\":\"glavadmin\"},\"sameAs\":[\"https:\/\/functiontranslator.com\"],\"url\":\"https:\/\/functiontranslator.com\/en\/author\/glavadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Excel DATEDIF Function \u2013 How It Works, Formula Examples and Syntax","description":"Learn what the Excel DATEDIF function does. Clear syntax explanation and useful formula examples.","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:\/\/functiontranslator.com\/en\/datedif\/","og_locale":"en_US","og_type":"article","og_title":"Excel DATEDIF Function \u2013 How It Works, Formula Examples and Syntax","og_description":"Learn what the Excel DATEDIF function does. Clear syntax explanation and useful formula examples.","og_url":"https:\/\/functiontranslator.com\/en\/datedif\/","og_site_name":"Function Translator","article_published_time":"2025-07-15T13:34:46+00:00","article_modified_time":"2021-02-13T11:33:32+00:00","author":"glavadmin","twitter_card":"summary_large_image","twitter_title":"Excel DATEDIF Function \u2013 How It Works, Formula Examples and Syntax","twitter_misc":{"Written by":"glavadmin","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/functiontranslator.com\/en\/datedif\/","url":"https:\/\/functiontranslator.com\/en\/datedif\/","name":"Excel DATEDIF Function \u2013 How It Works, Formula Examples and Syntax","isPartOf":{"@id":"https:\/\/functiontranslator.com\/no\/#website"},"datePublished":"2025-07-15T13:34:46+00:00","dateModified":"2021-02-13T11:33:32+00:00","author":{"@id":"https:\/\/functiontranslator.com\/no\/#\/schema\/person\/87663eece497ca58643166ecb09f1389"},"description":"Learn what the Excel DATEDIF function does. Clear syntax explanation and useful formula examples.","breadcrumb":{"@id":"https:\/\/functiontranslator.com\/en\/datedif\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/functiontranslator.com\/en\/datedif\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/functiontranslator.com\/en\/datedif\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Function Excel","item":"https:\/\/functiontranslator.com\/en\/"},{"@type":"ListItem","position":2,"name":"Date and time","item":"https:\/\/functiontranslator.com\/en\/date-and-time\/"},{"@type":"ListItem","position":3,"name":"DATEDIF"}]},{"@type":"WebSite","@id":"https:\/\/functiontranslator.com\/no\/#website","url":"https:\/\/functiontranslator.com\/no\/","name":"Function Translator","description":"Excel function translator","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/functiontranslator.com\/no\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/functiontranslator.com\/no\/#\/schema\/person\/87663eece497ca58643166ecb09f1389","name":"glavadmin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/functiontranslator.com\/no\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/03ccd9347c5339db75deede5a8c5b2bf1d40e0bce26a5251fcaac6331d381db8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/03ccd9347c5339db75deede5a8c5b2bf1d40e0bce26a5251fcaac6331d381db8?s=96&d=mm&r=g","caption":"glavadmin"},"sameAs":["https:\/\/functiontranslator.com"],"url":"https:\/\/functiontranslator.com\/en\/author\/glavadmin\/"}]}},"_links":{"self":[{"href":"https:\/\/functiontranslator.com\/en\/wp-json\/wp\/v2\/posts\/129","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/functiontranslator.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/functiontranslator.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/functiontranslator.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/functiontranslator.com\/en\/wp-json\/wp\/v2\/comments?post=129"}],"version-history":[{"count":3,"href":"https:\/\/functiontranslator.com\/en\/wp-json\/wp\/v2\/posts\/129\/revisions"}],"predecessor-version":[{"id":3020,"href":"https:\/\/functiontranslator.com\/en\/wp-json\/wp\/v2\/posts\/129\/revisions\/3020"}],"wp:attachment":[{"href":"https:\/\/functiontranslator.com\/en\/wp-json\/wp\/v2\/media?parent=129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/functiontranslator.com\/en\/wp-json\/wp\/v2\/categories?post=129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/functiontranslator.com\/en\/wp-json\/wp\/v2\/tags?post=129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}