Luau Examples

This page demonstrates some simple functions. It also introduces xllify's async Luau support.

Some of the examples are contrived and already implemented by Excel, so see them merely as illustrations.

Basic maths

example.luau
xllify.ExcelFunction({
    name = "ADD",
    category = "Math"
}, function(x, y)
    return x + y
end)

xllify.ExcelFunction({
    name = "MULTIPLY",
    category = "Math"
}, function(x, y)
    return x * y
end)

String operations

Working with ranges

Usage: =SUMRANGE(A1:C10)

Date functions

Async example

circle-info

Luau functions when marked as async do not block the thread they're running on. They run within a pool of worker threads. async.* functions automatically yield their thread and resume when the operation completes.

Multiple scripts

Build:

All functions will be available in Excel.

Combining Luau and Python

You can mix Luau and Python in one XLL for the best of both worlds.

Build:

Load HybridAddin.xll into Excel:

Last updated