简体   繁体   English

Excel:如何查找每月的第N天

[英]Excel: How to find Nth day of month

I'd like to add a column that tells me the Nth day in the month. 我想添加一栏来告诉我该月的第N天。

For example, December 11, 2018 is the 2nd Tuesday in December. 例如,2018年12月11日是12月的第二个星期二。

I'm able to find the Day Number in the month, but not able to add a column for "2nd Tuesday" and so on. 我可以找到当月的天数,但是无法为“第二个星期二”添加一列,依此类推。

屏幕截图

For any date, 对于任何日期,

=LOOKUP(DAY(B2), {1,8,15,22,29}, {"1st","2nd","3rd","4h","5th"})&TEXT(B2, " dddd")

在此处输入图片说明

在此处输入图片说明

Columns C: C栏:

=INT((DAY(B2)-1)/7)+1

Column D: D栏:

=TEXT(WEEKDAY(B2,1),"dddd")

Column E: E栏:

=IF(C2=1,"1st",IF(C2=2,"2nd",IF(C2=3,"3rd",C2&"th")))& " "&D2

Mind you, this is quite convoluted, would work much better as a custom function. 请注意,这很复杂,作为自定义函数会更好。

I think what you are looking for is on the link below. 我认为您要寻找的是下面的链接。 https://exceljet.net/formula/get-nth-day-of-week-in-month https://exceljet.net/formula/get-nth-day-of-week-in-month

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

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