简体   繁体   English

如何在给定任何日期并假设星期一为 Excel 中的第一天的情况下找到一周中第一天的日期

[英]How do I find the date of the first day of week given any date and assuming Monday as day 1 in Excel

What I need is a formula which provides me with the date of the start of a week (Monday is day 1) for any date i chose.我需要的是一个公式,它为我选择的任何日期提供一周开始的日期(星期一是第 1 天)。 for example 20/10/2019 (Sunday) should yield 14/10/2019 as the start of the week.例如 20/10/2019(星期日)应该产生 14/10/2019 作为一周的开始。 Previous similar posts don't prove to solve my problem because i have a date and not the week number (i tried this).以前的类似帖子并不能解决我的问题,因为我有一个日期而不是周数(我试过这个)。 How do I convert a calendar week into a date in Excel? 如何在 Excel 中将日历周转换为日期?

I used the date to get the week number in order to make the posted solutions work.我使用日期来获取周数,以使发布的解决方案有效。 Unfortunately excel's WEEKNUM formula automatically assumes Sunday as the first day of the week and so each Sunday's week number is counted as the following week.不幸的是,excel 的 WEEKNUM 公式自动假定星期日为一周的第一天,因此每个星期日的周数都被计为下一周。

WEEKNUM counts Sunday as following week WEEKNUM 将星期日计算为下一周

For 20/10/2019 the start of the week needs to be 14/10/2019对于 20/10/2019,一周的开始时间必须是 14/10/2019

Try尝试

=GivenDate-WEEKDAY(GivenDate,2)+1

replace GivenDate with a valid date or the cell reference of a valid date, such as 20/10/2019 which shall return 14/10/2019 .GivenDate替换为有效日期或有效日期的单元格引用,例如20/10/2019应返回14/10/2019

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

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