Skip to content

Instantly share code, notes, and snippets.

View patogeno's full-sized avatar

Patricio Soto Kort patogeno

View GitHub Profile
/*
It converts an amount of a period from a frequency to another.
Usually used to calculate periodic billing.
Inputs:
- from_freq [string with input amount frequency]
- to_freq [string of frequency to convert to]
- amount [input amount for the given frequency]
Supported frequencies:
@patogeno
patogeno / excel_lambdas_lookups.txt
Last active April 10, 2022 08:15
Look Up functions
/*
It searches for a value inside an array and ouputs a list with all the rows that include it.
Inputs:
- lookup_value [text]
- lookup_array [array where the lookup value is searched]
- value_array [array of values to return]
*/
MULTILOOKUPINCLUDE = LAMBDA(
lookup_value,
/*
It gets the last entry of a month.
If two entries have the same datetime, it will pick the first one.
Inputs:
- entries [array]
- entry_dates [array] (same length of entries array)
- month [date]
*/
GETLASTOFMONTH = LAMBDA(entries, entry_dates, month,