google-sheetsgoogle-sheets-formulaarray-formulassumproduct

SUMPRODUCT+ARRAYFORMULA in Google Sheets


In column E there are 8 formulas that calculate the probability of goal difference between Barcelona and Real Madrid (SUMPRODUCT(A2:A+D3>B2:B)/COUNTA(A2:A)). We need to replace these 8 formulas with one formula that will fill cells E4:E8 automatically. It is clear that we need to use ARRAYFORMULA, but how to insert cells D3:D10 into it?

File link: https://docs.google.com/spreadsheets/d/1y3bDILxts1ix8A-KHUqrSty476R9uRd_glsz3Ey-sdk/edit#gid=0

enter image description here


Solution

  • =byrow(D3:D10,lambda(y,SUMPRODUCT((A2:A+y>B2:B)*(A2:A<>""))/COUNTA(A2:A)))
    

    Result:

    enter image description here