Last active
August 7, 2024 18:09
-
-
Save ExcelRobot/c63eede7ce43538da78eb523daaaca5f to your computer and use it in GitHub Desktop.
TILE Lambda
This file contains hidden or 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
| /* | |
| Name: Tile (TILE) | |
| Description: Tile the outputs of a single-parameter function given an array map of parameters. | |
| Parameters: | |
| params - array of parameters arranged how function results to be tiled | |
| function - single-parameter Lambda name or function | |
| Source: Excel Robot (@ExcelRobot), but inspired by Owen Price's STACKER lambda (https://www.youtube.com/watch?v=wEBLT9QfQRw). | |
| */ | |
| TILE = LAMBDA(params,function,LET( | |
| firstrow, function(INDEX(params,1,1)), | |
| stacker, LAMBDA(stack,param,VSTACK(stack,function(param))), | |
| firstcol, IF(ROWS(params)=1,firstrow,REDUCE(firstrow,DROP(TAKE(params,,1),1),stacker)), | |
| IF(COLUMNS(params)=1,firstcol,HSTACK(firstcol,TILE(DROP(params,,1),function))) | |
| )); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
