Hello Chandoo! This is my first post, so please let me know if I have broken any etiquette rules. I have been trying for about three days now to get a unique count based on multiple criteria. Using some forum solutions I found online (Chandoo included), I have a formula that "mostly" works, but is not returning the correct count. I've uploaded an excerpt/sample sheet, but basically, here's what I need to do...
I have a list of tickets sold by customer ID numbers. Each row represents 1 ticket and includes the event code and the customer ID number. I am looking to get a unique count of event codes for each unique customer ID number. (I need a one cell solution that does not require filtering because it's a huge list and I eventually need the count on every row record for export to a different program.)
The closest I've gotten is (I've replaced the exact cell references with column headings to make it easier to read):
=SUMPRODUCT((CustomerID=B2)*(IFERROR(1/COUNTIFS(EventCode,EventCode,CustomerID,B2),0)))
I'm getting results that are really close. So, in the sample included, Customer ID "10" should result in 33 unique Event Codes. But the formula returns 32.5. Customer ID "23" correctly returns 1 unique Event Code. But then Customer ID "211" returns 1.5 instead of 2 and Customer ID "2939" returns 2 1/3 instead of 4. If it was always off by .5 I could simply adjust the formula (though I don't understand why), but this doesn't seem to be the case.
I freely admit that my understanding of this formula is rudimentary, so I think I'm missing something basic, but I don't have a lot of experienced Excel formula users here at work to bounce things off of. Any help would be GREATLY appreciated!
I have a list of tickets sold by customer ID numbers. Each row represents 1 ticket and includes the event code and the customer ID number. I am looking to get a unique count of event codes for each unique customer ID number. (I need a one cell solution that does not require filtering because it's a huge list and I eventually need the count on every row record for export to a different program.)
The closest I've gotten is (I've replaced the exact cell references with column headings to make it easier to read):
=SUMPRODUCT((CustomerID=B2)*(IFERROR(1/COUNTIFS(EventCode,EventCode,CustomerID,B2),0)))
I'm getting results that are really close. So, in the sample included, Customer ID "10" should result in 33 unique Event Codes. But the formula returns 32.5. Customer ID "23" correctly returns 1 unique Event Code. But then Customer ID "211" returns 1.5 instead of 2 and Customer ID "2939" returns 2 1/3 instead of 4. If it was always off by .5 I could simply adjust the formula (though I don't understand why), but this doesn't seem to be the case.
I freely admit that my understanding of this formula is rudimentary, so I think I'm missing something basic, but I don't have a lot of experienced Excel formula users here at work to bounce things off of. Any help would be GREATLY appreciated!