Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to create an Excel array formula where each element n is the sum of the first n elements of another array?

Assuming there is an array in cells A1# (for instance a sequence or an array of random numbers), I would like to obtain an array in cells B1# where each row (n) of the array is the sum from 1 to n of the rows of the first array. Is it possible to do so with a formula?

like image 463
ZZR Avatar asked Dec 14 '22 07:12

ZZR


1 Answers

In B1 enter:

=SUBTOTAL(9,OFFSET(A1#,0,0,SEQUENCE(COUNT(A1#))))

A simple example. If A1 contained the dynamic:

=SEQUENCE(10,,1,1)

enter image description here

like image 157
Gary's Student Avatar answered Apr 19 '23 21:04

Gary's Student