jeudi 1 août 2019

Count consecutive days/occurrences based on multiple criteria

working on a soltion for my dads company and i'm stuck, Please, anyone.. In the attached sheet, i have a problem with the below formula.

=IF(B2="","", ArrayFormula(max(frequency(if(E2:Z2=B2,row(E2:Z2)),if(E2:Z2<>B2,row(E2:Z2))))))

Located in Column D, it is attempting to count consecutive days based on the below criteria:

  • Is in use/equal to today (Column B)
  • Stop counting backwards (past) when it reaches a different entry.
  • Not count into the furure.

Column C is the expected answer.

The result simply counts all consecutive occurrence across the entire line, this may be in the future or they may have used a different asset for a single day which interrupts the consecutive count, however it continues after if there are indeed more to count.

Highlighted Green is the range that im trying to count.

For reference, Please assume that Today() is 01/08/2019 else things would continually change..

Sorry, Thanks in advance

Russ

https://docs.google.com/spreadsheets/d/1FCCnSqMmH5jLFLTQFnmLlIrkiIicjHFvTcP87zBBjPM/edit#gid=0

Aucun commentaire:

Enregistrer un commentaire