Excel: count unique values using SUMPRODUCT with multiple conditions -


ok, have sum product working give me count of unique values in column:

=sumproduct((f2:f38<>"")/countif(f2:f38,f2:f38)) 

so if have numbers: 1, 2, 3, 1, 5, 6, 2, 5, 2 return 5.

but want count number of unique values based upon number, e.g.:

name:             sales: mike              2 bob               1 gary              1 mike              5 bob               6 gary              1 mike              3 bob               4 gary              2 mike              1 bob               2 gary              6 mike              3 bob               1 gary              1 mike              1 bob               3 gary              4 

it there 4 unique values "name" mike, 5unique values "name" bob, and4unique values "name" gary. because "name" mike there numbers253131, unique numbers are2531and therefore count return4`.

is there way of doing this?

here's 1 solution.

insert cell @ bottom value trying count unique for.. "gary" @ bottom of sheet. create column right of sales column called "namevalue". create formula in column:

=if(a2=$a$10,b2,"") <-where $a$10 location of "gary" 

then @ bottom of new column insert formula:

=sum(if(c2:c6<>"",1/countif(c2:c6, c2:c6), 0)) <-where c2:c6 range create above. 

you might need press ctrl+shift+enter when type formula in. can change value of a12 value in name column , spit out unique count.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -