简体   繁体   English

仅返回日期中的月份(作为日期,而不是月份号)-Excel

[英]Return just the month from a date (as a date, not the month number) - Excel

Is there a way to return/extract just the month from a date in Excel? 有没有一种方法可以从Excel中的日期中仅返回/提取月份? (Not the number of the month, but the actual integer value?) (不是月份数,而是实际整数值?)

Putting this here because I finally figured this out. 放在这里,因为我终于弄清楚了。 Thanks to Barry Houdini (as usual)- almost every solution online is for returning only the month as the month's number (=MONTH(yourdate)) or extracting just the month as text. 多亏了Barry Houdini(像往常一样)-几乎每个在线解决方案都只返回月份作为月份的数字(= MONTH(yourdate))或仅提取月份作为文本。

This pulled it: 这拉动了它:

(In my scenario, I only wanted the month integer value for today's date, which is not 3, but 41699) (在我的情况下,我只想要今天的日期的月份整数值,它不是3,而是41699)

=INT(TODAY())-DAY(TODAY())+1 = INT(TODAY())-DAY(TODAY())+ 1

甚至更简单: =EOMONTH(TODAY(),-1)+1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM