I'll try my best to explain. Say I've got a sheet that looks like this (in this contrived example, let's say I'm sending marketing emails to various people, I know their ages and zip codes, and I want to track click rates in those emails):
A | B | C
1 Age | zip code | click?
2 26 | 11111 | true
3 27 | 11112 | true
4 28 | 11111 | false
5 27 | 22222 | false
6 28 | 11112 | false
7 26 | 22222 | true
Now I want to track various stats. In this case, I want to track the click rate by age and by zip code. So I've got a table like this:
E F G
1 Age | # sent | # clicked
2 26 |
3 26 |
4 27 |
5 28 |
So basically in the "# sent" column, I can put (in F2, for example):
=COUNTIF(A:A, E2)
And this would result in a 2 in cell F2, because there were two occurrences of "26" in column A.
But now what if I want to know how many clicked? I want to say something like:
=COUNTIF(A:A == E2 AND C:C == True, for the same row where A:A matched E2)
I know I can add another column D with a formula like
=IF(C2, A2, "")
Which will only but the age in column D if column C is true. But I can have potentially many criteria and it doesn't seem like I should have to add another "fake" column for each criteria column I have.
Is there a way to do this? If not in Google Docs, in Excel?