简体   繁体   English

每月在 Excel 中的预订夜数

[英]Booked nights, per month in Excel

I have the data set (below a sample).我有数据集(在样本下方)。 Trying to get the number of nights, in each month试图获得每个月的夜数

在此处输入图像描述

I'm assuming that as the day of arrival goes with the first night, if someone arrived on 30th April and left on 1st May, that would count one night in April and zero nights in May.我假设随着第一晚的到来,如果有人在 4 月 30 日到达并在 5 月 1 日离开,那将在 4 月计算一晚,在 5 月计算零晚。 Using a slightly modified overlap formula :使用稍微修改的重叠公式

=IF(MIN(EDATE(C$1,1),$B2)<=MAX(C$1,$A2),"",MIN(EDATE(C$1,1),$B2)-MAX(C$1,$A2))

在此处输入图像描述

assuming that a formula solution is OK.假设公式解决方案是可以的。

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

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