Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to check if time is between two times in Excel?

In Excel, how could you check if a specific time is between two given times? To check them one by one will waste lots of time, here, I will introduce some simple formulas to solve this job.

Check if a specific time is between two given times with formulas


arrow blue right bubble Check if a specific time is between two given times with formulas


For example, I have two columns of times which are start time and end time in column A and column B separately, now I want to check if the time in column C is between the time range in column A and column B as below screenshot shown:

doc check if time between times 1

The following formulas may help you to identify if the specific time is between two times, please do as this:

Enter any one of the following formulas into a blank cell beside your data where you want to output the result:

=IF(C2=MEDIAN(A2,B2,C2),"Yes","No")

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

And then drag the fill handle down to the cells which you want to apply this formula, and the time if between the given two times has been identified, if it is between two times, a Yes will be displayed, if is not between the two times, a No will be displayed, see screenshot:

doc check if time between times 2

Note: In the above formulas, C2 is the specific time you want to check, and A2 and B2 are the cells contain the two times that you want to check based on.


Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
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.
    Santosh Kalyandurg · 1 months ago
    Hello I have to find my specific time is in between two times...eg : Start time(AS2) is 23:00:00 and End time(AT2) is 8:00:00, specific time(J2) is 0:02:20, so when i use the formula =IF(AND(J2>=MIN(AS2:AT2),J2<=MAX(AS2:AT2)),"YES","NO") it should show yes as its in between tow times only but its showing no, any help in correcting the formula ?
    • To post as a guest, your comment is unpublished.
      skyyang · 28 days ago
      If your time over midnight, you should apply the below formula:
      =OR(MOD(C1,1)>TIME(23,0,0),MOD(C1,1)<TIME(8,0,0))
      • To post as a guest, your comment is unpublished.
        skyyang · 28 days ago
        In the above formula, C1 is the specific time you want to check for, and the TIME(23,0,0) and TIME(8,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.
    Santosh · 1 months ago
    I have two times here 23:00:00(AS2 Start Time) and 8:00:00(AT2 End Time) and specific time is 0:02:20(J2), so when i use this formula =IF(AND(J2>=MIN(AS2:AT2),J2<=MAX(AS2:AT2)),"YES","NO"), it should come as yes as the specific time is in between our two start and end time but its showing no..any help in correcting this formula
  • To post as a guest, your comment is unpublished.
    Nikkii · 2 months 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 · 2 months 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 · 8 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 · 7 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 · 6 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.