简体   繁体   English

Excel显示当月的第n天

[英]Excel display nth day of current month

I have a list of recurring bills. 我有一份经常性账单清单。 Some are on the 1st of every month, and some are on the 15th or 16th etc. What I want to be able to do is display this day within the current month. 有些是在每个月的1号,有些是在15日或16日等。我希望能够做的是在当月内显示这一天。 So if it is February, and the bill recurs on the 9th every month, my cell will show 02/09/12, and if it was march, it would show 03/09/12. 因此,如果它是2月,并且该法案每月9日重复,我的单元格将显示02/09/12,如果是3月,它将显示03/09/12。 Is there a formula or macro to accomplish this? 是否有公式或宏来实现这一目标?

发现它是:= DATE(YEAR(TODAY()),MONTH(TODAY()),18)

如果A1中的数字为9,则此公式将显示当月的第9个月(无论是将来还是过去)

=TODAY()-DAY(TODAY())+A1

edate(start-date),1) EDATE(开始日期),1)

ie edate(B3,1) 即edate(B3,1)

b3= 1/5/13 b3 = 1/5/13

Result = 5th of 1 month later - 2/5/13 结果= 1个月后的第5天 - 2013年2月5日

3 for quarterly, 12 for annual 每季度3个,每年12个

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

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