提示:其他語言是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。 支持所有語言。 在您的企業或組織中輕鬆部署。 全功能30天免費試用。
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 · 18 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 · 17 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 · 7 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 · 5 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.