How To Count Unique Values Based On Another Column In Excel

998 Views Asked by At

enter image description here

I am trying to calculate the number of unique values in A column based on the corresponding values in column B. I should get 3 unique values corresponding to 10 and 1 corresponding to 15.

What I have tried so far?

Let's say 10 is in the cell D2

=SUMPRODUCT((($A$2:$A$5=D2))/COUNTIFS($A$2:$A$5,$A$2:$A$5&"",$B$2:$B$5,$B$2:$B$5&""))

Then using ctrl+shift+enter I've made the formula into array, but I get 0. It is wrong.

Your help is very appreciated.

0

There are 0 best solutions below