简体   繁体   English

通过excel公式计算月份的周数

[英]Calculate week numbers for months through excel formula

My week starts from Saturday to Friday and I need to count no of Weeks.我的一周从星期六开始到星期五,我需要计算周数。 Eg Week starting from 27th Oct 2018 to 2nd Nov 2018 should be counted as first week of month November but formula is calculating it as Week 5 of October month.例如,从27th Oct 201827th Oct 2018 2nd Nov 2018周应算作2nd Nov 2018第一周,但公式将其计算为 10 月的第 5 周。 Below is the formula I have been using.下面是我一直在使用的公式。

=IF(K89="No Date","No Week",CONCAT("Week ",WEEKNUM(I89-1)-WEEKNUM(I89-DAY(I89)-6)))

where K89 is a date column.其中K89是日期列。

Any suggestions, please.任何建议,请。

As found elsewhere:如其他地方所见:

=INT((A2-LOOKUP(A2,DATE(YEAR(A2)-{2,1,0},2,27)-WEEKDAY(DATE(YEAR(A2)-{2,1,0},2,27-7))+7))/7)+1

You'll need to change the your desired start date (2,27 for february 27 in this example)您需要更改所需的开始日期(在本例中为 2 月 27 日为 2,27)

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

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