Reputation: 129
I need to calculate the sum of M elements from every Nth row from data set (column A) starting from current cell's row (column B).
I've managed to do that via nested queries, but the performance is awful and the formula needs to be pasted into each cell of column B individually - while I need the table to be self-adjusting.
I've found out that most likely I need to use the SCAN formula, but I struggle to write the correct lambda for it and it gives me incorrect results.
Have a look at my table: https://docs.google.com/spreadsheets/d/1uzM1mx4uoIOiTtenI-fidb72r6Bqa3jnXmD90utPgS8/edit?usp=sharing
What am I doing wrong?
Upvotes: 0
Views: 280
Reputation: 1
alternative:
=INDEX(BYROW(IFNA(VLOOKUP(MAKEARRAY(
ROWS(A2:A), H1, LAMBDA(a, b, 2+(a-1)+(b-1)*H2)),
{ROW(A2:A), A2:A}, 2, )), LAMBDA(x, SUM(x))))
Upvotes: 1