Created
February 15, 2022 16:53
-
-
Save jimpea/796356bb01e54174de8ec9a006c46b2b to your computer and use it in GitHub Desktop.
SExcel Lambda function to stack two arrays horizontally
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//from <https://exceljet.net/formula/lambda-append-range> | |
//stack arrays horizontally | |
APPENDRANGEH = LAMBDA(range1, range2, default, | |
LET( | |
rows1, ROWS(range1), | |
rows2, ROWS(range2), | |
cols1, COLUMNS(range1), | |
cols2, COLUMNS(range2), | |
rowindex, SEQUENCE(MAX(rows1, rows2)), | |
colindex, SEQUENCE(1, cols1 + cols2), | |
result, IF( | |
colindex <= cols1, | |
INDEX(range1, rowindex, colindex), | |
INDEX(range2, rowindex, colindex - cols1) | |
), | |
IFERROR(result, default) | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment