I'm working on excel and in one of the formulas I have to do, I calculate how many different items are associated with a specific ID. I have the following columns
ID Item
OPX-0020433077 Continuity Services
OPX-0020433077 Storage Services
OPX-0020433077 Midrange Services
OPX-0020433077 Storage Services
OPX-0020433079 Digitization
OPX-0020433080 CPS-Other 3rd Party Products and Services
OPX-0020433080 CPS-Other 3rd Party Products and Services
OPX-0020433080 CPS-Other 3rd Party Products and Services
OPX-0020433081 Foundational Support Services
OPX-0020433081 Storage Services
OPX-0020433081 Foundational Support Services
OPX-0020433081 Storage Services
OPX-0020433081 Midrange Services
Therefore the result I should get is something like the following.
ID Count
OPX-0020433077 3
OPX-0020433079 1
OPX-0020433080 1
OPX-0020433081 3
This is because the id OPX-0020433077 has 4 items, but there is one of them that is repeated, therefore it would be counted as if they were 3, since the repeated one is ignored.
I have been using the following code.
=COUNT(IF($A$2:$A$11=A2,$B$2:$B$11))
But this formula always returns me 0. Some idea of how I could do it, can be using VBA or excel functions directly. Thank you.