Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default Add 4 hours (only if between 9am-5pm)

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

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Add 4 hours (only if between 9am-5pm)

Angela,

For a date time in cell A2:

=A2+IF((A2-INT(A2)+4/24)*24 17,IF(WEEKDAY(A2,2)=5,2,0)+20/24,4/24)

HTH,
Bernie
MS Excel MVP


"Angela1979" wrote in message
ups.com...
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



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 903
Default Add 4 hours (only if between 9am-5pm)

Your original question is out there and was posted 20 minutes
before you repeating question. You need a little more patience.
There can be a long
delay if you do not connect directly to the Microsoft news servers.
If you look at your message headers you will see a very long
PATH with exclamation points between each hop to another
server.
http://www.mvps.org/dmcritchie/excel...s.htm#xlgroups

If you lose track of a question you can search newsgroups
based on your email address
http://groups.google.com/advanced_group_search
http://www.mvps.org/dmcritchie/excel/xlnews.htm#search

I think you can answer your question with a little help
from either of these web pages.
http://www.mvps.org/dmcritchie/excel/datetime.htm
http://www.cpearson.com/excel/datetime.htm

---
HTH,
David McRitchie, Microsoft MVP - Excel
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Angela1979" wrote in message ups.com...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
wages - multiply hours and minutes by number of hours worked Carol (Australia) Excel Discussion (Misc queries) 6 April 1st 07 01:16 AM
Drivers Hours Timesheet - Calculate Hours Worked on Weekly Basis Graham Excel Discussion (Misc queries) 2 January 28th 07 08:40 PM
how to add hours and show actual hours not decimal numbers TWERNER New Users to Excel 2 August 21st 06 08:35 AM
Problem converting Hours to Days, Hours, Minutes Zyzzx Excel Worksheet Functions 4 October 24th 05 04:19 PM
Convert hours and minutes in time format into fractions of hours.. Akern Excel Worksheet Functions 4 April 21st 05 02:56 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"