ARRAYFORMULA handles a whole column when each row needs simple arithmetic. It can't sum or average each row of a block: ARRAYFORMULA(SUM(B2:F7)) still returns one total. The LAMBDA helpers can.
- BYROW(range, LAMBDA(row, ...)) hands each row to the LAMBDA as a small range and returns one value per row:
=BYROW(B2:F7, LAMBDA(week, SUM(week))).
- BYCOL does the same per column and returns a row of results.
- MAP(range1, range2, ..., LAMBDA(a, b, ...)) hands the LAMBDA one value from each range, cell by cell, and returns a range of the same size. The LAMBDA needs one parameter per range.
Each call must return one value. If the LAMBDA returns a row or a list, that cell shows #VALUE!. With an open-ended range such as B2:F, the empty rows below the table are processed too, so guard them: IF(COUNT(r)=0, "", ...).
=BYROW(B2:F7, LAMBDA(week, SUM(week)))
=MAP(F2:F7, G2:G7, LAMBDA(n, cap, IF(n>=cap, "Full", cap-n)))
Weekly attendance per class; places left on Friday.