• Microsoft Office
  • Microsoft Windows
  • Other Software
    • Microsoft Visual
    • Microsoft Project
    • Microsoft Visio
  • Anti Virus
  • Blog
    • Word
    • Excel
    • Powerpoint
    • Software tricks/tips
  • POLICIES
    • PAYMENT GUIDE
    • SHIPPING POLICY
    • REFUND POLICY
    • TERMS & CONDITIONS
    • Contact Us

No products in the cart.

  • Microsoft Office
  • Microsoft Windows
  • Other Software
    • Microsoft Visual
    • Microsoft Project
    • Microsoft Visio
  • Anti Virus
  • Blog
    • Word
    • Excel
    • Powerpoint
    • Software tricks/tips
  • POLICIES
    • PAYMENT GUIDE
    • SHIPPING POLICY
    • REFUND POLICY
    • TERMS & CONDITIONS
    • Contact Us

No products in the cart.

  • Microsoft Office
  • Microsoft Windows
  • Other Software
    • Microsoft Visual
    • Microsoft Project
    • Microsoft Visio
  • Anti Virus
  • Blog
    • Word
    • Excel
    • Powerpoint
    • Software tricks/tips
  • POLICIES
    • PAYMENT GUIDE
    • SHIPPING POLICY
    • REFUND POLICY
    • TERMS & CONDITIONS
    • Contact Us

No products in the cart.

  • Microsoft Office
  • Microsoft Windows
  • Other Software
    • Microsoft Visual
    • Microsoft Project
    • Microsoft Visio
  • Anti Virus
  • Blog
    • Word
    • Excel
    • Powerpoint
    • Software tricks/tips
  • POLICIES
    • PAYMENT GUIDE
    • SHIPPING POLICY
    • REFUND POLICY
    • TERMS & CONDITIONS
    • Contact Us
Excel

How to utilize EOMONTH() function in Excel to obtain the last day of the month and more

0 Comments

Dates are an essential component in many spreadsheets, but they can sometimes be perplexing, particularly when Excel lacks a date function that precisely returns the desired value. Fortunately, the more you comprehend, the easier it becomes to work with dates. In this article, I will demonstrate a date function that returns the last day of a specified month and beyond. The “beyond” aspect proves to be quite useful. Even if you do not currently require this function, it is advantageous to be aware of it for future reference.

What is EOMONTH()?

Excel’s EOMONTH() function is used to retrieve the last day of a month, and it handles leap years correctly. Most users employ it to determine maturity dates, due dates, and even for forecasting purposes. The syntax is straightforward:

=EOMONTH(startdate, months)

where startdate denotes the initial or anchor date, and months determines the number of months in the future or past. A positive value for months yields a future date, while a negative value returns a past date. By using 0 as the months argument, you can obtain the last day of the specified month. Now that you have gained some understanding of the function, let’s try a simple example that returns the last day of a given month.

Specifying the month

Using the sample dataset illustrated in Figure A, we can retrieve the last day of each month by referring to the dates and employing 0 as the months argument in the function:

=EOMONTH(C3,0)

By copying this formula to the remaining cells in the dataset, a series of last-day-of-the-month dates for the corresponding months in column C will be generated. Note that the two dates for February correctly return 2-29 and 2-28, respectively, as 2020 was a leap year while 2021 was not. Now, let’s explore a more complex example.EOMONTH 1

Advancing into the future

In the previous example, we used 0 to obtain the last day of the specified month. Now, let’s examine how to retrieve future dates by referencing the Entry ID values (their value as entry order IDs is unrelated to the current task). Figure B showcases the outcome when we enter the following formula and copy it to the remaining cells in the dataset:

=EOMONTH(C3,B3)

Each new date represents the last day of the month in column C, advanced by the number of months specified in column B. Let’s focus on the first few rows as an illustration. The initial row returns the last day of the month that is one month into the future from November 2020—12/31/2020. The second row returns the last day of the month that is two months into the future from 12/9/2020—2/28/2021. At this point, we have one more function example—obtaining dates from the past.EOMONTH 2

Revisiting the past

To retrieve dates from the past, we can utilize the Entry ID values as done previously, but this time, they need to be negative. Therefore, we need to modify the formula used earlier by adding a negative sign to the column B reference:

=EOMONTH(C3,-B3)

Then, copy this formula to the remaining dataset. As depicted in Figure C, this function returns dates from the past: 10/31/2020 is one month prior to 11/8/2020; 10/31/2020 is two months prior to 12/9/2020; 9/30/2020 is three months prior to 12/12/2020, and so forth.EOMONTH 3

What about today?

In all the previous examples, we referred to specific dates. But what if you need to work with the current date, whether in the future or the past? The solution is simple: use the TODAY() function as the start date in your expression. For example:

=EOMONTH(TODAY(), 0)

This formula returns the last day of the current month. If you want to find the last day of the month one month ahead or one month behind, you can modify the formula as follows:

=EOMONTH(TODAY(), 1)

=EOMONTH(TODAY(), -1)

Figure D illustrates these formulas and their results. You can see the last day of the current month, the last day of the next month, and the last day of the previous month.

A quick glance at the result shows that the last day of a month also happens to be the total number of days in that month. But what if you need that value as an integer, rather than a date?EOMONTH 4

How many days?

Excel doesn’t provide a built-in function to directly obtain the total number of days in a specific month. However, by combining EOMONTH() with the DAY() function, we can achieve this result. Here’s how:

=DAY(EOMONTH(TODAY(), 0))

This formula returns the number of days in the current month.

=DAY(EOMONTH(startdate, months))

This formula returns the number of days in the month that is a specified number of months ahead or behind, based on the start date.

Now that you have learned about the EOMONTH() function, keep it in mind. With some creative thinking, you may find it useful in solving other date-related problems.

Rate this post
23
269 Views
How To Hide Lock Folders On Your Computer With Free Hide FolderPrevHow To Hide Lock Folders On Your Computer With Free Hide FolderMay 25, 2023
How to utilize Excel's Find feature for highlighting or deleting matching valuesMay 26, 2023How to utilize Excel's Find feature for highlighting or deleting matching valuesNext

Leave a Reply Cancel reply

You must be logged in to post a comment.

Buy Windows 11 Professional MS Products CD Key
Buy Office 2021 Professional Plus Key Global For 5 PC
Top rated products
  • Kaspersky Internet Security 2021 1 year 5 devices key Global Kaspersky Internet Security 2021 1 year 5 devices key Global
    Rated 5.00 out of 5
    $45.00
  • Windows Server 2022 Datacenter Key Global Windows Server 2022 Datacenter Key Global
    Rated 5.00 out of 5
    $7.00
  • Kaspersky Small Office Security 10 PCs + 10 Mobiles + 1 Server 1 Year Kaspersky Small Office Security 10 PCs + 10 Mobiles + 1 Server 1 Year
    Rated 5.00 out of 5
    $164.50
  • Avast Ultimate Suite 2021 1 Year 10 Devices Global Avast Ultimate Suite 2021 1 Year 10 Devices Global
    Rated 5.00 out of 5
    $54.00
  • Windows 11 Pro Key Global Windows 11 Pro Key Global
    Rated 5.00 out of 5
    $6.00
Products
  • Windows Server 2012 Remote Desktop Services 50 USER Connections Key Global Windows Server 2012 Remote Desktop Services 50 USER Connections Key Global
    Rated 4.69 out of 5
    $25.00
  • Windows Server 2025 Remote Desktop Services 50 User Connections Windows Server 2025 Remote Desktop Services 50 User Connections $25.00
  • Windows 10 Enterprise Key Global Windows 10 Enterprise Key Global
    Rated 4.82 out of 5
    $9.00
  • Windows 10 Enterprise LTSC 2019 Key Global Windows 10 Enterprise LTSC 2019 Key Global
    Rated 4.83 out of 5
    $9.00
  • Windows Server 2019 Remote Desktop Services Device Connections (50) Cal Key Global Windows Server 2019 Remote Desktop Services Device Connections (50) Cal Key Global
    Rated 4.72 out of 5
    $20.00
  • Windows Server 2019 Essentials Key Global Windows Server 2019 Essentials Key Global
    Rated 4.71 out of 5
    $7.00
  • Windows Server 2008 R2 Standard Windows Server 2008 R2 Standard $10.00
  • 5 Key Windows 10 Pro Key Global - Combo 5 KEY 5 Key Windows 10 Pro Key Global - Combo 5 KEY
    Rated 4.81 out of 5
    $25.00
  • Microsoft SQL Server 2019 Enterprise Microsoft SQL Server 2019 Enterprise $39.00
  • Microsoft Visio 2016 professional CD Key Global Microsoft Visio 2016 professional CD Key Global
    Rated 4.94 out of 5
    $28.50
Product categories
  • Anti Virus
  • Microsoft Office
  • Microsoft Project
  • Microsoft Visio
  • Microsoft Visual
  • Microsoft Windows
  • Other Software
  • Uncategorized

Buffcom.net always brings the best digital products and services to you. Specializing in Office Software and online marketing services

BIG SALE 50% IN MAY

Microsoft Office
Microsoft Windows
Anti-Virus
Contact Us

Visit Us:

125 Division St, New York, NY 10002, USA

Mail Us:

buffcom.net@gmail.com

TERMS & CONDITIONS | PAYMENT GUIDE  | SHIPPING POLICY  | REFUND POLICY

Copyright © 2019 buffcom.net  All Rights Reserved.