简体   繁体   English

在Excel中将Week NUM转换为Week Beg日期

[英]Convert Week NUM to the Week Beg date in Excel

I have the below formula to give me the week ending of a week num, how can I get the date of the week beginning from this? 我有以下公式给我一个星期数的结束日期,如何从这个开始算起星期几?

=DATE(YEAR(TODAY()),1,1)+(7-WEEKDAY(DATE(YEAR(TODAY()),1,1))-6)+(A2*7)

when A2 is 10 for example and B2 is the date. 例如,当A2为10且B2为日期时。

thanks 谢谢

Are your weeks ISO weeks? 您的星期是ISO周吗? If so then that formula might work for this year but it will be wrong in 2016 because it will give the end date of week 1 as 3rd Jan when it should be 10th Jan 如果是这样,那么该公式可能会在今年生效,但在2016将是错误的,因为它将3rd Jan周的结束日期定为1 3rd Jan ,而该日期应为10th Jan

I would use this formula for start date (a Monday) 我将使用此公式作为开始日期(星期一)

=DATE(YEAR(TODAY()),1,A2*7-2)-WEEKDAY(DATE(YEAR(TODAY()),1,3))

then just add 6 for the end date 然后只需将6作为结束日期

=DATE(YEAR(TODAY()),1,A2*7+4)-WEEKDAY(DATE(YEAR(TODAY()),1,3))

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

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