determining if a time falls between a specific time not listed on the excel document

dyrmnoa

New Member
Joined
Apr 14, 2014
Messages
2
I need help determining if time in Column B2 falls between "After Hours" (not list on the excel document).

I have a document with times listed in column B. I am attempted to input a formula in Column N that will automatically say "Yes" or "No" if the times in Column B fall between after hours. I already have a formula that will input True or False if the time falls between a time already listed on the Excel document. But I need to input a formula for times not already on the excel document.

e.g. If Column B2 = 1700 Column N should say "yes" for after hours. If Column B3 = 1500 Column N should say "No" does not fall after hours.

After hours include any times that fall between 1700-0700 and Holidays. Please help me out, thank you in advance.
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Try this:

=IF(OR(HOUR(B2)>=17,HOUR(B2)<=7),"Yes","No")

Holidays are a whole other thing. You might need a separate =IF(...) statement to take care of those, but you'd actually have to list out the holidays in order to exclude them.
 
Upvote 0
Thanks for the help. Now that I have enter in the formula I am getting the same answer for every entry, despite looking at some and knowing they would fall after hours. It worked when I first enter the formula but since saving, closing and reopening the file, the data all say "YES" when some should be saying "NO"

this is what I have entered =IF(OR(HOUR(B950)<=17,HOUR(B950)>=7),"YES","NO")

In Column N the returned response should say "YES" for this example and it does. The time value enter is 5:46 pm

But for the next one I entered the same formula =IF(OR(HOUR(B951)<=17,HOUR(B951)>=7),"YES","NO")

In Column N the returned response should say "NO" for this example and it doesn't, it says "YES". The time value enter is 1:54 pm

This go on throughout my entire document so if you could please adivise me what to do I would appreciate it, thank you.
 
Upvote 0
You flipped around the < and >.

I typed this:
=IF(OR(HOUR(B2)>=17,HOUR(B2)<=7),"Yes","No")

You typed this:
=IF(OR(HOUR(B950)<=17,HOUR(B950)>=7),"YES","NO")
 
Upvote 0

Forum statistics

Threads
1,223,238
Messages
6,170,939
Members
452,368
Latest member
jayp2104

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