{"id":3174,"date":"2021-03-28T18:38:08","date_gmt":"2021-03-29T01:38:08","guid":{"rendered":"https:\/\/SUMMALAI.COM\/?p=3174"},"modified":"2021-03-31T08:53:37","modified_gmt":"2021-03-31T15:53:37","slug":"how-to-use-date-and-eomonth-to-get-first-day-and-last-day-of-the-month-and-year","status":"publish","type":"post","link":"https:\/\/SUMMALAI.COM\/?p=3174","title":{"rendered":"How to Use DATE and EOMONTH to Get First Day and Last Day of the Month and Year."},"content":{"rendered":"\n<p><strong>On this page, you will find some formulas to calculate specific days automatically<\/strong>. Building specific dates, such as the first or last day, is always a very complex task, in Excel or any other software.<\/p>\n\n\n\n<p>The function TODAY has been used in all the examples but you can replace it with your own date value.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">First day &#8211; Last day of the month<\/h3>\n\n\n\n<p>These calculations is really easy to do with&nbsp;the DATE&nbsp;function.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">First day of the month<\/h3>\n\n\n\n<p>=DATE(YEAR(TODAY()),MONTH(TODAY()),1)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Calculate First Day of the Month with EOMONTH<\/h3>\n\n\n\n<p>There\u2019s no Excel function to calculate the first day of the month, but the&nbsp;EOMONTH function will calculate the last day of a month.<\/p>\n\n\n\n<p>To find the first day of a month we will calculate the last day of the previous month and add one day.<\/p>\n\n\n\n<p>=EOMONTH(B3,-1)<\/p>\n\n\n\n<p>Here let\u2019s find the last day of the previous month:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.automateexcel.com\/excel\/wp-content\/uploads\/2020\/04\/Last-day-of-Previous-Month.png\" alt=\"Last day of Previous Month\" class=\"wp-image-16809\"\/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Last day of the month<\/h3>\n\n\n\n<p>In Excel, 1 is one day and not one hour. So using this rule, we just have to subtract 1 from the formula that calculates the first day of the next month.<\/p>\n\n\n\n<p>=DATE(YEAR(TODAY()),MONTH(TODAY())+1,1)-1<\/p>\n\n\n\n<p>Or you can use the function EOMONTH<\/p>\n\n\n\n<p>=EOMONTH(TODAY(),0)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">First Monday of the month<\/h3>\n\n\n\n<p>=TODAY()-DAY(TODAY())+8-WEEKDAY(TODAY()-DAY(TODAY())+6)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Last Monday of the month<\/h3>\n\n\n\n<p>=DATE(YEAR(TODAY()),MONTH(TODAY())+1,1)-WEEKDAY(DATE(YEAR(TODAY()),MONTH(TODAY())+1,6))<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Examples with the date of TODAY<\/strong><\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Next Quarter<\/h3>\n\n\n\n<p>If you want to return the first day of the current quarter, we need to use the MOD function to return a gap of 0, 1 or 2 months<\/p>\n\n\n\n<p>=DATE(YEAR(B2);MONTH(B2)-MOD(MONTH(B2)-1;3);1)<\/p>\n\n\n\n<p>And to return the first day of the next quarter, the formula is<\/p>\n\n\n\n<p>=DATE(YEAR(B2);MONTH(B2)-MOD(MONTH(B2)-1;3)+3;1)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">First day &#8211; Last day of the year<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">First day of the year<\/h3>\n\n\n\n<p>=DATE(YEAR(TODAY()),1,1)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Last day of the year<\/h3>\n\n\n\n<p>=DATE(YEAR(TODAY())+1,1,0)<\/p>\n\n\n\n<p>or<\/p>\n\n\n\n<p>=DATE(YEAR(TODAY()),12,31)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">First Monday of the year<\/h3>\n\n\n\n<p>=DATE(YEAR(TODAY()),1,8)-WEEKDAY(DATE(YEAR(TODAY()),1,6))<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Last Monday of the year<\/h3>\n\n\n\n<p>=DATE(YEAR(TODAY())+1,1,0)-WEEKDAY(DATE(YEAR(TODAY()),1,6))<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Number of days in the month<\/h3>\n\n\n\n<p>A very important and often ignored piece of information is the number of days in a month. For monthly reports, this information is very important.<\/p>\n\n\n\n<p>The following formulas allow you to return the number of days in a month.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Number of days in the current month<\/h3>\n\n\n\n<p>=DAY(DATE(YEAR(TODAY()),MONTH(TODAY())+1,1)-1)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Number of days in the next month<\/h3>\n\n\n\n<p>=DAY(DATE(YEAR(TODAY()),MONTH(TODAY())+2,1)-1)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Number of days in the previous month<\/h3>\n\n\n\n<p>=DAY(DATE(YEAR(TODAY()),MONTH(TODAY()),1)-1)<\/p>\n\n\n\n<p>Ref: <a href=\"https:\/\/www.excel-exercise.com\/first-day-last-day-in-excel\/\">Return the first day or the last day (Month, Quarter, Year) &#8211; Excel Exercise (excel-exercise.com)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>On this page, you will find some formulas to calculate specific days automatically. Building specific dates, such as the first or last day, is always a very complex task, in Excel or any other software. The function TODAY has been used in all the examples but you can replace it with your own date value. <a class=\"read-more\" href=\"https:\/\/SUMMALAI.COM\/?p=3174\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[10,18],"tags":[659],"class_list":["post-3174","post","type-post","status-publish","format-standard","hentry","category-microsoft","category-microsoft-office","tag-eomonth"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/3174","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3174"}],"version-history":[{"count":3,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/3174\/revisions"}],"predecessor-version":[{"id":3183,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/3174\/revisions\/3183"}],"wp:attachment":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3174"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3174"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}