Comment compter deux différentes colonnes?

J'ai vraiment besoin de votre aide concernant le tableau ci-dessous, j'ai besoin d'une formule pour me montrer combien d'attente / fermé pour chaque projet.

Project Status Project Pending Closed VIVA closed VIVA 1 2 ZAIN closed ZAIN 1 1 VIVA PENDING WATANIA 1 0 WATANIA closed ZAIN PENDING VIVA closed 

Je connais seulement VBa (je ne connais pas vraiment les fonctions du classeur), alors que vous ne spécifiez pas ce que vous voulez, ce VBa devrait faire ce que vous voulez

 Sub UpdateStatus() Dim row As Integer row = 2 ' sets the starting row Dim statisticRow As Integer statisticRow = 2 Do While (True) ' we must reset everything before we go on our quest. Be gone foul witch If Range("F" & statisticRow).Value = "" Then Exit Do End If Range("F" & statisticRow).Value = "" Range("G" & statisticRow).Value = "" Range("H" & statisticRow).Value = "" statisticRow = statisticRow + 1 Loop Do While (True) Dim currentValue As String currentValue = Range("A" & row).Value Dim otherValue As String If currentValue = "" Then Exit Do End If Dim otherRow As Integer otherRow = 2 ' sets the starting row where the results are Do While (True) ' find it or add it otherValue = Range("F" & otherRow).Value Dim currentValueStatus As String If otherValue = "" Then currentValueStatus = Range("B" & row).Value Range("F" & otherRow).Value = currentValue If currentValueStatus = "closed" Then Range("H" & otherRow).Value = 1 End If If currentValueStatus = "PENDING" Then Range("G" & otherRow).Value = 1 End If Exit Do End If If currentValue = otherValue Then ' Good news sire, I found it currentValueStatus = Range("B" & row).Value If currentValueStatus = "closed" Then Range("H" & otherRow).Value = Range("H" & otherRow).Value + 1 End If If currentValueStatus = "PENDING" Then Range("G" & otherRow).Value = Range("G" & otherRow).Value + 1 End If Exit Do End If otherRow = otherRow + 1 Loop row = row + 1 Loop End Sub 

Avant

Entrez la description de l'image ici

Et après avoir exécuté la macro

Entrez la description de l'image ici

Comme vous pouvez le voir, il vous apportera automatiquement les noms de l'entreprise et déterminera combien existent chacun. Cela signifie que si vous avez ajouté une nouvelle entreprise et que vous avez réactivé la macro, elle sera mise à jour avec les nouveaux détails sans modification du code.