Home > OS >  Count values as per required pattern in excel
Count values as per required pattern in excel

Time:04-21

enter image description here

User ID - 39 is repeated but there are different incentive plans for 39. I want the result as shown in desired output.

CodePudding user response:

With Excel-365 can try-

=SUM(--(UNIQUE(FILTER($B$2:$B2,$A$2:$A2=A2))<>""))

enter image description here

CodePudding user response:

It looks like your data is sorted by User ID and Incentive Plan. In that case you may benefit from IF and logical thinking:

enter image description here

=IF(A2<>A1;1;IF(B2=B1;C1;C1 1))

Please, notice this formula will work only if your data is sorted like the one in your image. If you change this order, the formula won't work properly.

  • Related