Supported Formula Functions
DroidXLS includes a built-in formula engine with ~30 functions. Unsupported formulas are preserved as-is and return #NAME?.
Usage
sheet["C1"].formula = "=SUM(A1:B1)"
val evaluator = FormulaEvaluator(sheet)
evaluator.recalculateAll()
Aggregate Functions
| Function | Description | Example |
SUM | Sum of values | =SUM(A1:A10) |
AVERAGE | Arithmetic mean | =AVERAGE(B1:B5) |
COUNT | Count numeric cells | =COUNT(A:A) |
COUNTA | Count non-empty cells | =COUNTA(A1:A10) |
COUNTBLANK | Count empty cells | =COUNTBLANK(A1:A10) |
MAX | Maximum value | =MAX(A1:A10) |
MIN | Minimum value | =MIN(A1:A10) |
Logic Functions
| Function | Description | Example |
IF | Conditional | =IF(A1>10,"big","small") |
AND | Logical AND | =AND(A1>0,B1>0) |
OR | Logical OR | =OR(A1>0,B1>0) |
NOT | Logical NOT | =NOT(A1) |
IFERROR | Error handler | =IFERROR(A1/B1,0) |
IFNA | Handle #N/A | =IFNA(VLOOKUP(...),"") |
Lookup Functions
| Function | Description | Example |
VLOOKUP | Vertical lookup | =VLOOKUP(A1,D:E,2,FALSE) |
HLOOKUP | Horizontal lookup | =HLOOKUP(A1,1:2,2,FALSE) |
INDEX | Value at position | =INDEX(A1:C3,2,3) |
MATCH | Position of value | =MATCH("x",A1:A10,0) |
String Functions
| Function | Description | Example |
CONCATENATE | Join strings | =CONCATENATE(A1," ",B1) |
LEFT | Left substring | =LEFT(A1,3) |
RIGHT | Right substring | =RIGHT(A1,3) |
MID | Middle substring | =MID(A1,2,3) |
LEN | String length | =LEN(A1) |
TRIM | Remove extra spaces | =TRIM(A1) |
SUBSTITUTE | Replace text | =SUBSTITUTE(A1,"old","new") |
UPPER | To uppercase | =UPPER(A1) |
LOWER | To lowercase | =LOWER(A1) |
Math Functions
| Function | Description | Example |
ROUND | Round to digits | =ROUND(3.14159,2) |
ROUNDUP | Round up | =ROUNDUP(3.1,0) |
ROUNDDOWN | Round down | =ROUNDDOWN(3.9,0) |
ABS | Absolute value | =ABS(-5) |
MOD | Modulo | =MOD(10,3) |
INT | Integer part | =INT(3.7) |
CEILING | Round up to multiple | =CEILING(2.3,1) |
FLOOR | Round down to multiple | =FLOOR(2.7,1) |
Date Functions
| Function | Description | Example |
TODAY | Current date | =TODAY() |
NOW | Current date and time | =NOW() |
DATE | Create date | =DATE(2025,3,25) |
YEAR | Extract year | =YEAR(A1) |
MONTH | Extract month | =MONTH(A1) |
DAY | Extract day | =DAY(A1) |