{"id":4101,"date":"2020-12-17T11:46:37","date_gmt":"2020-12-17T10:46:37","guid":{"rendered":"https:\/\/www.sheetgo.com\/?p=4101"},"modified":"2025-06-16T22:21:05","modified_gmt":"2025-06-16T20:21:05","slug":"formula-eomonth-google-sheets","status":"publish","type":"post","link":"https:\/\/www.sheetgo.com\/pt\/blog\/google-sheets-formulas\/eomonth-formula-google-sheets\/","title":{"rendered":"Como usar a fun\u00e7\u00e3o EOMONTH no Planilhas Google"},"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; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>The <a href=\"https:\/\/support.google.com\/docs\/answer\/3093044?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">EOMONTH<\/a> function in Google Sheets stands for \u201c<strong>E<\/strong>nd <strong>O<\/strong>f <strong>MONTH<\/strong>\u201c, and rightly so. It returns the last calendar date of a month that is a specified number of months behind or ahead of a given date.<\/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<h2>Syntax<\/h2>\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;]=EOMONTH(start_date, months)[\/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<ul>\n<li><strong>start_date<\/strong> \u2013 is the date that the EOMONTH function calculates the last date of a month from.<\/li>\n<li><strong>months<\/strong> \u2013 is the number of months that the function should move either in forward or backward in time, corresponding to a positive value or a negative value respectively.<\/li>\n<\/ul>\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<h2>How to use the EOMONTH function<\/h2>\n<p>I\u2019ll demonstrate the function using a few examples. Please consider the snapshot below.<\/p>\n<p>Note that the Result column has been formatted to \u201cdd-mmm-yyyy\u201d for the purposes of avoiding ambiguity (given that the date notations varies across countries).<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2020\/12\/EOMonth-image-1-1-1.png&#8221; alt=&#8221;eomonth-function-google-sheets-1&#8243; title_text=&#8221;eomonth-function-google-sheets-1&#8243; align=&#8221;center&#8221; _builder_version=&#8221;4.23.1&#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; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>In the first example case, the start_date parameter takes in the output that the DATE() function returned. And I have set the months parameter to \u20180\u2019, meaning that the function will not move the date forward or backwards in time. Therefore, the function evaluates the end date within the month to 31-Mar-2020.<\/p>\n<p>Let\u2019s take a look at the second case. At the time of writing, the date was 14-Nov-2020 (which the TODAY() function evaluated to in the second example). Factoring a shift of 15 days added to the TODAY() function, along with a value of 12 for months parameter, gives the last date of the month as 30-Nov-2021.<\/p>\n<p>The third example is pretty similar, except for the start_date parameter I provided a reference to the cell that has a date.<\/p>\n<p>Unlike the previous three cases, the start_date for the fourth case is an absolute number. I also keyed in a negative value for the months parameter. The EOMONTH function calculates the last date by shifting the time from the date value 42,846 (equivalent to 21-Apr-2017) back by nine months.<\/p>\n<p>[\/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.27.2&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>Cases of interest<\/h3>\n<p>Let us experiment a little further and input text based date values for the <strong>start_date<\/strong> parameter.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2020\/12\/EOMonth-image-2-1.png&#8221; alt=&#8221;eomonth-function-google-sheets-2&#8243; title_text=&#8221;eomonth-function-google-sheets-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; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>In the first example, the function trims the decimal values and uses only the integer values. Accordingly, it evaluates the last date of the month. Of course, it cannot accept negative numbers, as there is no date interpretation for such values.<\/p>\n<p>From the next three examples, you can see that the EOMONTH function accepts input date strings in the \u201cdd-mmm-yyyy\u201d and \u201cdd-mm-yyyy\u201d formats. But it will generate an error with \u201cmm-dd-yyyy\u201d date format strings.<\/p>\n<h4>Use case: BOMONTH anybody?<\/h4>\n<p>Is there a counterpart to EOMONTH, something like BOMONTH (that stands for <strong>B<\/strong>eginning <strong>O<\/strong>f <strong>MONTH<\/strong>)? Apparently, no! But fortunately, you can make use of the EOMONTH function to build a virtual BOMONTH function, as shown in the snapshot below.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2020\/12\/EOMonth-image-3-1.png&#8221; alt=&#8221;eomonth-function-google-sheets-3&#8243; title_text=&#8221;eomonth-function-google-sheets-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>In this example, I\u2019ve added a +1 at the end of the function. This adds 1 day, pushing the date from the last day of the month to the first day of the next month. Because this takes the date to the next month, you also have to add -1 as the months parameter. This will shift the function back 1 month, and give you the date of the first day of the current month. The formula here is <strong>=EOMONTH(TODAY(),-1)+1<\/strong>.<\/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>Use case: last Monday of the month<\/h4>\n<p>Since the work week is typically Monday to Friday, it can be helpful in some cases to be able to find the last Monday of every month. In the screenshot below, I\u2019ve done just that.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2020\/12\/EOMonth-image-4-1.png&#8221; alt=&#8221;eomonth-function-google-sheets-4&#8243; title_text=&#8221;eomonth-function-google-sheets-4&#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>The WEEKDAY function is used here to get the day of the week that the last day of the month falls on. I&#8217;ve used numbers 1 through 7 (1 being Monday, 2 is Tuesday, etc.). By subtracting the weekday and adding 1, you can get the last Monday of the month. The formula for this is <strong>=EOMONTH(&#8220;5-Dec-2020&#8221;,0)-(WEEKDAY(EOMONTH(&#8220;5-Dec-2020&#8221;,0),2))+1<\/strong>.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>If we need to know the date of a specified number of months before or after a given date, we use the\u00a0<a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-formulas\/edate-formula-google-sheets\/\" target=\"_blank\" rel=\"noopener noreferrer\">EDATE function in Google Sheets<\/a>.<\/p>\n<p>[\/et_pb_text][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>The EOMONTH function in Google Sheets stands for \u201cEnd Of MONTH\u201c, and rightly so. It returns the last calendar date of a month that is a specified number of months behind or ahead of a given date.Syntax=EOMONTH(start_date, months) start_date \u2013 is the date that the EOMONTH function calculates the last date of a month from. [&hellip;]<\/p>\n","protected":false},"author":40,"featured_media":29469,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_et_pb_use_builder":"on","_et_pb_old_content":"The <a href=\"https:\/\/support.google.com\/docs\/answer\/3093044?hl=en\" target=\"_blank\" rel=\"noopener\">EOMONTH<\/a> formula notation in Google Sheets stands for \"<strong>E<\/strong>nd <strong>O<\/strong>f <strong>MONTH<\/strong>\", and rightly so. It returns the last calendar date of a month that is a specified number of months behind or ahead of a given date.\n<h3>Syntax<\/h3>\n<span style=\"font-family: courier new,courier,monospace; font-size: 14pt;\"><strong>EOMONTH(start_date, months)<\/strong><\/span>\n<ul>\n \t<li><span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>start_date<\/strong><\/span> - is the date that the EOMONTH formula calculates the last date of a month from.<\/li>\n \t<li><span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>months<\/strong><\/span> - is the number of months that the formula should move either in forward or backward in time, corresponding to a positive value or a negative value respectively.<\/li>\n<\/ul>\n<h3>Usage: EOMONTH formula<\/h3>\nLet us understand it's working by making use of a few examples. Please consider the snapshot below. Please note that we have preset the Result column format to \"dd-mmm-yyyy\", for the purposes of avoiding ambiguity (given that the date notations varies across countries).\n\n<img class=\"aligncenter size-full wp-image-4111\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/10\/frame-generic-24.png\" alt=\"EOMONTH Formula - Illustration 1\" width=\"498\" height=\"171\">\n\nIn the first example case, the <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>start_date<\/strong><\/span> parameter takes in the output that the DATE() function returned. And we have set the <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>months<\/strong><\/span> parameter to '0'. Therefore, the formula evaluates the end date within the month to 31-Mar-2017.\n\nLet us take a look at the second case. At the time of writing this post, the date was 21-Apr-2017 (which, the TODAY() function evaluated to in the second example). Factoring a shift of 15 days we added to the TODAY() function, along with a value of 12 for <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>months<\/strong><\/span> parameter, we get the last date of the month as 31-May-2018.\n\nThe third example is pretty similar, except for the <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>start_date<\/strong><\/span> parameter, we provided a reference to the cell that has a date.\n\nUnlike the previous three cases, the <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>start_date<\/strong><\/span> for the fourth case is an absolute number. And also, we have keyed in a negative value for the <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>month's<\/strong><\/span> parameter. The EOMONTH formula calculates the last date by shifting the time from the date value 42,846 (equivalent to 21-Apr-2017) back by nine months.\n<h5>Cases of interest<\/h5>\nLet us experiment a little further and input text based date values for the <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>start_date<\/strong><\/span> parameter.\n\n<img class=\"aligncenter size-full wp-image-4114\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/10\/frame-generic-25.png\" alt=\"EOMONTH Formula - Illustration 2\" width=\"597\" height=\"295\">\n\nIn the first example, the formula truncates the decimal values and uses only the integer values and accordingly evaluates the last date of the month. Of course, it cannot accept negative numbers, as there is no date interpretation for such values.\n\nFrom the next three examples, it seems that the EOMONTH formula is okay with accepting input date strings in the \"dd-mmm-yyyy\" and \"mm-dd-yyyy\" formats. But it will throw up an error with \"dd-mm-yyyy\" date format strings.\n<h5>Use case: BOMONTH anybody?<\/h5>\nIs there a counterpart to EOMONTH, something like BOMONTH (that stands for <strong>B<\/strong>eginning <strong>O<\/strong>f <strong>MONTH<\/strong>)? Apparently, no! But fortunately, we can make use of the EOMONTH formula to build a virtual BOMONTH formula, as shown in the snapshot below.\n\n<img class=\"aligncenter size-full wp-image-4115\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/10\/frame-generic-26.png\" alt=\"EOMONTH Formula - Illustration 3\" width=\"494\" height=\"123\">\n\n&nbsp;","_et_gb_content_width":"","footnotes":""},"categories":[54],"tags":[39,28],"class_list":["post-4101","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-google-sheets-formulas","tag-connections-t","tag-spreadsheets"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts\/4101","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/comments?post=4101"}],"version-history":[{"count":0,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts\/4101\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/media\/29469"}],"wp:attachment":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/media?parent=4101"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/categories?post=4101"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/tags?post=4101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}