View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
BoniM BoniM is offline
external usenet poster
 
Posts: 353
Default Add 4 hours (only if between 9am-5pm)

=IF(AND(HOUR(A2)=13,MINUTE(A2)0),IF(WEEKDAY(A2)= 6,A2+2.833333,A2+0.833333),A2+0.166667)

Checks to see if it's after 1 PM, if it is, checks to see if it's friday, if
it is friday, adds 2 days and 20 hours (time from close to open, plus four) -
if it's not friday, but is after 1, just adds 20 hours, if none of the above,
adds 4 hours.
This formula assumes that the date/time in column A will always be a workday
and in working hours.

"Angela1979" wrote:

Hi all,

I post a message earlier but it seems to have been removed.

Here goes again....

In column A I have a date and time.
I need a formula that will add 4 hours to the date and time, but take
into account working hours and weekends

Monday - Friday 9am - 5pm

Example
Column A
12/04/07 16:00

Column B
Formula for + 4 hours (taking into account Monday-Friday 9am - 5pm)

So the result in column B should be 12pm 13/04/07

Thanks Everyone