AUNSTACK

=AUNSTACK(a,h)

a
array
h
unstack height

AUNSTACK unstacks an array.

Xlambda

Well-known Member
Joined
Mar 8, 2021
Messages
860
Office Version
  1. 365
Platform
  1. Windows
AUNSTACK unstack an array, calls AFLATTEN
Excel Formula:
=LAMBDA(a,h,
    LET(k,ABS(h),
       r,ROWS(a),
       c,COLUMNS(a),
       mo,MOD(r,k),
       nr,IF(mo,r+k-mo,r),
       sr,SEQUENCE(nr),
       na,IFERROR(INDEX(a,sr,SEQUENCE(,c)),""),
       nc,c*nr/k,
       snc,SEQUENCE(,nc),
       q,QUOTIENT(snc-1,c)+1,
      m,MOD(snc-1,c)+1,x,(q-1)*k*c+m+(SEQUENCE(k)-1)*c,
       f,AFLATTEN(na),
       rs,XLOOKUP(x,SEQUENCE(nr*c),f),
       IF(k>=r,a,rs)
    )
)
LAMBDA 5.0.xlsx
ABCDEFGHIJKLMNOPQRS
1123rows18
2456clm.3
3789unstack
41011126123192021373839
5131415456222324404142
6161718789252627434445
7192021101112282930464748
8222324131415313233495051
9252627161718343536525354
10282930
11313233
123435365123161718313233464748
13373839456192021343536495051
14404142789222324373839525354
15434445101112252627404142
16464748131415282930434445
17495051
18525354
19123222324434445
20456252627464748
21789282930495051
22101112313233525354
23131415343536
24161718373839
25192021404142
26
AUNSTACK post
Cell Formulas
RangeFormula
A1:C18A1=SEQUENCE(G1,G2)
G4:O9G4=AUNSTACK(A1#,F4)
G12:R16G12=AUNSTACK(A1#,F12)
G19:O25G19=AUNSTACK(A1#,7)
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,223,575
Messages
6,173,148
Members
452,502
Latest member
PQCurious

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top