提示:其它语言是由 Google 机器翻译的。 你可以访问 English 版本。
登录
x
or
x
x
马上登记
x

or

如何检查时间是否在Excel中两次?

在Excel中,如何检查特定时间是否在两个给定时间之间? 要逐一检查他们会浪费很多时间,在这里,我将介绍一些简单的公式来解决这个工作。

检查两次给定时间与公式之间的具体时间


箭头蓝色右泡 检查两次给定时间与公式之间的具体时间


例如,我有两列分别是A列和B列的开始时间和结束时间,现在我要检查列C中的时间是否在A列和B列的时间范围之间,如下面的截图所示:

doc检查时间1之间的时间

以下公式可能会帮助您确定具体时间是否在两次之间,请按照以下步骤操作:

在要输出结果的数据旁边的空白单元格中输入以下任一公式:

= IF(C2 = MEDIAN(A2,B2,C2), “是”, “否”)

=IF(AND(C2>=MIN(A2:B2),C2<=MAX(A2:B2)),"YES","NO")

然后将填充手柄向下拖动到要应用此公式的单元格,并且在给定两次之间的时间已被识别,如果在两次之间,则会显示一个是,如果不在两者之间次,否则会显示,请参见截图:

doc检查时间2之间的时间

请注意: 在上面的公式中, C2 是你想要检查的具体时间,以及 A2 B2 这些单元格是否包含您希望基于的两次检查。


Kutools for Excel - 最佳办公生产力工具提高80%的生产力

  • 重用: 快速插入 复杂的公式,图表 以及你以前用过的任何东西; 加密单元格 密码; 创建邮件列表 并发送电子邮件...
  • 超级方程式酒吧 (轻松编辑多行文字和公式); 阅读布局 (轻松读取和编辑大量单元格); 粘贴到过滤范围...
  • 合并单元格/行/列 不丢失数据; 分裂细胞含量; 组合重复的行/列...防止重复的细胞; 比较范围...
  • 选择复制或唯一 行; 选择空行 (所有细胞都是空的); 超级查找和模糊查找 在许多工作簿中; 随机选择......
  • 精确复制 多个单元格而不更改公式参考; 自动创建参考 多张表; 插入项目符号,复选框等等......
  • 提取文本,添加文本,按位置删除, 删除空间; 创建和打印分页小计; 在单元格内容和注释之间转换...
  • 超级过滤器 (将过滤方案保存并应用到其他工作表); 高级排序 按月/周/日,频率等; 特殊过滤器 用粗体,斜体......
  • 结合工作簿和工作表; 根据键列合并表; 将数据拆分为多个表格; 批量转换xls,xlsx和PDF...
  • 超过300强大的功能。 支持Office / Excel 2007-2019和365。 支持所有语言。 在您的企业或组织中轻松部署。 全功能60天免费试用。
kte tab 201905

Office选项卡为Office提供选项卡式界面,使您的工作更轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,Publisher,Access,Visio和Project。
  • 在同一窗口的新选项卡中打开并创建多个文档,而不是在新窗口中。
  • 通过50%提高您的工作效率,每天为您减少数百次鼠标点击!
官方底部
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Nikkii · 10 days ago
    This isn't working for me when the specific time is =NOW() to display the current time. Any suggestions?
    • To post as a guest, your comment is unpublished.
      skyyang · 9 days ago
      Hello, Nikkii,

      If you enter =now() function to get the current date and time, both date and time are displayed, if you need a formula to get the current time dynamically, you can apply this formula: =MOD(NOW(),1), and then format it as time format. And then, you can use the formula in this article successfully.

      Please try, hope it can help you!
  • To post as a guest, your comment is unpublished.
    chris · 6 months ago
    This doesn't work if you are checking between time values that go after midnight. For example, the formula will return a false if you are checking if 1AM is between 10 PM to 3 AM.
    • To post as a guest, your comment is unpublished.
      skyyang · 6 months ago
      Hi, chris,
      If your time over midnight, you should apply the below formula:
      =OR(MOD(C1,1)>TIME(22,0,0),MOD(C1,1)<TIME(3,0,0))

      In the above formula, C1 is the specific time you want to check for, and the TIME(22,0,0) and TIME(3,0,0) are the two times you want to check between. You should change the references to your need.
      Please try it, hope it can help you!
      • To post as a guest, your comment is unpublished.
        Laura · 4 months ago
        I have 3 times (arrival, process and departure) which may span midnight, that I want to calculate the difference between. I am getting an error when I try to calculate the time between process and departure where the process is before midnight and the departure is after. For example my arrival time is 21:00, my process time is 23:00 and my departure time is 03:00 the difference should be 4 hours but I'm getting an error. I am using the following formula as I want to highlight where the process time is after the departure time =IF(ISBLANK(G3),"N/A",IF(E3=G3,"PROCESS TIME EQUALS DEPARTURE TIME",IF(E3>G3,E3-G3,IF(E3<G3,"PROCESS TIME AFTER DEPARTURE TIME")))) where E3 is my departure time and G3 is my process time. Any guidance gratefully received.