How do i add two COUNTIF equations together to get a total
+1
A:
I assume you only want to count when the list contains both items in the same position. Example
A1: =a B1: =a
A2: =a B2: =b
A3: =a B3: =c
COUNTIF(A1:A3,"a") returns 3
COUNTIF(B1:B3,"b") returns 1
to count where first list =a and second list =b you can use SUMPRODUCT, which would return 1.
SUMPRODUCT((A1:A3="a")*(B1:B3="b"))
Or you could use an array formula. You need to use CTRL+SHIFT+ENTER when commiting the formula rather than a simple ENTER. This will automatically add { } around the formula.
=SUM((A1:A3="a")*(B1:B3="b"))
Andy Pope
2010-02-04 11:25:25
+1
A:
Combining this with your other question, do you mean?
=(COUNTIF(B3:L3,"X")*20)+(COUNTIF(N3:O3,"X")*2.5)
That would add 20 for every X between B3 and L3 and 2.5 for every X in N3 or O3.
Craig
2010-02-04 15:20:27
+1
A:
Working on Andy Pope's example (if this is what you want):
=COUNTIFS(A11:A13,"a",B11:B13,"b")
gd047
2010-02-04 16:50:27