I have a 2D dynamic array of 0s and 1s (e.g. B1#). I want to calculate the number of 1s in each row. This can be done using SUM of each row or COUNTIFS on each row.
My goal is to have a single dynamic array formula which would sum/countifs each row and hence spill automatically according to the number of rows in the 2D dynamic array.
How do I do this?
What I tried:
- I added a support column in A1# as Sequence(Rows(B1#))
- I tried SUM(INDEX(B1#,A1#,0)) but obviously this doesn't work because SUM is bound to return a single value while I am expecting a spill of totals across ROWS(B1#)
- I tried COUNTIFS(INDEX(B1#,A1#,0),1) but this also results in a single value that too #VALUE!