Identifying if a time falls between 2 specified times

Sailingdemon

New Member
Joined
Nov 13, 2017
Messages
2
I have a column (call it A) with different times entered into it, it is formatted as HH:MM and can be anytime of the day.

I am trying to identify a formula that will place a yes in the corresponding cell in column B if the time falls between the hours of 01:00 and 07:00.

I have tried all sorts of formulas that work well for numbers but not so well for times (only), and ideas please?
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Welcome to the board.

Try

=IF(AND(A2>=TIME(1,0,0),A2<=TIME(7,0,0)),"Yes","No")

If A2 is actually a DATE+TIME, then we need to extract only the time.
=IF(AND(MOD(A2,1)>=TIME(1,0,0),MOD(A2,1)<=TIME(7,0,0)),"Yes","No")
 
Last edited:
Upvote 0
Perfect Jonmo1, works a treat! been given a little project by my boss I've managed most of it from very little knowledge (very basic Excel use previously!) I was just having issues with this last bit when working with time!
Thanks again and superquick response as well.
:) Simon
 
Upvote 0

Forum statistics

Threads
1,224,825
Messages
6,181,189
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top