function and usage of eomonth function

Source: Internet
Author: User

First, Eomonth function syntax

EOMONTH (start_date,months)

Function: Returns the series number of the last day of the specified month before or after Start-date.

The implication is that, given a time start_date, and then, given a month months, you can calculate the start_date this time before the month or the last day of the month.

Parameter introduction:

Start_date is a date that represents the start date. Dates can be entered in several ways: quoted text strings (for example, "1998/01/30"), number of series (for example, if you use the 1900 date system, 35825 means January 30, 1998) or the results of other formulas or functions (for example, DATEVALUE ("1998/1/30")) 。

Month is the number of months before or after start_date. A positive number indicates a future date, and a negative number represents the past date.

We can also understand the EOMONTH function as follows: EOMONTH (given date, forward or backward month number)

Examples of the use of Eomonth functions

Like the formula:

①=eomonth ("2011-8-1",-2), returned the result is: June 30, 2011

Why did you get the result? Because the given reference date is 2011-8-1, the last day of the two months before this date, that is, the two months preceding the 2, then it should be June 30, 2011.

②=eomonth ("2011-9-10", 1), let's analyze it, what is the result of the return?

First of all, we know that the reference date is 2011-9-10, and 1 is a positive number, representing the one months before the date, of course, October.

Therefore, the function returns the last day of the one months preceding 2011-9-10, that is, October 31, 2011.

Let's look at one more example:

=eomonth ("2012-1-1",-5), the reference date is 2012-1-1,-5 represents the last day of the one months of the five months preceding the reference date, so it should be August 31, 2011.

Iii. considerations for the use of function eomonth

① about cell settings

Because the function returns data of the date type, you need to format the cells you use to date type. Otherwise, you will not see the correct result.

② about why a function cannot be used

When you use the Eomonth function, you may not be able to use it correctly, or you will not get the correct result, because the function is not a common function, you must use the following methods to solve.

The Add-ins command on the Tools menu starts.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.