Lists
Lists are ordered collections of items that can store values of any type, including other XlBlocks objects. They provide functionality for adding, removing, and accessing elements by their position. They can be merged with other lists, sorted, and filtered for unique or duplicate values. Lists are represented in Excel using object handles, enabling seamless integration with other XlBlocks objects.
List Functions
XBList_Build
Build a list
=XBList_Build(range, [onErrors])
Parameter | Type | Description |
---|---|---|
range | XlBlockRange |
A range of data to include in the list |
onErrors | String |
Optional Error handling ('drop', 'keep', or 'error') |
Returns
A list
XBList_BuildTyped
Build a list of a given type
=XBList_BuildTyped(items, type, [onErrors])
Parameter | Type | Description |
---|---|---|
items | XlBlockRange |
A range of data to include in the list |
type | String |
The data type of the list |
onErrors | String |
Optional Error handling ('drop', 'keep', or 'error') |
Returns
A list
XBList_BuildFromString
Build a list from a string
=XBList_BuildFromString(str, delimiter, [trimStrings], [ignoreEmpty])
Parameter | Type | Description |
---|---|---|
str | String |
A string |
delimiter | String |
A delimiter |
trimStrings | Boolean |
Optional Trim strings |
ignoreEmpty | Boolean |
Optional Ignore empty strings |
Returns
A list
XBList_BuildFromFile
Build a list from the contents of a file
=XBList_BuildFromFile(filepath, delimiter, [trimStrings], [ignoreEmpty])
Parameter | Type | Description |
---|---|---|
filepath | String |
A filepath |
delimiter | String |
A delimiter |
trimStrings | Boolean |
Optional Trim strings |
ignoreEmpty | Boolean |
Optional Ignore empty strings |
Returns
A list
XBList_ToString
Concatenate the items of a list into a string
=XBList_ToString(list, [separator])
Parameter | Type | Description |
---|---|---|
list | XlBlockList |
A list |
separator | String |
Optional A string to use as the separator between the joined items |
Returns
A string
XBList_Get
Get the contents of a list as a range
=XBList_Get(list)
Parameter | Type | Description |
---|---|---|
list | XlBlockList |
A list |
Returns
A list
XBList_GetAt
Get an element of a list
=XBList_GetAt(list, index)
Parameter | Type | Description |
---|---|---|
list | XlBlockList |
A list |
index | Int32 |
A 1-based index of the list element to return |
Returns
An object
XBList_Count
Get the size of a list
=XBList_Count(list)
Parameter | Type | Description |
---|---|---|
list | XlBlockList |
A list |
Returns
An integer
XBList_Dim
Get the size of a list as a string
=XBList_Dim(list)
Parameter | Type | Description |
---|---|---|
list | XlBlockList |
A list |
Returns
A string
XBList_Add
Add an item to a list
=XBList_Add(list, items, [onErrors])
Parameter | Type | Description |
---|---|---|
list | XlBlockList |
A list |
items | XlBlockRange |
One or more items to be removed |
onErrors | String |
Optional Error handling ('drop', 'keep', or 'error') |
Returns
A list
XBList_Remove
Remove an item from a list
=XBList_Remove(list, items)
Parameter | Type | Description |
---|---|---|
list | XlBlockList |
A list |
items | XlBlockRange |
One or more items to be removed |
Returns
A list
XBList_Sort
Sort a list
=XBList_Sort(list, [descending])
Parameter | Type | Description |
---|---|---|
list | XlBlockList |
A list |
descending | Boolean |
Optional Descending sort |
Returns
A list
XBList_Take
Take the first N items of a list
=XBList_Take(list, n)
Parameter | Type | Description |
---|---|---|
list | XlBlockList |
A list |
n | Int32 |
The number of items to take |
Returns
A list
XBList_Skip
Skip the first N items of a list
=XBList_Skip(list, n)
Parameter | Type | Description |
---|---|---|
list | XlBlockList |
A list |
n | Int32 |
The number of items to skip |
Returns
A list
XBList_UniqueItems
Get a list of the unique items in a list
=XBList_UniqueItems(list)
Parameter | Type | Description |
---|---|---|
list | XlBlockList |
A list |
Returns
A list
XBList_DuplicateItems
Get a list of duplicated items in a list
=XBList_DuplicateItems(list)
Parameter | Type | Description |
---|---|---|
list | XlBlockList |
A list |
Returns
A list
XBList_Reverse
Reverse the order of the contents of a list
=XBList_Reverse(list)
Parameter | Type | Description |
---|---|---|
list | XlBlockList |
A list |
Returns
A list
XBList_UnifyLists
Combine multiple lists into one, retaining duplicate values
=XBList_UnifyLists(list)
Parameter | Type | Description |
---|---|---|
list | Any |
A list |
Returns
A list
XBList_MergeLists
Merge multiple lists into one, dropping duplicate values
=XBList_MergeLists(list)
Parameter | Type | Description |
---|---|---|
list | Any |
A list |
Returns
A list
XBList_IntersectLists
Make a list containing the intersection (shared items) of input lists
=XBList_IntersectLists(list)
Parameter | Type | Description |
---|---|---|
list | Any |
A list |
Returns
A list