Every Excel power user has one. That function that does not quite exist: the one you have been rebuilding from IFERROR(INDEX(MATCH(... for years, or the one that calls an internal API, or the one that knows about your business logic in a way no built-in ever will.
Custom functions exist for that very reason. But how do you create one?
Option one: VBA
Quick to write, broadly understood, works. Also: single-threaded, not distributable without macros enabled, and carries enough security baggage that many organisations block it outright. Fine for personal use, not great for anything shared.
Option two: Python, Office.js, or Excel-DNA
The modern alternatives. Python in Excel, Office.js (JavaScript), and Excel-DNA (.NET) are all more accessible than the C SDK and more distributable than VBA. Each comes with trade-offs around performance, platform support, and distribution.
Option three: an XLL
An XLL is a native Windows DLL that plugs directly into Excel’s calculation engine. Functions registered via an XLL appear exactly like built-in functions. They recalculate correctly, they participate in multi-threaded recalc, they are fast.
The catch: you had to write it in C or C++, using an SDK that has barely changed since Excel 4, with manual memory management and almost no documentation that was not either ancient or paywalled. Microsoft themselves describe the investment required as making XLLs “impractical for most users.”
For most teams, that meant the function never got built. Or it got built in Python or Office.js, with a performance trade-off that made large workbooks painful.
Now: describe it, build it, use it
xllify Assistant is an AI code assistant that knows the xllify API. You describe the function you want in plain English, it generates the code, explains how it works, and you press a button to download the XLL. No code to write.
Take this description: “function to calc days remaining on a contract, accounting for bank holidays, parameters end_date and holidays a matrix of holidays.” That produces a complete, working implementation in seconds. Try it out in your browser, press Build, get an XLL.
xllify.ExcelFunction({
name = "ContractDaysRemaining",
description = "Business days remaining from today to contract end date, excluding weekends and holidays",
parameters = {
{ name = "end_date", type = "number", description = "Contract end date" },
{ name = "holidays", type = "number", dimensionality = "matrix", description = "Holiday dates" }
}
}, function(end_date, holidays)
local today = xllify.today()
local holiday_set = {}
for _, row in ipairs(holidays) do
holiday_set[row[1]] = true
end
local count = 0
local d = today + 1
while d <= end_date do
local dow = xllify.weekday(d)
if dow ~= 1 and dow ~= 7 and not holiday_set[d] then
count = count + 1
end
d = d + 1
end
return count
end)
That function is now available in Excel as =ContractDaysRemaining(B2, E2:E20). It behaves like a built-in. It recalculates when it should. It is fast, will run over multiple cores, and tidy up your workbooks.
The function you have always wished existed in Excel now does.