Complicated COUNTIFS formula with unique values: Part 2

70 Views Asked by At

I had asked this question previously and got a response that worked. However, as of this morning, the solution no longer works and I cant figure out why.

Previously asked question

Looking for help with a formula that can help tally employees but only count the occurrence of a name once. I do not want a double count if an employee works multiple positions in the same day(Emily Anne of ABC Company in the example spreadsheet). Additionally, I do not want an employee counted if they didn't work that day (ex. Dave Smith with 0 hours)

I used the formula provided by Mayukh Bhattacharya:

=SUMPRODUCT(IFERROR((("FORWARD"=$A3:$A$28)*($M$3:$M$28>0))/
  COUNTIFS($A3:$A$28,$A3:$A$28,$I$3:$I$28,$I$3:$I$28,$M$3:$M$28,">0"),0))

However now instead of producing the correct count, the formula in J1 now produces 0.

Example spreadsheet

1

There are 1 best solutions below

0
Mayukh Bhattacharya On

I don't see any reason where the formula is not working, even when changing the word "FORWARD" to ABC Company

enter image description here


=SUMPRODUCT(IF((M3:M28>0)*(A3:A28="ABC Company"),
  1/COUNTIFS(A3:A28,"ABC Company",E3:E28,E3:E28,M3:M28,">0"),0))

Or, Using old formula given.

=SUMPRODUCT(IFERROR((("ABC Company"=$A$3:$A$28)*($E$3:$E$28>0))/
  COUNTIFS($A$3:$A$28,$A$3:$A$28,$E$3:$E$28,$E$3:$E$28,$M$3:$M$28,">0"),0))

Or, Using dynamic array formulas:

=SUM(N(TAKE(UNIQUE(CHOOSECOLS(FILTER(A3:N28,(A3:A28="ABC Company")*(M3:M28>0)),1,5)),,1)<>""))

Reference to last post: Solutions in last post


Note: If using older version of excel then make sure to hit the CTRL+SHIFT+ENTER while exiting the edit mode.