calculate consecute streak in excel row

后端 未结 1 1132
后悔当初
后悔当初 2021-01-25 10:46

I am trying to calculate 2 values. Current Streak and Long Streak.

each record is on 1 row and contains a name and values

each of those columns has a value from

相关标签:
1条回答
  • 2021-01-25 10:53

    For current run, assuming data in C2:Z2, try this array formula:

    =IFERROR(MATCH(TRUE,C2:Z2>24,0)-1,COUNT(C2:Z2))

    Confirm with CTRL+SHIFT+ENTER

    For longest streak try this version based on the cell references used in your comment

    =MAX(FREQUENCY(IF(P7:BB7<=24,COLUMN(P7:BB7)),IF(P7:BB7>24,COLUMN(P7:B‌​B7))))

    Again confirm with CTRL+SHIFT+ENTER

    or to allow blanks in the range (which would end a streak) you can use this version

    =MAX(FREQUENCY(IF(P7:BB7<>"",IF(P7:BB7<=24,COLUMN(P7:BB7))),IF((P7:BB7="")+(P7:BB7>24),COLUMN(P7:BB7))))

    0 讨论(0)
提交回复
热议问题