Excel - Determine if a time & date is regular or OOH
Discussion
Driving me mad.
I need to simply find if a date and time is BAU or OOH shift.
=IF(AND(R2>=TIMEVALUE("08:00:00"),R2<=TIMEVALUE("18:00:00")),"BAU","OOH")
Should give me if the time was outside of normal working 8am to 6pm.
=IF(WEEKDAY(R2,2)<6, "BAU", "OOH") to determine if it's a weekday or weekend.
So if both are OOH it should give me times and dates that are weekend or outside of normal working hours. (ignoring BH for now).
Where R2 is the cell containing the date and time
I need to simply find if a date and time is BAU or OOH shift.
=IF(AND(R2>=TIMEVALUE("08:00:00"),R2<=TIMEVALUE("18:00:00")),"BAU","OOH")
Should give me if the time was outside of normal working 8am to 6pm.
=IF(WEEKDAY(R2,2)<6, "BAU", "OOH") to determine if it's a weekday or weekend.
So if both are OOH it should give me times and dates that are weekend or outside of normal working hours. (ignoring BH for now).
Where R2 is the cell containing the date and time
How about something like this which I used recently
=IF(OR(HOUR(R2)<8, WEEKDAY(R2)=7, WEEKDAY(R2)=1),"Out",IF(HOUR(R2)>16,"Out","In"))
Problem with this is that 08:00 and 17:00 are classed as out of hours when I suppose they should be in but it is a start of a working method. Probably a much better way to do it though.
=IF(OR(HOUR(R2)<8, WEEKDAY(R2)=7, WEEKDAY(R2)=1),"Out",IF(HOUR(R2)>16,"Out","In"))
Problem with this is that 08:00 and 17:00 are classed as out of hours when I suppose they should be in but it is a start of a working method. Probably a much better way to do it though.
cb31 said:
How about something like this which I used recently
=IF(OR(HOUR(R2)<8, WEEKDAY(R2)=7, WEEKDAY(R2)=1),"Out",IF(HOUR(R2)>16,"Out","In"))
Problem with this is that 08:00 and 17:00 are classed as out of hours when I suppose they should be in but it is a start of a working method. Probably a much better way to do it though.
Many thanks, that seems to do what is required.=IF(OR(HOUR(R2)<8, WEEKDAY(R2)=7, WEEKDAY(R2)=1),"Out",IF(HOUR(R2)>16,"Out","In"))
Problem with this is that 08:00 and 17:00 are classed as out of hours when I suppose they should be in but it is a start of a working method. Probably a much better way to do it though.
So for the next step if i want to count bank holiday as OOH, how could i do that?
The_Burg said:
cb31 said:
How about something like this which I used recently
=IF(OR(HOUR(R2)<8, WEEKDAY(R2)=7, WEEKDAY(R2)=1),"Out",IF(HOUR(R2)>16,"Out","In"))
Problem with this is that 08:00 and 17:00 are classed as out of hours when I suppose they should be in but it is a start of a working method. Probably a much better way to do it though.
Many thanks, that seems to do what is required.=IF(OR(HOUR(R2)<8, WEEKDAY(R2)=7, WEEKDAY(R2)=1),"Out",IF(HOUR(R2)>16,"Out","In"))
Problem with this is that 08:00 and 17:00 are classed as out of hours when I suppose they should be in but it is a start of a working method. Probably a much better way to do it though.
So for the next step if i want to count bank holiday as OOH, how could i do that?
https://support.office.com/en-us/article/workday-f...
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff


