Hello,
I am needing a formula to perform a countifs if Column A contains "Andrew" and Column B has the interior.colorindex =35
I have been using the below function which I think is quite commonly found on the web, and works fine but only counts column B and has no reference to column A or any other criteria.
I just need to help modifying the above formula to also incrportate a second condition for column A. There is also a sample screen shot below.
Many help would be greatly appreciated.
Cheers, Andrew
I am needing a formula to perform a countifs if Column A contains "Andrew" and Column B has the interior.colorindex =35
I have been using the below function which I think is quite commonly found on the web, and works fine but only counts column B and has no reference to column A or any other criteria.
VBA Code:
Public Function GetColorIndex(Cell As Range)
GetColorIndex = Cell.Interior.ColorIndex
End Function
Public Function CountColorIndexInRange(Rng As Range, TestColor As Long)
Dim cnt
Dim cl As Range
cnt = 0
For Each cl In Rng
If GetColorIndex(cl) = TestColor Then
Rem Debug.Print ">" & TestColor & "<"
cnt = cnt + 1
End If
Next
CountColorIndexInRange = cnt
End Function
Sheet11.Range("D4").Value = CountColorIndexInRange(Sheet11.Range("B7:B750"), 35)
I just need to help modifying the above formula to also incrportate a second condition for column A. There is also a sample screen shot below.
Many help would be greatly appreciated.
Cheers, Andrew