Google表格:如果周数在日期范围内

时间:2016-01-26 17:13:51

标签: google-sheets spreadsheet

我需要一个IF语句来搞清楚:

=If(WEEKNUMBER is between STARTDATE and ENDDATE;1;0)

为了测试,我们可以说:

A1 = Startdate

B1 = Enddate

C1 =周数

D1 = IF-statement

1 个答案:

答案 0 :(得分:1)

D1使用WEEKNUM()函数:

=if(and(weeknum(A1) <= C1; C1 <= weeknum(B1))=true; 1; 0)

例如:

__|     A    |     B     |     C     |      D     |
1 | 1/1/2016 | 1/16/2016 |     2     |      1     |
2 | 1/1/2016 | 1/16/2016 |     4     |      0     |