Hi all,
I need help with a countif formula.
Here's the deal, I have the following:
A B C
1 Miami Yes
2 Atlanta Yes
3 Miami NO
4 Miami NO
5 Atalanta NO
I want to count how many times Miami and Yes are found in combination.
Tx
Hi all,
I need help with a countif formula.
Here's the deal, I have the following:
A B C
1 Miami Yes
2 Atlanta Yes
3 Miami NO
4 Miami NO
5 Atalanta NO
I want to count how many times Miami and Yes are found in combination.
Tx
Try:
A message box will appear outlining how many time the combination appears!Sub countMiami_Yes() Dim x As Integer Dim city As String Dim yesNo As String Dim countNum As Integer x = 1 countNum = 0 Cells(x, 1).Activate Do Until ActiveCell = "" city = Cells(x, 1).Value yesNo = Cells(x, 2).Value If city = "Miami" And yesNo = "Yes" Then countNum = countNum + 1 End If x = x + 1 Cells(x, 1).Activate Loop MsgBox ("Miami and Yes are found : " & countNum & " times") End Sub
HTH,
mccreaso
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks