跳到主要内容

如何在Excel中列出一个月中的所有星期一/星期五?

在某些情况下,您可能需要在工作表中列出或显示一个月或一年中的所有星期一或星期五。 通常,您可以使用“填充手柄”列出一系列日期,但是它无法帮助您填写一个月或一年中的每个星期一或星期五。 本文,我将讨论如何在Excel中列出一个月中的所有星期一或星期五。

用公式列出一个月或一年中的所有星期一/星期五

使用 Kutools for Excel 列出一个月或一年中的所有星期一/星期五


用公式列出一个月或一年中的所有星期一/星期五

以下公式可以帮助您列出从一个月的给定日期起一个月或一年中的所有星期一或星期五,请执行以下操作:

1. 请在单元格中输入要列出的每个月的每个星期一或星期五的日期,例如,我将在单元格A1中输入1/2016/1。

2. 然后输入以下公式: =IF(WEEKDAY(EOMONTH(A1,-1)+1)=2,EOMONTH(A1,-1)+1,EOMONTH(A1,-1)+(8 + MOD(2,7))-WEEKDAY(EOMONTH(A1,-1)+1)) 进入单元格B1,然后按 输入 获取每月第一个星期一的密钥。 看截图:

doc列出所有星期一1

请注意: 要获得本月的第一个星期二:

=IF(WEEKDAY(EOMONTH(A1,-1)+1)=3,EOMONTH(A1,-1)+1,EOMONTH(A1,-1)+(8 + MOD(3,7))-WEEKDAY(EOMONTH(A1,-1)+1))

要获得本月的第一个星期三:

=IF(WEEKDAY(EOMONTH(A1,-1)+1)=4,EOMONTH(A1,-1)+1,EOMONTH(A1,-1)+(8 + MOD(4,7))-WEEKDAY(EOMONTH(A1,-1)+1))

要获得本月的第一个星期四:

=IF(WEEKDAY(EOMONTH(A1,-1)+1)=5,EOMONTH(A1,-1)+1,EOMONTH(A1,-1)+(8 + MOD(5,7))-WEEKDAY(EOMONTH(A1,-1)+1))

要获得本月的第一个星期五:

=IF(WEEKDAY(EOMONTH(A1,-1)+1)=6,EOMONTH(A1,-1)+1,EOMONTH(A1,-1)+(8 + MOD(6,7))-WEEKDAY(EOMONTH(A1,-1)+1))

要获得本月的第一个星期六:

=IF(WEEKDAY(EOMONTH(A1,-1)+1)=7,EOMONTH(A1,-1)+1,EOMONTH(A1,-1)+(8 + MOD(7,7))-WEEKDAY(EOMONTH(A1,-1)+1))

要获得本月的第一个星期日:

=IF(WEEKDAY(EOMONTH(A1,-1)+1)=1,EOMONTH(A1,-1)+1,EOMONTH(A1,-1)+(8 + MOD(1,7))-WEEKDAY(EOMONTH(A1,-1)+1))

3. 显示第一个星期一后,请继续输入以下公式: = B1 + 7 要获取第二个星期一,然后向下拖动填充手柄以根据需要列出一个月或一年中的所有星期一,请参见屏幕截图:

doc列出所有星期一2


使用 Kutools for Excel 列出一个月或一年中的所有星期一/星期五

除了上述公式之外,我在这里可以介绍一个简单的工具-Kutools for Excel,其 插入日期 功能,您可以尽快插入一个月中的所有星期一或星期五。

Kutools for Excel : 带有300多个便捷的Excel加载项,可以在30天内免费试用

安装后 Kutools for Excel,请执行以下操作: 立即去下载 Kutools for Excel! )

1。 选择一个单元格以插入日期,然后单击 库工具 > 插页 > 插入日期,请参见屏幕截图:

2。 在 插入日期 对话框中,显示一个月日历,您可以双击日期以将其插入到单元格中,也可以通过选中以下日期来更改日期格式 使用格式 选项以激活日期格式列表框。 看截图:

立即去下载 Kutools for Excel 并免费试用!


演示:使用 Kutools for Excel 列出一个月或一年中的所有星期一/星期五

Kutools for Excel:具有300多个方便的Excel加载项,可以在30天内免费试用,没有任何限制。 立即下载并免费试用!

最佳办公生产力工具

🤖 Kutools 人工智能助手:基于以下内容彻底改变数据分析: 智能执行   |  生成代码  |  创建自定义公式  |  分析数据并生成图表  |  调用 Kutools 函数...
热门特色: 查找、突出显示或识别重复项   |  删除空白行   |  合并列或单元格而不丢失数据   |   不使用公式进行四舍五入 ...
超级查询: 多条件VLookup    多值VLookup  |   跨多个工作表的 VLookup   |   模糊查询 ....
高级下拉列表: 快速创建下拉列表   |  依赖下拉列表   |  多选下拉列表 ....
列管理器: 添加特定数量的列  |  移动列  |  切换隐藏列的可见性状态  |  比较范围和列 ...
特色功能: 网格焦点   |  设计图   |   大方程式酒吧    工作簿和工作表管理器   |  资源库 (自动文本)   |  日期选择器   |  合并工作表   |  加密/解密单元格    按列表发送电子邮件   |  超级筛选   |   特殊过滤器 (过滤粗体/斜体/删除线...)...
前 15 个工具集12 文本 工具 (添加文本, 删除字符,...)   |   50+ 图表 类型 (甘特图,...)   |   40+ 实用 公式 (根据生日计算年龄,...)   |   19 插入 工具 (插入二维码, 从路径插入图片,...)   |   12 转化 工具 (小写金额转大写, 货币兑换,...)   |   7 合并与拆分 工具 (高级组合行, 分裂细胞,...)   |   ... 和更多

使用 Kutools for Excel 增强您的 Excel 技能,体验前所未有的效率。 Kutools for Excel 提供了 300 多种高级功能来提高生产力并节省时间。  单击此处获取您最需要的功能...

产品描述


Office Tab 为 Office 带来选项卡式界面,让您的工作更加轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
  • 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
  • 每天将您的工作效率提高50%,并减少数百次鼠标单击!
Comments (7)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Thank you for the formula. I had a question about it. It does work for 2016, but when entering 1/12017, it identifies the first Monday of the month to be 1/9/17, when it's actually 1/2/17. Am I misunderstanding the formula's intent? Meaning, should I enter a different date to pull the 1/2/17 date? Thanks again for the help.
This comment was minimized by the moderator on the site
Did not work for me on every Monday that was in a month with the first day being a Sunday,

Given A1 is the first of the month "1/1/2020" or "1/2/2020" etc, This did work for me:


=A1+MOD(8-WEEKDAY(A1,2),7)
This comment was minimized by the moderator on the site
It worked for me.. fo rFridays A1= 06/01/2017 B1= 13/01/2017= IF(WEEKDAY(EOMONTH(A1,-1)+1)=6,EOMONTH(A1,-1)+1,EOMONTH(A1,-1)+(8 + MOD(6,7))-WEEKDAY(EOMONTH(A1,-1)+1)) 20/01/2017 = IF(WEEKDAY(EOMONTH(B1,-1)+1)=6,EOMONTH(B1,-1)+1,EOMONTH(B1,-1)+(8 + MOD(6,7))-WEEKDAY(EOMONTH(B1,-1)+1))+7 27/01/2017=IF(WEEKDAY(EOMONTH(C1,-1)+1)=6,EOMONTH(C1,-1)+1,EOMONTH(C1,-1)+(8 + MOD(6,7))-WEEKDAY(EOMONTH(C1,-1)+1))+
This comment was minimized by the moderator on the site
That doesn't help... super weird..2017 is the only year that it skips the 1st monday.
This comment was minimized by the moderator on the site
The formula doesn't work for Mondays if the last day of the previous month is a Saturday (weekday no 7). The following day is therefore a Sunday (weekday no 1) and you only need add 1 day to get to a Monday. However, the formula adds 10-1=9 days and gives you the 9th January as the first Monday. There needs to be a second IF function:
=IF(WEEKDAY(EOMONTH(A2,-1)+1)=1,EOMONTH(A2,-1)+2,IF(WEEKDAY(EOMONTH(A2,-1)+1)=2,EOMONTH(A2,-1)+1,EOMONTH(A2,-1)+(8+MOD(2,7))-WEEKDAY(EOMONTH(A2,-1)+1)))
This comment was minimized by the moderator on the site
The formula doesn't work if the last day of the previous month is a Saturday (weekday no 7). The following day is therefore a Sunday (weekday no 1) and you only need add 1 day to get to a Monday. However, the formula adds 10-1=9 days and gives you the 9th January as the first Monday. There needs to be a second IF function:=IF(WEEKDAY(EOMONTH(A2,-1)+1)=1,EOMONTH(A2,-1)+2,IF(WEEKDAY(EOMONTH(A2,-1)+1)=2,EOMONTH(A2,-1)+1,EOMONTH(A2,-1)+(8+MOD(2,7))-WEEKDAY(EOMONTH(A2,-1)+1)))
This comment was minimized by the moderator on the site
2019 too :( first wednesday is not 09 Jan?)
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations