Excel中计算两个日期之间假期数的公式
假设我有一个指定的假期日期范围。这个范围称为“假期”。 Excel 中有一个公式可以用来计算两个日期之间的假期数吗?
例如假期 = 7/3/2011,日期 1 = 7/1/2011,日期 2 = 7/7/2011:此公式计算 1。
编辑:看来函数 =NETWORKDAYS
得到了我的部分但正如 Excelll 指出的那样,只有当假期恰好在工作日时,它才有效。
Lets say I have a named range of dates that are holidays. This range is called 'holidays'. Is there a formula in Excel I could use to count the number of holidays that fall between 2 dates?
e.g. holidays = 7/3/2011, date 1 = 7/1/2011, date 2 = 7/7/2011: this formula calculates 1.
Edit: it seems the function =NETWORKDAYS
gets me part of the way there, but as Excellll points out it only works if the holidays fall on weekdays.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设您还有名为“date1”和“date2”的范围,这将起作用。它是包容性的,例如,如果 date1 = 1/1/11,它将计入元旦。如果您不希望删除“=”。
Assuming you also have ranges named "date1" and "date2" this will work. It's inclusive, e.g., it will count New Years Day if date1 = 1/1/11. Remove the "="s if you don't want that.
通过下面的公式就可以得到。
NETWORKDAYS.INTL(开始日期、结束日期、[周末]、[节假日])
使用“0000000”(包括分号)来定义周末为“无”,然后如果需要,可以通过将所需的周末日期指定为假期来定义不在选项中的任何特殊周末。
With the following formula you can get it.
NETWORKDAYS.INTL(start_date, end_date, [weekend], [holidays])
Use "0000000" including semicolons, to define weekend is none, then if desired any special weekend not on the options can be defined by specifying the desired weekend days as holidays.