Forum Discussion
ajl_ahmed
Jul 09, 2022Iron Contributor
Combine four columns (multiple columns) vertically into one column
I have four columns with variable heights (I do not know How height), so I need a formula to dynamically discover the height of each column and combine the contents of each column vertically in a new...
- Jul 09, 2022
It depends on which exactly version of Excel 365 you are, as variant
=LET( columnA,FILTER(A:A,A:A<>""), columnB,FILTER(B:B,B:B<>""), columnC,FILTER(C:C,C:C<>""), columnD,FILTER(D:D,D:D<>""), nA,ROWS(columnA), nB,ROWS(columnB), nC,ROWS(columnC), nD,ROWS(columnD), k,SEQUENCE(nA+nB+nC+nD), IF(k<=nA,INDEX(columnA,k), IF(k<=nA+nB,INDEX(columnB,k-nA), IF(k<=nA+nB+nC,INDEX(columnC,k-nA-nB), IF(k<=nA+nB+nC+nD,INDEX(columnD,k-nA-nB-nC), )))) )
SergeiBaklan
Jul 09, 2022Diamond Contributor
One assumption we are on Beta. But here is another assumptions we are working with structured tables, not ranges,
PeterBartholomew1
Jul 10, 2022Silver Contributor
Very true. I do not think structured references should be a problem, after all that has been possible since Office 2007 and I think List Objects were available in some form even before that. Requiring insider beta does make the proposed solutions inaccessible to almost all however.
As for traditional spreadsheet methods, I have discarded them; I didn't like them at the time and I am even less inclined to use them now. I would have posted a VStackλ function but I think one of your posts pretty much did that.