Question Details

No question body available.

Tags

arrays excel excel-formula

Answers (1)

Accepted Answer Available
Accepted Answer
July 4, 2025 Score: 3 Rep: 5,667 Quality: High Completeness: 80%

"I was wondering if there is a way in Excel to have an array function that, for some cells in the array, references the values in other cells within the array" - can be only possible with the REDUCE function in combination with the VSTACK or HSTACK function.

The formula for Pascal's triangle is:

=LET(N,5,REDUCE(SEQUENCE(,N,1,0),SEQUENCE(N-1), LAMBDA(y,z,VSTACK(y,SCAN(0,TAKE(y,-1),LAMBDA(a,x,a+x))))))

The y accumulator provides you with access to elements already calculated how it's used in TAKE(y,-1).

Another formula for Pascal's triangle which uses the recursive lambda is:

=LET(lam,LAMBDA(i,v,fn, IF(i=0,v,fn(i-1,VSTACK(v,SCAN(0,TAKE(v,-1),LAMBDA(a,x,a+x))),fn))), lam(4,SEQUENCE(,5,1,0),lam))

The 'lam(n,x,fn)' function builds the square of size 'n+1' using the start vector x and the fn function as itself.

The next formula is (as far as I can understand):

[E8]=LET(hiddenformula,A8:A17,numingredients,ROWS(hiddenformula),gaplength,1, visibleformula,hiddenformula&C8:C17, MAKEARRAY(numingredients * 2 + gaplength,1, LAMBDA(r,c,IF(r