Bonjour,
Une proposition avec une fonction de feuille personnalisée (VBA)
Option Explicit
Public Function Somme_couleur(CellColor As Range, SumRange As Range)
Dim mycell As Range
Dim iCol As Integer
Dim myTotal
iCol = CellColor.Interior.ColorIndex
For Each mycell In SumRange
If mycell.Interior.ColorIndex = iCol Then
myTotal = WorksheetFunction.Sum(mycell) + myTotal
End If
Next mycell
Somme_couleur = myTotal
End Function
Public Function Compte_couleur(CellColor As Range, SumRange As Range)
Dim mycell As Range
Dim iCol As Integer
Dim myTotal
iCol = CellColor.Interior.ColorIndex
For Each mycell In SumRange
If mycell.Interior.ColorIndex = iCol Then
myTotal = 1 + myTotal
End If
Next mycell
Compte_couleur = myTotal
End Function