Search code examples
google-sheetscountif

Count columns where the value of each column is the lowest across 5 rows


Google sheets, have Fantasy Football player scores in rows for each of 38 gameweeks over the year.

As another measure of skill, want to know how many times a player has been last or first placed in each of the gameweeks. This is shown below where red is last and green is first placed:

enter image description here

Have tried Counta, Countif etc including use of Filter function. DO I need to try Query??


Solution

  • Here's a sample setup and and the respective formulas would be

    WON Formula (cell B2)

    =BYROW(INDEX(BYCOL(D2:AO6,LAMBDA(bx,IF((SUM(bx)=0)+(COUNTA(bx)=0),,IF(MAX(bx)=bx,1,))))),LAMBDA(ax,SUM(ax)))

    LOST Formula (cell C2)

    =BYROW(INDEX(BYCOL(D2:AO6,LAMBDA(bx,IF((SUM(bx)=0)+(COUNTA(bx)=0),,IF(MIN(bx)=bx,1,))))),LAMBDA(ax,SUM(ax)))

    -

    enter image description here