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, and
4unique values "name" gary. because "name" mike there numbers
25
3
1
3
1
, unique numbers are
25
3
1
and therefore count return
4`.
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
Post a Comment