Skip to content

Instantly share code, notes, and snippets.

View ExcelRobot's full-sized avatar

Excel Robot ExcelRobot

View GitHub Profile
@pbartxl
pbartxl / MAPλ.txt
Last active March 27, 2025 22:21
A version of Excel MAP helper function that will return an array of arrays
/* FUNCTION NAME: MAPλ
DESCRIPTION: Implements a version of MAP that will return an array of arrays */
/* REVISIONS: Date Developer Description
28 Aug 2024 Peter Bartholomew Adapted from BYROWλ to give MAPλ
31 Aug 2024 Peter Bartholomew JOINPAIRSλ modified to stack 2D result arrays
10 Sep 2024 Peter Bartholomew Modified to accept 3 array argumments before λ-function
15 Nov 2024 David Clements Improved branching using CHOOSE
*/
MAPλ = LAMBDA(
// Parameter Declarations
@CHatmaker
CHatmaker / BXL LAMBDA Reporting with Arrays
Last active January 10, 2025 04:30
5G functions for Excel for Reporting with Arrays
/* FUNCTION NAME: Aboutλ
DESCRIPTION:*//**Displays the URL to this module's Gist which includes documentation*/
/* REVISIONS: Date Developer Description
Mar 17 2023 Craig Hatmaker Copyright
Apr 17 2023 Craig Hatmaker Reorganizing and adding help
Jul 03 2023 Craig Hatmaker See nFoldCartProdλ and PriorDimProdλ
Jul 11 2023 Craig Hatmaker See UnPivotDetailλ
Feb 11 2024 Craig Hatmaker See UnPivotDetailλ
*/
@CHatmaker
CHatmaker / BXL 5g Functions LAMBDA for Excel Dynamic Ranges
Last active February 4, 2025 11:22
BXL 5g Functions LAMBDA for Excel for Dynamic Ranges
/* FUNCTION NAME: Aboutλ
DESCRIPTION:*//**Displays the URL to this module's Gist which includes documentation*/
/* REVISIONS: Date Developer Description
Mar 02 2023 Craig Hatmaker Original Development
Jun 08 2023 Craig Hatmaker CBSE Compliant
Jan 17 2024 Craig Hatmaker See DynamicArrayλ
*/
Aboutλ =TEXTSPLIT(
"About: →BXL's Dynamic Array module. Suggested module name: BDR¶" &
@CHatmaker
CHatmaker / BXL Excel LAMBDA Math
Last active January 27, 2024 15:47
5G functions for Excel: Miscellaneous Math
/* Function Description
Aboutλ About this module and links to online resources
Fibonacciλ Determine the nth number in a Fibonacci sequence
*/
/* FUNCTION NAME: Aboutλ
DESCRIPTION:*/ /**Displays the URL to this module's Gist which includes documentation*/
@halbuki
halbuki / EXLIST
Last active September 7, 2022 08:03
Excel Lambda functions for Power Query List functions
/* USE NAMESPACE "List" */
Accumulate = LAMBDA(_list, _seed, _accumulator, REDUCE(_seed, _list, _accumulator));
AllTrue = LAMBDA(_list, AND(_list));
AnyTrue = LAMBDA(_list, OR(_list));
Average = LAMBDA(_list, AVERAGE(_list));
@halbuki
halbuki / EXNAL
Last active September 1, 2022 14:41
Excel Lambda functions for numerical analyses
/* ROOTS OF FUNCTIONS */
BISEC = LAMBDA(f, lbound, ubound, [prec],
LET(
c, (lbound + ubound) / 2,
fl, f(lbound), fu, f(ubound), fc, f(c),
IF(
ABS(fc) < MAX(prec, 1E-15),
c,
IF(
SIGN(fl) = SIGN(fc),
@CHatmaker
CHatmaker / BXL 5g Functions LAMBDA for Excel Dates.txt
Last active March 11, 2025 16:52
BXL 5g Functions LAMBDA for Excel Dates
/* Module Contains 5g Compliant functions that deal with dates */
/* FUNCTION NAME: Aboutλ
DESCRIPTION:*//**Displays the URL to this module's Gist which includes documentation*/
/* REVISIONS: Date Developer Description
Mar 17 2023 Craig Hatmaker Original Development
Mar 22 2023 Craig Hatmaker Added About
Apr 06 2023 Craig Hatmaker Added Help to LAMBDAs
Aug 28 2023 Craig Hatmaker Conformed to new template
Jan 02 2024 Craig Hatmaker See CountDOWλ
@CHatmaker
CHatmaker / BXL 5g Functions LAMBDA for Excel CrtIdxλ
Last active February 4, 2025 11:23
BXL 5g Functions LAMBDA for Excel: CrtIdxλ
/* FUNCTION NAME: CrtIdxλ
DESCRIPTION:*/ /**Creates an array of indexes that can be used with INDEX() can combine
all rows in all tables as would a database 'Natrual Join' or 'Cross Join.'*/
/* This was developed for multidimensional modeling. A key to multidimensional modeling
is the ability to combine all instances of all dimensions, and then access each
dimension's value. A dimension is a category of things like:
Customers, Products, Regions, Months, etc.
When faced with the situation where each dimension has a piece of information needed
for a particular calculation such as:
@ncalm
ncalm / excel-lambda-OUTLIERS.txt
Created April 23, 2022 13:35
This collection of Excel lambda functions provides functionality to quickly apply the standard deviation test on a series of transformations to a continuous variable
/*
OUTLIERS
These lambda functions allow us to quickly apply the standard deviation test to a series of transformed variables
Included in this file:
OUTLIER.THRESHOLDS - for calculating outlier thresholds using a standard deviation test
inputs:
@ncalm
ncalm / excel-lambda-ISLEAPYEAR.txt
Last active June 15, 2023 09:42
This Excel lambda function returns TRUE for a leap year and FALSE for all other years
/*
ISLEAPYEAR
Calculates whether a year is a leap year
Inputs:
- yr is the year you want to test
Returns:
TRUE if the year is a leap year, FALSE otherwise