ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Selecting business hours via date / if function? (https://www.excelbanter.com/excel-worksheet-functions/198338-selecting-business-hours-via-date-if-function.html)

Rhiannon

Selecting business hours via date / if function?
 
Hello

Is there a formula that can be used to return a "true" or "out of hours"
value if the date/ time of a particulr cell is outside of (my) business hours
please? (say 7am to 5:30pm). Does the date/ time need to be entered in a
certain way ? (currently date is in one column and time is in another - in
h:mm:ss AM/PM format.

Thanks

Rick Rothstein \(MVP - VB\)[_1092_]

Selecting business hours via date / if function?
 
Give this formula a try...

=IF(AND(B1=TIME(7,0,0),B1<=TIME(17,30,0)),"In time","Out of time")

Rick


"Rhiannon" wrote in message
...
Hello

Is there a formula that can be used to return a "true" or "out of hours"
value if the date/ time of a particulr cell is outside of (my) business
hours
please? (say 7am to 5:30pm). Does the date/ time need to be entered in a
certain way ? (currently date is in one column and time is in another - in
h:mm:ss AM/PM format.

Thanks



Rhiannon

Selecting business hours via date / if function?
 
Thanks; that worked perfectly! (very speedy answer too - thanks)

"Rick Rothstein (MVP - VB)" wrote:

Give this formula a try...

=IF(AND(B1=TIME(7,0,0),B1<=TIME(17,30,0)),"In time","Out of time")

Rick


"Rhiannon" wrote in message
...
Hello

Is there a formula that can be used to return a "true" or "out of hours"
value if the date/ time of a particulr cell is outside of (my) business
hours
please? (say 7am to 5:30pm). Does the date/ time need to be entered in a
certain way ? (currently date is in one column and time is in another - in
h:mm:ss AM/PM format.

Thanks





All times are GMT +1. The time now is 12:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com