Function NbP(CellD, CellF, DateDébut As Date, DateFin As Date)
Application.Volatile
LigD = CellD.Row: ColD = CellD.Column
LigF = CellF.Row: ColF = CellF.Column
NbP = 0
For i = LigD + 1 To LigF
NbP = NbP + Application.CountIfs(Range(Cells(i, ColD), Cells(i, ColF)), "p", _
Range(Cells(LigD, ColD), Cells(LigD, ColF)), ">=" & CLng(DateDébut), _
Range(Cells(LigD, ColD), Cells(LigD, ColF)), "<=" & CLng(DateFin))
Next i
End Function