Stack Dynamic Columns into One

noctash

New Member
Joined
Aug 4, 2022
Messages
16
Office Version
  1. 365
Platform
  1. Windows
I am using this formula to stack columns:

Excel Formula:
=INDEX(DATA,1+INT((ROW(A1)-1)/COLUMNS(DATA)),MOD(ROW(A1)-1+COLUMNS(DATA),COLUMNS(DATA))+1)

'DATA' is a dynamic array referring to all data in the first 3 columns

Excel Formula:
=OFFSET('Sheet1'!$A$2,0,0,COUNTA'Sheet1'!$A:$A)-1,3)

The problem I am facing is that the first code requires me to drag down the cell until I hit an error to fill in all of my data. Is there a way I can automatically continue the formula until it hits an error, such that if more data is entered in the multiple columns, the single column will automatically adjust it's length? I have tried replacing A1 with A:A but it ends up returning the first value in 'DATA' indefinitely.

I am trying to avoid VBA for the same reason, I want to be able to copy/paste new values into 'DATA' and have the single column automatically adjust.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Hi & welcome to MrExcel.
How about
Excel Formula:
=LET(Data,FILTER(A2:C10000,A2:A10000<>""),r,ROWS(Data),s,SEQUENCE(r*COLUMNS(Data),,0),INDEX(Data,MOD(s,r)+1,INT(s/r)+1))
No need for the named range
 
Upvote 0
Solution
Hi & welcome to MrExcel.
How about
Excel Formula:
=LET(Data,FILTER(A2:C10000,A2:A10000<>""),r,ROWS(Data),s,SEQUENCE(r*COLUMNS(Data),,0),INDEX(Data,MOD(s,r)+1,INT(s/r)+1))
No need for the named range
This worked great! Thank you so much for your help and so quickly!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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