I am trying to count the distinct ID values whenever location and date equal specific values.
There are a handful of articles/questions out there that outline a few different ways to do this (e.g. How to count unique values in Excel with two conditions), but for some reason none seem to be working for me (which is likely because I'm doing something wrong).
My table in excel is set up like so
+------------------+--------------+------------+
| Col A - Location | Col B - Date | Col C - ID |
+------------------+--------------+------------+
| A | Mar 2018 | 1 |
| B | Mar 2018 | 2 |
| C | Mar 2018 | 3 |
| A | Mar 2018 | 4 |
| B | Mar 2018 | |
| C | Mar 2018 | 5 |
| A | Mar 2018 | 6 |
| B | Apr 2018 | 1 |
| C | Apr 2018 | 2 |
| C | Apr 2018 | 4 |
| C | Mar 2018 | 5 |
| A | Mar 2018 | 1 |
| B | Mar 2018 | 5 |
| B | Mar 2018 | 8 |
| B | Mar 2018 | |
| C | Mar 2018 | 1 |
| B | Mar 2018 | 3 |
+------------------+--------------+------------+
I tried 4 different calculations I found online and altered to fit my data:
Calc 1 (run by just hitting ENTER):
=COUNTIFS(A:A, "A",C:C,C:C,B:B, "Mar 2018")
Result = 2
Calc 2 (running by hitting CTRL + SHFT + ENTER):
=SUMPRODUCT( ( (C:C <> "") * (A:A = "A") * (B:B = "Mar 2018") ) / COUNTIFS(C:C,C:C & "",A:A, "A",B:B, "Mar 2018"))
Result = 0
Calc 3 (running by hitting CTRL + SHFT + ENTER):
=SUM(IF(FREQUENCY(IF(C:C<>"", MATCH(C:C,C:C,0)),ROW(C:C)-ROW(C2)+1),1))
Result = 0
Calc 4 (running by hitting CTRL + SHFT + ENTER):
=SUM(IF(FREQUENCY(IF((A:A="A")*(B:B="Mar 2018")*(C:C<>""),MATCH(C:C,C:C,0)),ROW(C:C)-MIN(ROW(C:C))+1),1))
Result = 0
(This one keeps giving an error message about running out of resources while trying to calculate)
The actual results I'm trying to find is that for 'Col A - Location' where the value is 'A' and for 'Col B - Date' where the value is 'Mar 2018' the unique # of 'Col C - ID' should be 3.