ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   If a time is between 2:00PM and 11:00PM enter 1 otherwise blank (https://www.excelbanter.com/excel-worksheet-functions/51977-if-time-between-2-00pm-11-00pm-enter-1-otherwise-blank.html)

puzzled

If a time is between 2:00PM and 11:00PM enter 1 otherwise blank
 
I am predicting an occurrance to happen at a specific time (cell C9). I want
to look at that time and if it is between 7:00AM & 3:00PM enter a 1 (in cell
10) (represents 1st shift), if between 3:00PM & 11:00PM enter a 2 (represents
2nd shift) if betweem 11:00pm & 7:00AM enter a 1 (represents 1st shift).

Bob Phillips

If a time is between 2:00PM and 11:00PM enter 1 otherwise blank
 
=IF(AND(C9=--"07:00:00",C9<--"15:00:00"),1,IF(AND(C9=--"15:00:00",C9<--"23
:00:00"),2,3))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"puzzled" wrote in message
...
I am predicting an occurrance to happen at a specific time (cell C9). I

want
to look at that time and if it is between 7:00AM & 3:00PM enter a 1 (in

cell
10) (represents 1st shift), if between 3:00PM & 11:00PM enter a 2

(represents
2nd shift) if betweem 11:00pm & 7:00AM enter a 1 (represents 1st shift).





All times are GMT +1. The time now is 04:29 PM.

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