{"id":7553,"date":"2021-09-06T13:09:00","date_gmt":"2021-09-06T11:09:00","guid":{"rendered":"https:\/\/www.sheetgo.com\/?p=5998"},"modified":"2025-06-16T21:27:26","modified_gmt":"2025-06-16T19:27:26","slug":"calcular-las-diferencias-entre-fechas-en-google-sheets","status":"publish","type":"post","link":"https:\/\/www.sheetgo.com\/es\/blog\/google-sheets-features\/calculate-the-differences-between-dates-in-google-sheets\/","title":{"rendered":"C\u00f3mo calcular diferencias entre fechas en Google Sheets"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; admin_label=&#8221;section&#8221; module_class=&#8221;sheetgo-post&#8221; _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221; da_is_popup=&#8221;off&#8221; da_exit_intent=&#8221;off&#8221; da_has_close=&#8221;on&#8221; da_alt_close=&#8221;off&#8221; da_dark_close=&#8221;off&#8221; da_not_modal=&#8221;on&#8221; da_is_singular=&#8221;off&#8221; da_with_loader=&#8221;off&#8221; da_has_shadow=&#8221;on&#8221; da_disable_devices=&#8221;off|off|off&#8221;][et_pb_row admin_label=&#8221;row&#8221; _builder_version=&#8221;4.16&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>From basic functions to the most advanced formulas, Google Sheets is a staple for many users managing data. This includes calculating the difference between dates, too. There are a variety of situations where calculating the difference between dates is an essential task for business operations. An example of this is in project management. You may need to calculate the <a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-formulas\/duration-formula-in-google-sheets\/\" target=\"_blank\" rel=\"noopener\">duration<\/a> of entire projects in order to delegate these to your team members. In this article, we will show you how to calculate the difference between dates in Google Sheets. This will help to streamline your process and maximize your overall efficiency.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>Calculating the differences between two dates in Google Sheets<\/h3>\n<p>Google Sheets offers several options in which you can calculate your dates. Each varies in the level of complexity to suit your spreadsheet experience or objectives. Let\u2019s first look at the simpler ways you can calculate the difference between dates in Google Sheets.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>How to subtract dates in Google Sheets easily<\/h3>\n<h4>Option 1: Simply subtract<\/h4>\n<p>Firstly, it\u2019s important to note that Google Sheets will process dates exactly as any other numerical value. In other words, you can use simple calculations like <b>add<\/b> and <b>subtract<\/b> to calculate the difference between your two dates. So, the simplest way is to type a simple minus (-) between your dates.<\/p>\n<p>Simply input: <b>=[end_date]-[start_date]<\/b>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.16&#8243; border_width_left=&#8221;4px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>=[end_date]-[start_date]<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/09\/Date-Dif-GS.png&#8221; alt=&#8221;google sheets between two dates 0&#8243; title_text=&#8221;Date Dif GS&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>Please note that when you subtract dates, Google Sheets does not include the start date in the total. For example, let\u2019s say your project starts on 5 May and ends on 12 May. Using a subtract calculation, the result is 7. It counts 7 days: 6th, 7th, 8th, 9th, 10th, 11th, and 12th May.<\/p>\n<p>So, if you want to include the start date, you must <b>add 1<\/b> to the end of your formula:<\/p>\n<p><b>=[end_date]-[start_date]+1<\/b>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.16&#8243; border_width_left=&#8221;4px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]=[end_date]-[start_date]+1[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>You can also use the <a href=\"https:\/\/support.google.com\/docs\/answer\/3093977?hl=en\" target=\"_blank\" rel=\"noopener\">MINUS<\/a> function in the same way. Simply substitute your minus symbol (<b>&#8211;<\/b>) with the word.<\/p>\n<p>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.16&#8243; border_width_left=&#8221;4px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><b>=MINUS(<\/b><span style=\"font-weight: 400;\">[end_date]<\/span><b>,<\/b><span style=\"font-weight: 400;\">[start_date]<\/span><b>)<\/b><\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/09\/Date-Dif-GS-\u2013-1.png&#8221; alt=&#8221;google sheets between two dates 1&#8243; title_text=&#8221;Date Dif GS \u2013 1&#8243; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h4>Option 2: The DAYS formula<\/h4>\n<p>The <a href=\"https:\/\/support.google.com\/docs\/answer\/9061296?hl=en\" target=\"_blank\" rel=\"noopener\">DAYS function<\/a> is a slightly smarter function you can use to subtract dates in Google Sheets. Not only does it return the total number of days between dates, but also factors in leap years. Here is the DAYS function formula:[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.16&#8243; border_width_left=&#8221;4px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><b>=DAYS(<\/b><span style=\"font-weight: 400;\">[end_date]<\/span><b>,<\/b><span style=\"font-weight: 400;\">[start_date]<\/span><b>)<\/b><\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/09\/Date-Dif-GS-\u2013-2.png&#8221; alt=&#8221;google sheets between two dates 2&#8243; title_text=&#8221;Date Dif GS \u2013 2&#8243; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]Work in a finance role and need to calculate financial interest and fixed-income securities based on a 360-day year? Read our article on <a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-formulas\/days360-formula-in-google-sheets\/\" target=\"_blank\" rel=\"noopener\">How to use the specialist function DAYS360<\/a>.[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>More advanced day-counting functions in Google Sheets<\/h3>\n<p>The above options were the more basic ways you could calculate between days. The following options are more advanced, however, they leave you with more flexibility in your calculations.<\/p>\n<p>In our example, the projects start and end on specific dates. But, team members will only work on the project on their work days, i.e. weekdays. Let\u2019s take a look at these more advanced options to help us account for these variables.<\/p>\n<h4>Option 3: Use the NETWORKDAYS function<\/h4>\n<p>NETWORKDAYS is a very handy formula to subtract dates within Google Sheets whilst only counting weekdays. This formula stands for Net Working Days, thus excluding the weekends from its calculations.<\/p>\n<p>Moreover, you can customize NETWORKDAYS to calculate non-standard working weeks (i.e. not Monday through Friday) or even to exclude public holidays. If you would like to learn more about this, check out our <a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-formulas\/networkdays-formula-google-sheets\/\" target=\"_blank\" rel=\"noopener\">Guide to using the NETWORKDAYS function<\/a>.<\/p>\n<p>For this example, we will use the most simple syntax for NETWORKDAYS:[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.16&#8243; border_width_left=&#8221;4px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><b>=NETWORKDAYS(<\/b><span style=\"font-weight: 400;\">[start_date],[end_date]<\/span><b>)<\/b><\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]For more customizable formulas, take a look at the <a href=\"https:\/\/support.google.com\/docs\/answer\/3092979?hl=en\" target=\"_blank\" rel=\"noopener\">NETWORKDAYS syntax<\/a>.[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/09\/Date-Dif-GS-\u2013-3.png&#8221; alt=&#8221;google sheets between two dates 3&#8243; title_text=&#8221;Date Dif GS \u2013 3&#8243; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>NETWORKDAYS can successfully calculate the total number of <b>working days<\/b>. But what about if we want to calculate a date difference in months or years? The next option is the perfect solution.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h4>Option 4: Use the DATEDIF function<\/h4>\n<p><a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-formulas\/datedif-formula-google-sheets\/\" target=\"_blank\" rel=\"noopener\">DATEDIF<\/a> stands for Date Difference. It allows you to calculate the difference in dates in either days, months or years.<\/p>\n<p>Here is the basic DATEDIF syntax:[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.16&#8243; border_width_left=&#8221;4px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]=DATEDIF([start_date],[end_date], unit)[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>The <b>unit<\/b> is the time measurement you want to use to calculate your date difference. Here is a comprehensive list of each unit and what it does:<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/09\/google-sheets-between-dates-1.png&#8221; alt=&#8221;google sheets between dates DATEDIF units&#8221; title_text=&#8221;google sheets between dates 1&#8243; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>Here are the examples using the three more basic DATEDIF formulas:<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/09\/Date-Dif-GS-\u2013-5.png&#8221; alt=&#8221;google sheets between two dates 5&#8243; title_text=&#8221;Date Dif GS \u2013 5&#8243; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]As you can see, we have calculated the difference in dates using days, months and years as the measurement. The days formula essentially works the same way as the MINUS formula. Nevertheless, <a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-formulas\/datedif-formula-google-sheets\/\" target=\"_blank\" rel=\"noopener\">DATEDIF<\/a> is the only formula that can achieve these calculations using months and years as the measurement units.<\/p>\n<p>Now let\u2019s look at the other <a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-formulas\/datedif-formula-google-sheets\/\" target=\"_blank\" rel=\"noopener\">DATEDIF<\/a> formulas that you can use in Google Sheets.[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h5>How to use MD, YM and YD units in DATEDIF<\/h5>\n<p>Observing the unit list above, MD, YM and YD find a difference between dates by calculating one unit and excluding the other. Let\u2019s look at some examples and see how each formula works.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/09\/Date-Dif-GS-\u2013-6.png&#8221; alt=&#8221;google sheets between two dates 6&#8243; title_text=&#8221;Date Dif GS \u2013 6&#8243; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]As you can see, using the \u201cMD\u201d unit, the formula excludes the number of months in the calculation. Instead, it focuses on the difference between the two days (5th and 16th). Subtracting these from one another comes to 11.<\/p>\n<p>For the \u201cYM\u201d unit, the formula excludes the difference in years between the two dates. It calculates the difference between March and July, which is 4.<\/p>\n<p>Finally, calculating the date difference with \u201cYD\u201d, the calculation excludes the difference in years. It calculates the difference between 3 January and 24 July instead, which gives us 202.<\/p>\n<p>If you would like a more in-depth breakdown of this formula, take a look at our page on <a href=\"https:\/\/support.google.com\/docs\/answer\/6055612?hl=en\" target=\"_blank\" rel=\"noopener\">DATEDIF syntax<\/a>.[\/et_pb_text][et_pb_text admin_label=&#8221;Connections T &#8211; Automate between spreadsheets &#8211; Horizontal&#8221; module_class=&#8221;sheetgo-post-no-shadow-img md2-contained-button-light vertical-banner-container&#8221; _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; background_color=&#8221;#f2f7ff&#8221; max_width=&#8221;700px&#8221; module_alignment=&#8221;center&#8221; max_height=&#8221;300px&#8221; custom_margin=&#8221;20px|0px|20px|0px|true|true&#8221; custom_padding=&#8221;25px|25px|25px|25px|true|true&#8221; sticky_limit_bottom=&#8221;section&#8221; border_radii=&#8221;on|20px|20px|20px|20px&#8221; border_width_all=&#8221;1px&#8221; border_color_all=&#8221;#d9e7ff&#8221; saved_tabs=&#8221;all&#8221; global_colors_info=&#8221;{}&#8221; global_module=&#8221;255443&#8243; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/09\/run-automatically-connect-sheet-icons.webp\" width=\"250\" height=\"168\" alt=\"\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/09\/Recommended-for-Google-Workspace-badge.webp\" width=\"150\" height=\"180\" alt=\"39\" \/><\/p>\n<p><span style=\"font-size: 22px; font-weight: 600;\">Automate data transfers between spreadsheets<br \/><\/span><\/p>\n<p><a href=\"https:\/\/www.sheetgo.com\/connections\/\" target=\"_blank\" rel=\"noopener\">Find out how<\/a><\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>And there you have it!<\/h3>\n<p>As you can see, there are numerous ways to calculate the difference between two dates in Google Sheets. Each formula offers a unique feature to help fulfill your objectives.<\/p>\n<p>If you would like to learn more about special functions in Google Sheets, read the article about the <a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-formulas\/networkdays-formula-google-sheets\/\">NETWORKDAYS formula in Google Sheets.<\/a><\/p>\n<p><span>Alternatively, check out related blog posts below!<\/span>[\/et_pb_text][et_pb_code _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<script type=\"application\/ld+json\"> {<!-- [et_pb_line_break_holder] -->  \"@context\": \"https:\/\/schema.org\",<!-- [et_pb_line_break_holder] -->  \"@type\": \"Article\",<!-- [et_pb_line_break_holder] -->  \"about\": [<!-- [et_pb_line_break_holder] -->    {\"@type\": \"Thing\",\"name\": \"Google Sheets\",\"sameAs\": \"https:\/\/en.wikipedia.org\/wiki\/Google_Sheets\"} <!-- [et_pb_line_break_holder] -->  ],<!-- [et_pb_line_break_holder] -->  \"mentions\": [<!-- [et_pb_line_break_holder] -->    {\"@type\": \"Thing\",\"name\": \"formulas\",\"sameAs\": \"https:\/\/en.wikipedia.org\/wiki\/Spreadsheet#Formulas\"}, <!-- [et_pb_line_break_holder] -->    {\"@type\": \"Thing\",\"name\": \"users\",\"sameAs\": \"https:\/\/en.wikipedia.org\/wiki\/User_(computing)\"}, <!-- [et_pb_line_break_holder] -->    {\"@type\": \"Thing\",\"name\": \"managing\",\"sameAs\": \"https:\/\/en.wikipedia.org\/wiki\/Management\"}, <!-- [et_pb_line_break_holder] -->    {\"@type\": \"Thing\",\"name\": \"calculating\",\"sameAs\": \"https:\/\/en.wikipedia.org\/wiki\/Calculation\"}, <!-- [et_pb_line_break_holder] -->    {\"@type\": \"Thing\",\"name\": \"business\",\"sameAs\": \"https:\/\/en.wikipedia.org\/wiki\/Business\"}<!-- [et_pb_line_break_holder] -->  ]<!-- [et_pb_line_break_holder] -->}<!-- [et_pb_line_break_holder] --><\/script><!-- [et_pb_line_break_holder] -->[\/et_pb_code][et_pb_text _builder_version=&#8221;4.22.2&#8243; background_color=&#8221;#f9f9ff&#8221; custom_margin=&#8221;40px||40px||false|false&#8221; custom_padding=&#8221;15px|25px|15px|25px|true|true&#8221; border_width_left=&#8221;3px&#8221; border_color_left=&#8221;#808e95&#8243; saved_tabs=&#8221;all&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><em><strong>Editor\u2019s note<\/strong>: This is a revised version of a previous post that has been updated for accuracy and comprehensiveness.<\/em><\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>From basic functions to the most advanced formulas, Google Sheets is a staple for many users managing data. This includes calculating the difference between dates, too. There are a variety of situations where calculating the difference between dates is an essential task for business operations. An example of this is in project management. You may [&hellip;]<\/p>\n","protected":false},"author":40,"featured_media":36337,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_et_pb_use_builder":"on","_et_pb_old_content":"If we need to calculate the differences between dates in Google Sheets, we have multiple possible solutions.\n<h3>1. Calculate the difference directly<\/h3>\nThis is undoubtedly the easiest approach. Because all we need to apply in the formula is a simple minus (-) operator.\n\n<strong>Example<\/strong> <img class=\"aligncenter size-full wp-image-6028\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/differ1.png\" alt=\"Difference between dates - Illustration 1\" width=\"450\" height=\"118\">\n\nWe can as well use the <a href=\"https:\/\/support.google.com\/docs\/answer\/3093977?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">MINUS<\/a> function for this purpose, but essentially we get the same result.\n\n<strong>Example<\/strong> <img class=\"aligncenter size-full wp-image-6029\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/differ2.png\" alt=\"Difference between dates - Illustration 2\" width=\"450\" height=\"118\">\n\nWhile this is simple to use, we get the total differences in days. We can't factor in any other variable. For instance, consider that we need to calculate the differences between dates in Google Sheets by ignoring the holidays. How do we go about it? Simple, consider the second approach.\n<h3>2. Use the NETWORKDAYS function<\/h3>\nPlease go through this elaborate <a href=\"https:\/\/www.sheetgo.com\/networkdays-formula-google-sheets\/\" target=\"_blank\" rel=\"noopener noreferrer\">blog post<\/a> to understand the syntax and the application examples of the <a href=\"https:\/\/support.google.com\/docs\/answer\/3092979?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">NETWORKDAYS<\/a> formula.\n\nWith these two approaches, we got the differences only in days. What if we were to obtain the difference in months or years? We will have to use a combination of formulas that might make it more complicated. Instead, we have a more sophisticated and direct function available.\n<h3>3. Use the DATEDIF function<\/h3>\nThe&nbsp;<a href=\"https:\/\/support.google.com\/docs\/answer\/6055612?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">DATEDIF<\/a>&nbsp;stands for \u201cDate Difference\u201d. Depending on the specified unit type, the output is in either number of days, months or years. Here's a quick primer on its syntax.\n\n<strong>DATEDIF(start_date, end_date, unit)<\/strong>\n\nThe parameters<strong> start_date <\/strong>and<strong> end_date<\/strong> are pretty much self-explanatory. The <strong>unit<\/strong> parameter indicates which among the following measurement units the output should be displayed in.\n\n&nbsp;\n\n<img class=\"aligncenter size-full wp-image-6031\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/differ3.png\" alt=\"Difference between dates - Illustration 3\" width=\"443\" height=\"169\">\n\nThe first three units \"Y', \"M\" and \"D\" are pretty straightforward, but the last three needs a little more explanation. Here are the various scenarios where we could put the <a href=\"https:\/\/support.google.com\/docs\/answer\/6055612?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">DATEDIF<\/a> formula to effective use. Because examples clear the concept better.\n\n<img class=\"aligncenter size-full wp-image-4370\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/differ4.png\" alt=\"DATEDIF Formula - Illustration 2\" width=\"663\" height=\"218\">\n\nIn the first case (row # 2), the&nbsp;<strong>unit&nbsp;<\/strong>parameter is \u201cD\u201d. Hence, it should return the number of days between&nbsp;<strong>start_date<\/strong>&nbsp;and&nbsp;<strong>end_date<\/strong>. Therefore, it returned 125 as output, just like when we tried the <a href=\"https:\/\/support.google.com\/docs\/answer\/3093977?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">MINUS<\/a> function.\n\nThe second case takes the same dates (although in the form of <a href=\"https:\/\/support.google.com\/docs\/answer\/3092969?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">DATE<\/a> functions) for inputs. But the&nbsp;<strong>unit<\/strong>&nbsp;parameter is \u201cM\u201d. So, we can expect the number of whole months that have elapsed from 01-Jan-2017&nbsp;to 06-May-2017.\n\nFor the third example, we used different means of expressing dates for&nbsp;<strong>start_date<\/strong>&nbsp;and&nbsp;<strong>end_date&nbsp;<\/strong>parameters. The&nbsp;<strong>unit<\/strong>&nbsp;here is \u201cY\u201d, therefore the formula returns the number of whole years that have elapsed from 01-Jun-2001 to 06-May-2017.\n<h5>Interesting cases of \u201cMD\u201d, \u201cYM\u201d and \u201cYD\u201d<\/h5>\n\u201cMD\u201d is the <strong>unit<\/strong> parameter in the fourth example. It should give us the number of days between the two dates, by ignoring any number of whole months that have elapsed in between. So, the <a href=\"https:\/\/support.google.com\/docs\/answer\/6055612?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">DATEDIF<\/a> formula doesn't consider days from&nbsp;all the elapsed months starting from 01-Jun-2001 to 01-May-2017. Therefore it returns 5 for output.\n\n\u201cYM\u201d unit in the fifth example ensures the output is in months after ignoring any whole years elapsed after&nbsp;<strong>start_date<\/strong>&nbsp;and before&nbsp;<strong>end_date<\/strong>. So the formula ignores all the whole years from 02-Feb-2002 till 02-Feb-2017. Therefore, 3 is the number of whole months that have elapsed after 02-Feb-2017 and before 31-May-2017.\n\nThe sixth example uses the unit \u201cYD\u201d. So it should give us the output in a number of days after not considering years elapsed between the specified dates.&nbsp;So after ignoring all the years elapsed between 02-Feb-2002 to 02-Feb-2017, the number of days it takes to reach 02-Feb-2017 to 31-May-2017 is 119.\n<h3>Conclusion<\/h3>\nWhile the third approach seems to have more options, it is not necessary that we always go with it. If our need is to just calculate the differences between dates in Google Sheets, in days, we could very well go with the first approach. Because the ideal solution is one which suits the individual needs best. Therefore it is up to the person to identify what works best for him\/her.","_et_gb_content_width":"","footnotes":""},"categories":[37],"tags":[39,28],"class_list":["post-7553","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-google-sheets-features","tag-connections-t","tag-spreadsheets"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/posts\/7553","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/comments?post=7553"}],"version-history":[{"count":0,"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/posts\/7553\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/media\/36337"}],"wp:attachment":[{"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/media?parent=7553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/categories?post=7553"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/tags?post=7553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}