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
| // CROSSJOIN: Given two tables, returns the Cartesian product of rows from the tables. | |
| // Accepts 2 x 2-d range; 3rd parameter can skip headers if true (which is default) | |
| // Example of use: | |
| // =CROSSJOIN( | |
| // CROSSJOIN( | |
| // TrimToData(Q$2:Q$1000), | |
| // TrimToData(U$2:U$1000), | |
| // FALSE | |
| // ), | |
| // TrimToData(T$2:T$1000), |
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
| // lastDataRowOf1stCol: a utility function to find out in which row data ends | |
| // Accepts a column or a 2-d range; for the latter, considers the first column only. | |
| // Robustly considers any data type, handles blanks in the range. If no data, returns 0. | |
| // Example of use: | |
| // =lastDataRowOf1stCol(A:A) | |
| // =lastDataRowof1stCol(B4:C9) | |
| lastDataRowOf1stCol = LAMBDA(range, | |
| LET( | |
| firstCol, TAKE(range, , 1), |
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
| // based on this Microsoft Tech Community article by Kevin Dean: | |
| // https://techcommunity.microsoft.com/t5/excel/timing-function-execution-using-lambda/m-p/3920420 | |
| // Measures the evaluation time of a lambda function call passed as argument. | |
| // To use with builtin functions, or with your own user-defined functions, wrap them in a LAMBDA(). | |
| // =EvaluationTime(LAMBDA(<yourFunction>(<yourArguments>)) | |
| EvaluationTime=LAMBDA(F, | |
| LET( | |
| startTime, NOW(), | |
| result, F(), |
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
| // FNV1a: a 32-bit hash function | |
| // Accepts any input: string, number or bool. Returns 8 hex characters, or 0 if input is empty. | |
| // example of use: | |
| // =FNV1a("Hello world") | |
| // -> yields "594D29C7" | |
| // =FNV1a(42) | |
| // -> yields "87E38583" | |
| // | |
| // based on this SuperUser answer by Jason Kleban: | |
| // https://superuser.com/a/1720348/7659 |