![]() |
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 |
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 |
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 |
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 |
All times are GMT +1. The time now is 05:13 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com