Function EssaiLissage(L As Integer, C As Integer)
' Syntax : =EssaiLissage(LIGNE();COLONNE())
Dim Month1 As Integer, Month2 As Integer
Application.Volatile
Month1 = Month(Cells(L, 23)) ' Start month extract
Month2 = Month(Cells(L, 24)) ' End month extract
If (C - 28) >= Month1 And (C - 28) <= Month2 Then ' Month segment definition
EssaiLissage = Round(Cells(L, 22) / (Month2 - Month1 + 1), 2) ' Average value distribution
Else
EssaiLissage = ""
End If
If EssaiLissage = 0 Then EssaiLissage = ""
End Function