跳到主要内容

如何确定日期是否介于两个日期之间或在Excel中的周末?

有时您可能需要确定或检查日期是否在Excel中的两个日期之间或周末之间。 本文将向您展示以下棘手的方法,以检查日期是否介于Excel中的两个日期或周末之间。

使用公式确定日期是否介于两个日期之间
使用出色的工具轻松确定日期是否介于两个日期之间  
使用公式和VBA代码确定日期是否在周末
使用出色的工具确定日期是否在周末

有关日期的更多教程...


确定日期是否在Excel中的两个日期之间

假设您需要确定A列中的日期是否介于7/1/2008和12/31/2009之间。 请执行以下操作:

1.在空白单元格中,说出单元格B2,将以下公式复制并粘贴到其中,然后按 输入 键。

=IF(AND(A2>$B$1,A2<$c$1),A2, FALSE)

备注:此公式将检查日期是否在7/1/2008到12/31/2009之间。 如果日期在此期间,它将返回日期; 如果日期不在此期间,它将返回 FALSE.

2.继续选择结果单元格,向下拖动“填充手柄”以获取所有结果。 看截图:

现在,您可以确定日期是否在指定的日期范围内。


使用 Kutools for Excel 确定日期是否介于 Excel 中的两个日期之间

在这里为您推荐一个了不起的工具- 选择特定的单元格 实用程序 Kutools for Excel。 此工具不仅可以帮助您找出介于两个给定日期之间的所有日期,还可以立即选择所有合格的日期单元格。
在应用它之前,您需要 首先下载并安装.

1.选择要确定其日期是否介于两个日期之间的日期范围,然后单击 库工具 > 选择 > 选择特定的单元格。 看截图:

2.在 选择特定的单元格 对话框中,选择 手机 在选项 选择类型 部分,然后指定 比...更棒小于 日期,最后单击 OK 按钮。

您可以看到两个日期之间的日期单元格被立即选择。 看截图:

  如果您想免费试用(30天)此实用程序, 请点击下载,然后按照上述步骤进行操作。


使用公式和VBA代码确定日期是否在周末

您可以按照以下步骤确定列A中的日期是否为周末:

方法A:使用公式检查日期是否在周末。

1.在空白单元格中,将以下公式复制并粘贴到其中,然后按 输入 键。

=IF(OR(WEEKDAY(A2)=1,WEEKDAY(A2)=7),A2,FALSE)

此公式将确定日期是否在周末。 如果日期在周末,它将返回日期; 如果日期不是在周末,它将返回文本 FALSE.

2.继续选择结果单元格,然后向下拖动“填充手柄”以获取所有结果。

方法B:使用用户定义的功能检查日期是否在周末。

1。 按 ALT + F11 键一起打开Microsoft Visual Basic for Applications窗口。

2.在“ Microsoft Visual Basic for Applications”窗口中,单击“ 插页 >> 模块,然后将以下宏粘贴到“模块窗口”中。

Public Function IsWeekend(InputDate As Date) As Boolean
Select Case Weekday(InputDate)
Case vbSaturday, vbSunday
IsWeekend = True
Case Else
IsWeekend = False
End Select
End Function

3.同时按Alt + Q键以关闭“ Microsoft Visual Basic应用程序”窗口。

4.在空白单元格中,将公式输入到公式栏中,然后按 输入 键。

=IsWeekend(A2)

如果返回的文本 ,单元格A2中的日期为周末; 如果它返回的文本 ,单元格A2中的日期不会在周末。


使用出色的工具确定约会是否在周末进行

实际上,您可以将所有日期转换为工作日名称,然后根据星期六或星期日检查周末。 在这里 套用日期格式 实用程序 Kutools for Excel 可以帮助您轻松解决问题。
在应用它之前,您需要 首先下载并安装.

1.选择日期范围,然后单击 库工具 > 格式 > 套用日期格式。 看截图:

2.在 套用日期格式 对话框中选择 周三 ,在 日期格式 框,然后单击 OK 按钮。

现在,所选日期将立即转换为工作日。 您可以直接根据日期的内容确定日期是否在周末。 看截图:

:

  • 转换后的结果直接在原始数据中起作用;
  • 该实用程序支持 解开按Ctrl + Z“。

  如果您想免费试用(30天)此实用程序, 请点击下载,然后按照上述步骤进行操作。


相关文章:

在Excel中将日期转换为工作日,月份,年份名称或数字
假设您在一个单元格中输入日期,日期显示为12/13/2015。 是否可以仅显示月份或工作日,或者月份名称或工作日名称的文本(例如XNUMX月或星期日)? 本文中的方法可以帮助您轻松转换或格式化任何日期,以仅在Excel中显示工作日名称或月份名称。

在Excel中快速将生日转换为年龄
例如,您在Excel中获得了各种生日数据,并且需要转换这些生日以在Excel中显示其确切的年龄值,您想如何计算? 本文列出了一些技巧,可以在Excel中轻松地将出生日期转换为年龄。

如果日期大于Excel中的另一个日期,则比较日期
假设您有一个日期列表,并且想将这些日期与指定日期进行比较,以便找出比列表中指定日期大的日期,您将怎么办? 在本文中,我们将向您展示比较日期的方法(如果大于Excel中的另一个日期)。

Excel中两个日期范围之间的总和值
当工作表中有两个列表时,一个是日期列表,另一个是值列表。 并且您只想对两个日期范围之间的值求和,例如,对3/4/2014和5/10/2014之间的值求和,如何快速计算它们? 本文中的方法将帮您一个忙。

在Excel中添加日期,包括或不包括周末和节假日
本文讨论的是在给定日期中添加几天(不包括周末和节假日),这意味着只能在Excel中添加工作日(从星期一到星期五)。

有关日期的更多教程...


使用 Kutools for Excel 确定日期是否介于两个日期或周末之间

Kutools for Excel 包括300多个便捷的Excel工具。 60天免费试用,不受限制。 立即下载免费试用版!

最佳办公生产力工具

🤖 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 (13)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
I have 4 variables: 1st: Date of onset, 2nd: Date of termination, 3rd: Date of measurement, 4th: measurement. I want to calculate the average of the 4th variable between each period of onset-termination. How can i do it? I think its a bit tricky. Each date of onset has an counterpart date of termination. The same applies for the 3rd and 4th variable.
This comment was minimized by the moderator on the site
I have two tables. The first table has a date and an ID and the other table has a range dates, the same ID and, and one code. In two tables repeat the ID because each has different information. I need get in the table number one the code according with the ID and range dates in the second table. But i don't know how???
This comment was minimized by the moderator on the site
I want to find all projects that fall within today's date +30 days (Within a month) and have the Project Number displayed when in the range, if not in range keep blank
This comment was minimized by the moderator on the site
i want to monitor the dates and set the the alert in my excel , example i want to set in my excel to find the difference days between the request date and deadline to order date and automatically compare this difference with the policy date if the difference is greater than policy date , excel consider not done with an alert color , and if the difference is less than the policy days , excel consider the done with alert color. thank you
This comment was minimized by the moderator on the site
Hello to all, I have a requirement in excel i.e. i want to generate dates if design actual date is delay for 2 days then for costing department date is increase by delay date. design target actual complete costing target marketing target 05-04-2016 07-04-2016 09-04-2016 10-04-2016 in above design target date is 05/04/2016 but design task completed on 07-04-2016 so costing target date will be automatically calculated as per delay days.
This comment was minimized by the moderator on the site
I am recording the SLA duration between dates 40 day SLA starting on day XXXX I am looking for a formula to show if client holds for x number of days that comes off the SLA too ie 01 june 2016 + 40 days = 11 July 2016 but project finishes 15 July shows as 4 days overdue However 01 June 2016 Start 15 July 2016 End date of project client Held 7 Day 3 days before SLA Any help?
This comment was minimized by the moderator on the site
I want to show a certain date in a cell from a date range which is between two dates. eg: 01-05-2016 to 05-05-2016 may shown as in other cell as 01-05-2016 . pls help me..
This comment was minimized by the moderator on the site
My question falls along these lines. I have two date ranges A through B, and X through Y. I need to conditionally format a cell if any dates in range A-B fall within range X-Y.
This comment was minimized by the moderator on the site
Using IF Function i need the following formula. Any one can assist On A2 cell I will provide a date. On B2 it should indicate 2 Days after A2. If the second day falls on Monday to Friday it should indicate the actual date. If the second day falls on Saturday or sunday it should indicate on Monday automatically On the same way I need third day,fourth day and fifth day using Macros. Also advice to how to create macros in Excel.
This comment was minimized by the moderator on the site
I want to know how many times a date or how many dates from a list are present in a range of dates. For example Date Range is 1-1-2014 31-1-2014. The date list is 05-01-2014 11-01-2014 19-01-2014 08-02-2014 want to know the excel formula for count how many times the above list of dates present in the above range of dates.
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations