Sub A()
Dim WB As Workbook
Dim ws As Worksheet
Dim StartDate As Date
Dim EndDate As Date
Dim CurrentDate As Date
Dim Rounds As Integer
Dim LastDate As Integer
Dim LastCount As Integer
Dim Turnover As Integer
Static OnDate As Integer
Static Count As Integer
Static CurrentRound As Integer
Set WB = ThisWorkbook
Set ws = WB.Worksheets("Employees")
OnDate = ws.Cells(12, 6) 'has "counta" counts the number of months so it knows how meny columns to go over in the loop
Rounds = ws.Cells(12, 5) 'has "counta" counts the number of users to know how meny rows to go down in the loop
CurrentRound = 0
Count = 0
Turnover = 0
LastDate = 0
GoTo Nax
Nax:
CurrentDate = ws.Cells(1, (13 + LastDate))
EndDate = ws.Cells((2 + CurrentRound), 8)
StartDate = ws.Cells((2 + CurrentRound), 7)
CurrentRound = CurrentRound + 1 ' Moves to the next row
If StartDate < CurrentDate And EndDate > CurrentDate Then 'Makes sure the date is within range
Count = Count + 1
Else
End If
If CurrentRound <> Rounds Then 'Checks to see if theres data here
GoTo Nax
Else
LastDate = LastDate + 1 ' Moves to the next column
LastCount = Count
If LastDate <> OnDate Then 'Checks to see if theres data here
Turnover = (LastCount - Count) / Count
ws.Cells(13, (1 + LastDate)) = Turnover
ws.Cells(13, (2 + LastDate)) = Count
CurrentRound = 0
GoTo Nax
Else
End If
End If
End Sub