在 Excel 中获取当前月份右侧的单元格
我对 Excel 很陌生,这个问题可能很简单,但我不知道该怎么做:-(。 这就是我所拥有的:
Date Numbers
01.09.11 10
01.10.11 20
01.11.11 30
01.12.11 40
现在我想要的是在另一个单元格中:获取日期的编号,其中日期的月份是当前月份。我该怎么做?
I'm pretty new to Excel, that question is probably easy, but I dont know what to do :-(.
So this is what I have:
Date Numbers
01.09.11 10
01.10.11 20
01.11.11 30
01.12.11 40
Now what I want is in another cell: Get the number of the date, where the date's month is the current month. How do I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设所有日期都是“dd.mm.yy”形式的字符串,您可以使用以下数组公式:
其中 9 是您要查找的月份数字。按 Ctrl+Shift+Enter 将其输入为数组公式。
编辑:
正如评论中所指出的,您想要匹配当前月份,因此合并@JMax的建议是有效的:
为了消除任何混淆,
MID()
返回一个字符串,它本身不会返回与MONTH(TODAY())
返回的数值匹配的值。但是,如果将MID()
函数粘贴到VALUE()
函数中,则MID()
返回的字符串将转换为数值。例如,“09”变为数字 9,“10”变为数字 10。这使您可以匹配MONTH(TODAY())
返回的数字值。但是,如果您的日期在工作表中以 dd.mm.yy 格式输入为日期,而不是字符串,那么您可以使用相同的策略,但使用不同的匹配术语:
将其输入为数组公式。
Assuming all your dates are strings of the form "dd.mm.yy", you can use the following array formula:
where the 9 is the month number you want to look up. Enter this as an array formula by pressing Ctrl+Shift+Enter.
EDIT:
As pointed out in the comments, you want to match the current month, so incorporating @JMax's suggestion works:
To clear up any confusion,
MID()
returns a string, which by itself will not return a match for the number value returned byMONTH(TODAY())
. However, if you stick theMID()
function inside aVALUE()
function, the string returned byMID()
will be converted into a number value. E.g., "09" becomes the number 9, "10" becomes the number 10. This allows you to match the number value returned byMONTH(TODAY())
.However, if your dates are entered as dates with format dd.mm.yy in your sheet instead of as strings, then you can use the same strategy but with a different matching term:
Enter this as an array formula.