Excel中计算两个日期之间假期数的公式

发布于 2024-11-29 00:48:35 字数 216 浏览 0 评论 0原文

假设我有一个指定的假期日期范围。这个范围称为“假期”。 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

ぃ双果 2024-12-06 00:48:35

假设您还有名为“date1”和“date2”的范围,这将起作用。它是包容性的,例如,如果 date1 = 1/1/11,它将计入元旦。如果您不希望删除“=”。

=SUMPRODUCT((holidays>=date1)*(holidays<=date2))

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.

=SUMPRODUCT((holidays>=date1)*(holidays<=date2))
2024-12-06 00:48:35

通过下面的公式就可以得到。
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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文