Skip to content

Instantly share code, notes, and snippets.

@matthews-p
matthews-p / GetDistanceMiles.txt
Created November 27, 2024 17:58
GetDistanceMiles
/** GetDistanceMiles */
/*
FUNCTION NAME: GetDistanceMiles
DESCRIPTION: Returns the distance in miles between points X and Y based on their
decimal latitude and longitude coordinates
ARGS:
LatX: Point X's decimal latitude
LngX: Point X's decimal longitude
LatY: Point Y's decimal latitude
LngY: Point Y's decimal longitude
@matthews-p
matthews-p / ConcatRows.txt
Created November 27, 2024 17:59
ConcatRows
/** ConcatRows */
/*
FUNCTION NAME: ConcatRows
DESCRIPTION: For a rectangular array (including table refs), returns
a dynamic array 1 column wide and n rows tall, concatenating the
values from each row
ARGS:
rng: The source range to be concatenated
delim: The delimiter to be used
skipblanks: In each row's concatenation, TRUE skips blank
@matthews-p
matthews-p / ConcatRowsFormat.txt
Created November 27, 2024 18:00
ConcatRowsFormat
/** ConcatRowsFormat */
/*
FUNCTION NAME: ConcatRowsFormat
DESCRIPTION: For a rectangular array (including table refs), returns
a dynamic array 1 column wide and n rows tall, concatenating the
values from each row and applying the specified number formats
to the values from each column
ARGS:
rng: The source range to be concatenated
format: 1-row by n-column array of number formats to apply
@matthews-p
matthews-p / DistinctList.txt
Last active November 29, 2024 19:42
DistinctList
/** DistinctList */
/*
FUNCTION NAME: DistinctList
DESCRIPTION: Given a n-row by 1-column range of concatenated text,
returns a n-row by 1-column array of the unique values. Not
sorted (use DistinctListSort to get sorted list)
ARGS:
rng: Range holding original values
delim: Delimiter used to split the concatenated strings
col: Column index you want returned (1st column = 1)
@matthews-p
matthews-p / DistinctListSort.txt
Created November 27, 2024 18:07
DistinctListSort
/** DistinctListSort */
/*
FUNCTION NAME: DistinctListSort
DESCRIPTION: Given a n-row by 1-column range of concatenated text,
returns a n-row by 1-column array of the unique values. Return
array is sorted
ARGS:
rng: Range holding original values
delim: Delimiter used to split the concatenated strings
col: Column index you want returned (1st column = 1)
@matthews-p
matthews-p / SplitConcatList.txt
Created December 18, 2024 14:55
SplitConcatList
/** SplitConcatList */
/*
FUNCTION NAME: SplitConcatList
DESCRIPTION: Take a 1-column range of concatenated values and returns a
x rows by y columns array of split values, splitting the values in
each row by the specified delimiter. Assumes that the number of
columns in the first row of the rng argument is the total number of
columns throughout
ARGS:
rng: a 1-column wide range with the concatenated values