Skip to content

Instantly share code, notes, and snippets.

View BirminghamAnalytics's full-sized avatar

BirminghamAnalytics

  • Joined Oct 13, 2025
View GitHub Profile
/*
Name: Distribute
Description: Distribute a total amount across periods between two dates date. Select linear or S-Curve distribution.
Requies uniform period timeline.
Set SCURVE=TRUE for SCURVE or FALSE for Linear
*/
DISTRIBUTE=LAMBDA(StartDateTimeline,EndDateTimeline,StartDate,EndDate,Amount,SCURVE,LET(
StartPeriod, XMATCH(StartDate, StartDateTimeline, -1, 1),
EndPeriod, XMATCH(EndDate, EndDateTimeline, -1, 1),
PeriodNos, SEQUENCE(, COLUMNS(StartDateTimeline)),