Count Unique with multiple conditions in Excel -
first post, help.
i'm trying write formula gives count of unique matches within range based on 4 criteria
i've searched , found similar answers steered me towards formula involved sumproduct , frequency, haven't been able write correct formula.
i have table of records of managers assigned employee recorded on year , quarter. employee can have more 1 manager within quarter, , same manager can asssigned more once within quarter. manager recorded in status column exit, new or change.
i have flag column in wish @ eahc row , calculate value based on these criteria row
a. if status = exit, flag = 0
b. if status = change or new, , 1 manager employee name in same q , y, flag = 0
c. if status = change or new, , more 1 manager employee name in same q , y, flag = count of unique manager names employee same q , y. [note - it's not count of manager names, rather unique names.]
my if calculation can handle a. , b., it's c. failing on.
i've attached screenshot here. flag field column f, , formula first row of data:
{=if(c2 = "exit", 0, if(countifs($d$2:$d$9, d2, $e$2:$e$9, e2, $a$2:$a$9, a2, $c$2:$c$9, "<>exit") = 1, "0", sum(--(frequency(if(($a$2:$a$9=a1)*($c$2:$c$9<>"exit")*($d$2:$d$9=d1)*($e$2:$e$9=e1),$b$2:$b$9),if(($a$2:$a$9=a1)*($c$2:$c$9<>"exit")*($d$2:$d$9=d1)*($e$2:$e$9=e1),$b$2:$b$9))>0))))}
i'm looking formula solution, won't doing in pivot table
thanks
tm
Comments
Post a Comment