Skip to content

Instantly share code, notes, and snippets.

View ExcelRobot's full-sized avatar

Excel Robot ExcelRobot

View GitHub Profile
@ExcelRobot
ExcelRobot / HarveyBalls.lambda
Last active June 26, 2023 13:37
Harvey Balls Lambda
=LAMBDA(percent,[color],LET(
baseurl,"",
IMAGE(baseurl&IF(ISOMITTED(color),"Black",color)&TEXT(percent,"0")&".png")
))
@ExcelRobot
ExcelRobot / multi-level data validation.lambda
Last active July 22, 2024 21:04
Multi-Level Data Validation LAMBDAS
/*
Name: Multi-Level Dropdown Validation (MultiLevelDropdownValidation)
Description: Returns the list of allowable values for a specific cell based on
the entries to the left.
Parameters:
tablename - name of the Excel table containing the data validation dropdowns.
header - table header cells from the first column with data validation to the column for which
to return list of values allowed.
keylisttable - reference to dynamic range containing the MultiLevelKeyLists lambda key lists table.
Source: Written by Excel Robot, inspired by Wyn Hopkins (https://www.youtube.com/watch?v=r0DTFodQYJQ&t=989s)
@ExcelRobot
ExcelRobot / TILE.lambda
Last active August 7, 2024 18:09
TILE Lambda
/*
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)),
@ExcelRobot
ExcelRobot / mandelbrot.lambda
Last active March 11, 2025 15:54
Mandelbrot Lambda
/*
Name: Mandelbrot Set (Mandelbrot)
Description: Generates a Mandelbrot set based on given assumptions that can be used with conditional formatting to view the visual representation.
Parameters:
xleft - Left X value
xright - Right X value
ytop - Top Y value
ybottom - Bottom Y value
size - number of columns/rows in square output range
iterations - number of iterations
@ExcelRobot
ExcelRobot / CROSSJOIN.lambda
Last active February 24, 2025 15:26
Cross Join LAMBDA Function
/*
Name: Cross Join Two Arrays or Tables (CROSSJOIN)
Description: Returns all possible combinations of two arrays of data, with or without header rows.
If the arrays have only one row, it will be assumed that they are row vectors, otherwise it
assumes the arrays are columns of data.
Parameters:
array1 - first array of data with one or more columns
array2 - second array of data with one or more columns
[has_header_row] - true if the first row of the arrays contain a header row, default: false
Source: Excel Robot (@ExcelRobot)
@ExcelRobot
ExcelRobot / IndexWrap.lambda
Last active October 6, 2022 19:28
Index Wrap LAMBDA Function
/*
Name: Index Wrap (IndexWrap)
Description: Similar to INDEX but if the position is too high, it'll wrap around.
Parameters:
array - Required. A range of cells or an array constant.
index - Required. The row (or column) position to return from array. If the position is greater than the number of rows (or columns), it wraps around.
[by_column] - Optional. True for columns, false for rows. Default: False.
Source: Excel Robot (@ExcelRobot)
Gist URL: https://gist.github.com/ExcelRobot/926df8b9889b39dc92549495a3144860
Dependencies:
@ExcelRobot
ExcelRobot / UNPIVOT.lambda
Last active July 11, 2025 08:24
Unpivot Table LAMBDA Function
/*
Name: Unpivot Table (UNPIVOT)
Description: Given a table range with headers and array of header names, unpivots the
specified columns in place, optionally removing any blank entries.
Written By: Excel Robot (@ExcelRobot)
Category: Array
*/
UNPIVOT=LAMBDA(table,[columns_to_unpivot],[attribute_name],[value_name],[remove_blanks], LET(
_ColumnsToUnpivot, IF(
ISOMITTED(columns_to_unpivot),
@ExcelRobot
ExcelRobot / ADDTH.lambda
Last active December 21, 2023 14:59
Convert number to ordinal LAMBDA Function
/*
Name: Convert Number To Ordinal (ADDTH)
Description: Converts number to ordinal ie: 1st, 2nd, 3rd, 4th, 11th, 12th, 13th, 21st, etc.
Author: Excel Robot (@ExcelRobot)
Inspired By: Rick de Groot (https://www.linkedin.com/posts/rickmaurinus_powerbi-businessintelligence-dax-activity-6920723485937790976-Wzdb?utm_source=linkedin_share&utm_medium=member_desktop_web)
Category: Conversion
*/
ADDTH = LAMBDA(number,LET(
LastDigit, RIGHT(number),
LastTwo, RIGHT(number, 2),
@ExcelRobot
ExcelRobot / HUMANIZESECONDS.lambda
Last active November 25, 2024 05:28
Humanize Seconds LAMBDA Function
/*
These lambdas were inspired by the work of Mike Wolfe's article "Displaying Human
Readable Time Spans" (https://nolongerset.com/displaying-time-spans/). He provided
the logic and I enjoyed the puzzle of converting that logic to dynamic arrays.
Included within:
* HUMANIZESECONDS - Converts seconds to human readable text
* PLURALIZE - Adapts wording based on whether number is singular/plural and
positive/negative.
* CONVERTTOSECONDS - Converts units of years, weeks, days, hours, minutes, and
@ExcelRobot
ExcelRobot / CHOOSETABLECOLUMNS.lambda
Last active May 14, 2024 01:37
Choose Table Columns LAMBDA Function
/*
Name: Choose Table Columns (CHOOSETABLECOLUMNS)
Description: Similar to CHOOSECOLUMNS but can accept an array of column header names or
array of column indexes. If column headers are used, assumes first row of Table is
header row.
Author: Excel Robot (@ExcelRobot)
Category: Table
*/
CHOOSETABLECOLUMNS = LAMBDA(Table, ColumnsToSelect, LET(
FirstColumnToSelect, INDEX(ColumnsToSelect,1,1),