如何在 Excel 中使用 MONTH 和 EOMONTH 函数 - 公式示例

17 Mar 2025 | 6 分钟阅读

Microsoft Excel 中使用的 MONTH 函数被认为是任何人都可以轻松理解的最简单的函数之一。Excel 中的 MONTH 函数主要用于从个人选择的日期中获取月份。

除此之外,用户可以选择包含日期的单元格,也可以输入他们想要获取的月份数字。但是,借助 Month 函数,只需选择任何特定日期,它就会在 Microsoft Excel 中返回该日期的月份数字。

Microsoft Excel 中的 MONTH 公式

在 Microsoft Excel 中用于从给定日期中提取月份的公式如下

众所周知,MONTH 函数只使用一个参数,其中序列号参数是用于返回月份的日期。

Microsoft Excel 中的 DAY 公式

Microsoft Excel 中常用的 DAY 函数公式如下

参数

  • date_value/ Serial_number:这是一个有效的日期,用于有效地返回日期。

返回值

Microsoft Excel 使用 DAY 函数返回一个介于 1 到 31 之间的数字值。

Microsoft Excel 中的 YEAR 公式

Microsoft Excel 中常用的 YEAR 函数公式如下

参数

  • Date_value/Serial_number: 它主要是一个有效的日期,用于返回月份。

返回值

Microsoft Excel 中的 YEAR 函数主要用于返回一个介于 1999 到 9999 之间的数字值。

在 Microsoft Excel 中使用 Month 函数的步骤

Microsoft Excel 中使用的 MONTH 函数可以被认为是 Excel 工作表单元格中公式的重要组成部分。

让我们假设下面的示例以更好地理解。建议我们不能直接将 10/05/2018 日期输入到所选的特定单元格中;相反,我们需要输入“10/05/2018”。一旦我们输入日期,Microsoft Excel 将自动将存储在单元格中的给定日期转换为序列格式。

How to make Use of the MONTH and EOMONTH functions in Excel - formula examples

之后,我们将遇到下面的对话框,其中我们将选择我们已提及月份/日期/年份的特定单元格。

How to make Use of the MONTH and EOMONTH functions in Excel - formula examples

然后选择单元格 B2。

How to make Use of the MONTH and EOMONTH functions in Excel - formula examples

选择单元格后,我们将单击“确定”按钮以有效地获取准确的月份值。

How to make Use of the MONTH and EOMONTH functions in Excel - formula examples

上面示例的输出

How to make Use of the MONTH and EOMONTH functions in Excel - formula examples

如何在 Microsoft Excel 中使用 MONTH 函数?

在 Microsoft Excel 中,MONTH 函数被称为一个易于使用的简单函数。

现在我们将通过不同的示例了解个人如何在 Microsoft Excel 中使用 MONTH 函数

# 示例:1 在 Microsoft Excel 中提取当前今天的月份

现在,要找出今天的月份,我们可以使用以下公式


How to make Use of the MONTH and EOMONTH functions in Excel - formula examples

在特定单元格 B3 中输入公式后,它将返回今天的当前月份。

How to make Use of the MONTH and EOMONTH functions in Excel - formula examples

# 示例:2 提取相应的月值

首先,我们将在 Excel 工作表中输入日期,并在 B 列(月份)中输入公式,即


How to make Use of the MONTH and EOMONTH functions in Excel - formula examples

然后将鼠标拖动到包含日期的整个单元格,以获取所有单元格的月份数字,

How to make Use of the MONTH and EOMONTH functions in Excel - formula examples

# 示例:3

在某些情况下,我们可以看到:年份、月份和日期已经提及。因此,对于这种情况,我们没有责任使用 MONTH 函数,但如果我们想获得准确的结果,我们也可以将 Month 函数与 date 函数一起使用。

Microsoft Excel 中的日期函数

公式

年份、月份以及日期参数通常是 Excel 中的整数。

在下面的示例中,我们必须同时使用 Month 函数和 date 函数才能获得出色的结果。

公式


How to make Use of the MONTH and EOMONTH functions in Excel - formula examples

我们将得到如下输出

How to make Use of the MONTH and EOMONTH functions in Excel - formula examples

Microsoft Excel 中的 EOMONTH 是什么意思?

在 Microsoft Excel 中,Eomonth 函数主要用于从个人给定的选定日期中获取任何特定月份的结束日期。

在此,个人必须选择起始日期,从中计算月份的结束日期,然后选择个人想要有效找到结束日期的月份序列。

  • 例如,如果我们选择今天的日期作为起始日期,月份为 2,那么结束月份日期将有效地是接下来的 2 个月结束日期的最后一个日期。

Microsoft Excel 中的 EOMONTH 公式

在 Microsoft Excel 中用于从给定日期中提取 EOMONTH 的公式如下

EOMONTH 公式中涉及的参数

Microsoft Excel 中 EOMONTH 函数或公式的参数包括两个强制性参数,如下所示

  • Start_date:它主要代表“月份的起始日期”,可以是月份的任何一天。
  • Months:此相应参数定义日期开始之前或之后存在的月份总数。

如何在 Microsoft Excel 中使用 EOMONTH 函数?

在 Microsoft Excel 中,EOMONTH 函数非常简单。

现在我们将通过不同的示例了解如何在 Microsoft Excel 中使用 EOMONTH 函数

# 示例:1 查找月末

首先,我们需要输入我们想要找出月末的相应数据,如下所述

How to make Use of the MONTH and EOMONTH functions in Excel - formula examples

然后我们将应用 EOMONTH 公式以获取月末结果

How to make Use of the MONTH and EOMONTH functions in Excel - formula examples

结果

How to make Use of the MONTH and EOMONTH functions in Excel - formula examples

根据上面日期图中的第一个日期,我们已经将月份指定为 5,输出为 2016 年 10 月 31 日。从 2016 年 5 月 1 日开始,我们向前推了 5 个月。因此,该公式最终将排除所有当前月份并取接下来的五个月。

How to make Use of the MONTH and EOMONTH functions in Excel - formula examples

如果我们在查看负数,我们将其指定为 -5,结果是 2017 年 4 月 30 日,这意味着它向后推了 5 个月,并分别返回了 2017 年 4 月 30 日的值。

How to make Use of the MONTH and EOMONTH functions in Excel - formula examples

# 示例:2

我们还可以将 EOMONTH 函数与其他函数一起使用,现在让我们通过下面的示例来理解这一点。

How to make Use of the MONTH and EOMONTH functions in Excel - formula examples

从上面的数据中,我们可以说我们需要计算 2018 年 6 月 12 日之后到接下来的 3 个月末之前售出的总单位。为此,我们将仔细遵循以下步骤

  1. 首先,我们需要设置表格。
    How to make Use of the MONTH and EOMONTH functions in Excel - formula examples
  2. 在这些步骤中,我们将借助 EOMONTH 函数找出接下来的 3 个月的日期。
    How to make Use of the MONTH and EOMONTH functions in Excel - formula examples
  3. 它将生成 2018 年 9 月 30 日的输出。
    How to make Use of the MONTH and EOMONTH functions in Excel - formula examples
  4. 之后,我们将应用 SUMIFS 函数来查找 2018 年 6 月 12 日至 2018 年 9 月 30 日之间售出的总单位。这里使用的公式是

How to make Use of the MONTH and EOMONTH functions in Excel - formula examples
  1. 它将生成 15,645 的输出。
How to make Use of the MONTH and EOMONTH functions in Excel - formula examples

Microsoft Excel 中有哪些需要记住的重要事项?

在使用 MONTH 函数以及 Microsoft Excel 中的 EOMONTH 时,每个人都需要记住的重要事项如下

  1. 个人想要有效地获取月份数字的日期必须有效。
  2. 如果个人输入无效日期,它将分别返回 #VALUE! 错误。
  3. 个人可以将起始日期设置为该年度的任何月份。
  4. 个人可以为月份参数提供负值和正值。
  5. 如果个人需要与月末相同的月份,则为相应的月份参数提供 0;如果需要下个月,则传递 1 作为月份参数,依此类推。
  6. 在每种情况下,月份都必须是数值。
  7. 此外,借助 EOMONTH 函数,个人可以有效地获取月初日期。