bonjour,
une solution via une fonction personnalisée
Function maxs(r, n)
If r.Rows.Count > 1 Then
t = Application.Transpose(r)
Else
t = Application.Transpose(Application.Transpose(r))
End If
For i = LBound(t) To n - IIf(LBound(t) = 0, 1, 0)
For j = i + 1 To UBound(t)
If t(i) < t(j) Then a = t(i): t(i) = t(j): t(j) = a
Next j
Next i
a = ""
For i = LBound(t) To n - IIf(LBound(t) = 0, 1, 0)
a = a & t(i) & "|"
Next i
maxs = Left(a, Len(a) - 1)
End Function
appel de la fonction dans excel
=maxs(plage,nombre de valeurs à retourner)
exemple pour obtenir les 5 valeurs max de la plage A1:A10
=maxs(A1:A10,5)