Formula for a 4 day work week
A couple of suggestions
Try Workday and define a list of all the fridays and holidays this allows
you to consider holidays as well if this is applicable.
If this function is not available, and returns the #NAME? error, install and
load the Analysis ToolPak add-in.
Otherwise try
=A3+INT((B3-1)/4)*7+MOD(B3-1,4)
+IF(OR(WEEKDAY(A3+INT((B3-1)/4)*7
+MOD(B3-1,4),2)<WEEKDAY(A3,2),
WEEKDAY(A3+INT((B3-1)/4)*7
+MOD(B3-1,4),2)4),3,0)
It is a bit of a mouthfull but it works.
It is probably easier to use a macro function as follows, this needs to be
pasted in a module for the workbook:
Option Explicit
Function networkingdays4dayweek(ByVal startdate As Date, ByVal days As
Integer) As Date
Dim d As Date ' working date
Dim w As Integer ' whole week days
Dim dd As Integer ' remaining days
Dim ewd As Integer ' end weekday no.
Dim swd As Integer ' start weekday no.
Application.Volatile
d = startdate
swd = Weekday(d, vbMonday)
If swd 4 Then ' not a working day
networkingdays4dayweek = 0
Exit Function
End If
w = Int((days - 1) / 4) * 7
dd = (days - 1) Mod 4
d = d + w + dd ' end date before adjustment
ewd = Weekday(d, vbMonday)
' check if needs adjustment
' ie falls before the start date or after Thursday
If (ewd < swd Or ewd 4) Then
d = d + 3
End If
networkingdays4dayweek = d
End Function
and just call it in the sheet with
=networkingdays4dayweek(A3,B3)
--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.
"tamarade" wrote:
I am trying to create a formula that will result in a date. I have a start
date, a number of work days, however my dilemna is we only work 4 days. So
the formula would have to compute a completion date but exclude Fri, sat, &
sunday, any suggestions?
|