ArrayFormula of Average on Infinite Truly Dynamic Range in Google Sheets

QUERY level 1: if all 5 cells in range C2:G have values: =QUERY(QUERY(C2:G, “select (C+D+E+F+G)/5”), “offset 1”, ) if not, then rows are skipped: if empty cells are considered as zeros: =INDEX(QUERY(QUERY({C2:G*1}, “select (Col1+Col2+Col3+Col4+Col5)/5”), “offset 1”, )) to remove zero values we use IFERROR(1/(1/…)) wrapping: =INDEX(IFERROR(1/(1/QUERY(QUERY({C2:G*1}, “select (Col1+Col2+Col3+Col4+Col5)/5”), “offset 1”, )))) to make Col references … Read more

Calculate Average of the largest values in multiple columns

May be are you asking this? SELECT ID, (SELECT AVG(v) FROM (VALUES (Mark1), (Mark2), (Mark3), (Mark4), (Mark5)) AS value(v)) as [AverageMarks] FROM Table1 If you are looking for only Average of 2 highest subjects among 3 subjects then try this. SELECT ID, (SELECT (SUM(v)-MIN(V))/2 FROM (VALUES (Mark1), (Mark2), (Mark3)) AS value(v)) as [AverageMarks] FROM Table1 … Read more