PC Review


Reply
Thread Tools Rate Thread

Calculation completion date/time

 
 
MPI Planner
Guest
Posts: n/a
 
      4th Mar 2009
I am looking at added expected production hours to a start date/time and
excluding weekends, show a completion date/time

6-Mar 10:32 PM + 12.8 "hours" =?

If I add the time to the date normally I get March 7th @ 11:21 AM. This is a
Saturday however and I want to get something on Monday. I tried using the
Workday function but only got 6-Mar 0:00 which is incorrect.


 
Reply With Quote
 
 
 
 
Bernard Liengme
Guest
Posts: n/a
 
      4th Mar 2009
In A1 I have 6-Mar-2009 10:32 PM
In B1 I have =12.8/24 (ie 12:28 hours)
In C1 I have =A1+B1+CHOOSE(WEEKDAY(A1+B1),1,0,0,0,0,0,2)
This should always give a weekday - did for me with limited testing
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"MPI Planner" <(E-Mail Removed)> wrote in message
news:45A939FD-1214-4550-85D0-(E-Mail Removed)...
>I am looking at added expected production hours to a start date/time and
> excluding weekends, show a completion date/time
>
> 6-Mar 10:32 PM + 12.8 "hours" =?
>
> If I add the time to the date normally I get March 7th @ 11:21 AM. This is
> a
> Saturday however and I want to get something on Monday. I tried using the
> Workday function but only got 6-Mar 0:00 which is incorrect.
>
>



 
Reply With Quote
 
Glenn
Guest
Posts: n/a
 
      4th Mar 2009
MPI Planner wrote:
> I am looking at added expected production hours to a start date/time and
> excluding weekends, show a completion date/time
>
> 6-Mar 10:32 PM + 12.8 "hours" =?
>
> If I add the time to the date normally I get March 7th @ 11:21 AM. This is a
> Saturday however and I want to get something on Monday. I tried using the
> Workday function but only got 6-Mar 0:00 which is incorrect.
>
>


Assuming you are counting all 24 hours except weekends, with start date/time in
A1 and hours (as a decimal value) in B1, try this:

=A1+(B1/24)+INT(((A1-INT(A1-WEEKDAY(A1,2)+1))*24+B1)/120)*2

If this doesn't fit your needs, try providing more details.
 
Reply With Quote
 
Shane Devenshire
Guest
Posts: n/a
 
      4th Mar 2009
Hi,

Suppose your date and time are in A1 and the hours to be added are entered
as time in B1 then

=A1+B1+IF(MOD(A1+B1,7)<2,2-(MOD(A1+B1,7)<=1))

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"MPI Planner" wrote:

> I am looking at added expected production hours to a start date/time and
> excluding weekends, show a completion date/time
>
> 6-Mar 10:32 PM + 12.8 "hours" =?
>
> If I add the time to the date normally I get March 7th @ 11:21 AM. This is a
> Saturday however and I want to get something on Monday. I tried using the
> Workday function but only got 6-Mar 0:00 which is incorrect.
>
>

 
Reply With Quote
 
Glenn
Guest
Posts: n/a
 
      4th Mar 2009
Bernard Liengme wrote:
> In A1 I have 6-Mar-2009 10:32 PM
> In B1 I have =12.8/24 (ie 12:28 hours)
> In C1 I have =A1+B1+CHOOSE(WEEKDAY(A1+B1),1,0,0,0,0,0,2)
> This should always give a weekday - did for me with limited testing
> best wishes



Fails if A1+B1 extends beyond Monday in the following week.
 
Reply With Quote
 
Bernard Liengme
Guest
Posts: n/a
 
      4th Mar 2009
Pity!
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Glenn" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Bernard Liengme wrote:
>> In A1 I have 6-Mar-2009 10:32 PM
>> In B1 I have =12.8/24 (ie 12:28 hours)
>> In C1 I have =A1+B1+CHOOSE(WEEKDAY(A1+B1),1,0,0,0,0,0,2)
>> This should always give a weekday - did for me with limited testing
>> best wishes

>
>
> Fails if A1+B1 extends beyond Monday in the following week.



 
Reply With Quote
 
Glenn
Guest
Posts: n/a
 
      4th Mar 2009
"MPI Planner" wrote:
> > I am looking at added expected production hours to a start date/time and
> > excluding weekends, show a completion date/time
> >
> > 6-Mar 10:32 PM + 12.8 "hours" =?
> >
> > If I add the time to the date normally I get March 7th @ 11:21 AM. This is a
> > Saturday however and I want to get something on Monday. I tried using the
> > Workday function but only got 6-Mar 0:00 which is incorrect.
> >
> >



Shane Devenshire wrote:
> Hi,
>
> Suppose your date and time are in A1 and the hours to be added are entered
> as time in B1 then
>
> =A1+B1+IF(MOD(A1+B1,7)<2,2-(MOD(A1+B1,7)<=1))
>



Fails with the stated example (I get 3/8/2009 11:20 AM). Actually, only seemed
to work for results on the same week as A1 or (almost all of) the following Tuesday.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
time and date calculation plgii via AccessMonster.com Microsoft Access Form Coding 8 18th Oct 2006 02:13 PM
Date and Time Calculation. YardDancer Microsoft VB .NET 4 29th Jul 2006 11:08 AM
Ignoring Time in a Date Time Calculation =?Utf-8?B?bm1w?= Microsoft Excel Worksheet Functions 3 23rd Nov 2005 08:32 PM
Repost - Time Calculation After Date and Time. =?Utf-8?B?UnVzcw==?= Microsoft Excel Worksheet Functions 0 30th Mar 2004 12:16 PM
Date/Time Calculation victoriousone Microsoft Excel Misc 1 12th Dec 2003 03:55 PM


Features
 

Advertising
 

Newsgroups
 


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