View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default Elapsed Time Assistance

in C2:

=1-MOD(A2,1)+MOD(B2,1)+(NETWORKDAYS(A2,B2)-2)

Format cell as [h]:mm

For NETWORKDAYS, you need 'Analysis ToolPak'

Tools==Addins=check 'Analysis Toolpak'

You can add holidays into NETWORKDAYS

HTH

"Bernard Liengme" wrote:

Try this (only partly tested) function

Function worktime(BeginDay, EndDay)
mytime = EndDay - BeginDay
BeginDay = Int(BeginDay)
EndDay = Int(EndDay)
' assumes neither Start or End dates are weekends
For j = BeginDay + 1 To EndDay - 1
If Weekday(j) = vbSunday Or Weekday(j) = vbSaturday Then
mytime = mytime - 1
End If
Next j
worktime = mytime
End Function

Call it with =worktime(A2,B2)
And format the cell with custom format [h]:mm

Need help with VBA? See David McRitchie's site on "getting started" with VBA
http://www.mvps.org/dmcritchie/excel/getstarted.htm
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email


"Wannano" wrote in message
...
A2: 4/03/2007 2:15 PM (Start)
B2: 4/05/2007 7:00 PM (End)
C2: Need formula

I need a task measuring formula in C2 to capture the amount of time taken
to
complete a specific task. Weekends do not count in this event. It might
sometime take longer than 24 hours to complete a task. I would like the
results to be in a h:mm format.

THANK YOU!

--
Texas Wannano