#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub(crate) struct Function {
pub(crate) name: &'static str,
pub(crate) fixed_arity: Option<usize>,
}
pub(crate) const FUNCTIONS: [Option<Function>; 485] = [
Some(Function {
name: "COUNT",
fixed_arity: None,
}), Some(Function {
name: "IF",
fixed_arity: None,
}), Some(Function {
name: "ISNA",
fixed_arity: Some(1),
}), Some(Function {
name: "ISERROR",
fixed_arity: Some(1),
}), Some(Function {
name: "SUM",
fixed_arity: None,
}), Some(Function {
name: "AVERAGE",
fixed_arity: None,
}), Some(Function {
name: "MIN",
fixed_arity: None,
}), Some(Function {
name: "MAX",
fixed_arity: None,
}), Some(Function {
name: "ROW",
fixed_arity: None,
}), Some(Function {
name: "COLUMN",
fixed_arity: None,
}), Some(Function {
name: "NA",
fixed_arity: Some(0),
}), Some(Function {
name: "NPV",
fixed_arity: None,
}), Some(Function {
name: "STDEV",
fixed_arity: None,
}), Some(Function {
name: "DOLLAR",
fixed_arity: None,
}), Some(Function {
name: "FIXED",
fixed_arity: None,
}), Some(Function {
name: "SIN",
fixed_arity: Some(1),
}), Some(Function {
name: "COS",
fixed_arity: Some(1),
}), Some(Function {
name: "TAN",
fixed_arity: Some(1),
}), Some(Function {
name: "ATAN",
fixed_arity: Some(1),
}), Some(Function {
name: "PI",
fixed_arity: Some(0),
}), Some(Function {
name: "SQRT",
fixed_arity: Some(1),
}), Some(Function {
name: "EXP",
fixed_arity: Some(1),
}), Some(Function {
name: "LN",
fixed_arity: Some(1),
}), Some(Function {
name: "LOG10",
fixed_arity: Some(1),
}), Some(Function {
name: "ABS",
fixed_arity: Some(1),
}), Some(Function {
name: "INT",
fixed_arity: Some(1),
}), Some(Function {
name: "SIGN",
fixed_arity: Some(1),
}), Some(Function {
name: "ROUND",
fixed_arity: Some(2),
}), Some(Function {
name: "LOOKUP",
fixed_arity: None,
}), Some(Function {
name: "INDEX",
fixed_arity: None,
}), Some(Function {
name: "REPT",
fixed_arity: Some(2),
}), Some(Function {
name: "MID",
fixed_arity: Some(3),
}), Some(Function {
name: "LEN",
fixed_arity: Some(1),
}), Some(Function {
name: "VALUE",
fixed_arity: Some(1),
}), Some(Function {
name: "TRUE",
fixed_arity: Some(0),
}), Some(Function {
name: "FALSE",
fixed_arity: Some(0),
}), Some(Function {
name: "AND",
fixed_arity: None,
}), Some(Function {
name: "OR",
fixed_arity: None,
}), Some(Function {
name: "NOT",
fixed_arity: Some(1),
}), Some(Function {
name: "MOD",
fixed_arity: Some(2),
}), Some(Function {
name: "DCOUNT",
fixed_arity: Some(3),
}), Some(Function {
name: "DSUM",
fixed_arity: Some(3),
}), Some(Function {
name: "DAVERAGE",
fixed_arity: Some(3),
}), Some(Function {
name: "DMIN",
fixed_arity: Some(3),
}), Some(Function {
name: "DMAX",
fixed_arity: Some(3),
}), Some(Function {
name: "DSTDEV",
fixed_arity: Some(3),
}), Some(Function {
name: "VAR",
fixed_arity: None,
}), Some(Function {
name: "DVAR",
fixed_arity: Some(3),
}), Some(Function {
name: "TEXT",
fixed_arity: Some(2),
}), Some(Function {
name: "LINEST",
fixed_arity: None,
}), Some(Function {
name: "TREND",
fixed_arity: None,
}), Some(Function {
name: "LOGEST",
fixed_arity: None,
}), Some(Function {
name: "GROWTH",
fixed_arity: None,
}), Some(Function {
name: "GOTO",
fixed_arity: Some(1),
}), Some(Function {
name: "HALT",
fixed_arity: None,
}), Some(Function {
name: "RETURN",
fixed_arity: None,
}), Some(Function {
name: "PV",
fixed_arity: None,
}), Some(Function {
name: "FV",
fixed_arity: None,
}), Some(Function {
name: "NPER",
fixed_arity: None,
}), Some(Function {
name: "PMT",
fixed_arity: None,
}), Some(Function {
name: "RATE",
fixed_arity: None,
}), Some(Function {
name: "MIRR",
fixed_arity: Some(3),
}), Some(Function {
name: "IRR",
fixed_arity: None,
}), Some(Function {
name: "RAND",
fixed_arity: Some(0),
}), Some(Function {
name: "MATCH",
fixed_arity: None,
}), Some(Function {
name: "DATE",
fixed_arity: Some(3),
}), Some(Function {
name: "TIME",
fixed_arity: Some(3),
}), Some(Function {
name: "DAY",
fixed_arity: Some(1),
}), Some(Function {
name: "MONTH",
fixed_arity: Some(1),
}), Some(Function {
name: "YEAR",
fixed_arity: Some(1),
}), Some(Function {
name: "WEEKDAY",
fixed_arity: None,
}), Some(Function {
name: "HOUR",
fixed_arity: Some(1),
}), Some(Function {
name: "MINUTE",
fixed_arity: Some(1),
}), Some(Function {
name: "SECOND",
fixed_arity: Some(1),
}), Some(Function {
name: "NOW",
fixed_arity: Some(0),
}), Some(Function {
name: "AREAS",
fixed_arity: Some(1),
}), Some(Function {
name: "ROWS",
fixed_arity: Some(1),
}), Some(Function {
name: "COLUMNS",
fixed_arity: Some(1),
}), Some(Function {
name: "OFFSET",
fixed_arity: None,
}), Some(Function {
name: "ABSREF",
fixed_arity: Some(2),
}), Some(Function {
name: "RELREF",
fixed_arity: Some(2),
}), Some(Function {
name: "ARGUMENT",
fixed_arity: None,
}), Some(Function {
name: "SEARCH",
fixed_arity: None,
}), Some(Function {
name: "TRANSPOSE",
fixed_arity: Some(1),
}), Some(Function {
name: "ERROR",
fixed_arity: None,
}), Some(Function {
name: "STEP",
fixed_arity: Some(0),
}), Some(Function {
name: "TYPE",
fixed_arity: Some(1),
}), Some(Function {
name: "ECHO",
fixed_arity: None,
}), Some(Function {
name: "SET.NAME",
fixed_arity: None,
}), Some(Function {
name: "CALLER",
fixed_arity: Some(0),
}), Some(Function {
name: "DEREF",
fixed_arity: Some(1),
}), Some(Function {
name: "WINDOWS",
fixed_arity: None,
}), None, Some(Function {
name: "DOCUMENTS",
fixed_arity: None,
}), Some(Function {
name: "ACTIVE.CELL",
fixed_arity: Some(0),
}), Some(Function {
name: "SELECTION",
fixed_arity: Some(0),
}), Some(Function {
name: "RESULT",
fixed_arity: None,
}), Some(Function {
name: "ATAN2",
fixed_arity: Some(2),
}), Some(Function {
name: "ASIN",
fixed_arity: Some(1),
}), Some(Function {
name: "ACOS",
fixed_arity: Some(1),
}), Some(Function {
name: "CHOOSE",
fixed_arity: None,
}), Some(Function {
name: "HLOOKUP",
fixed_arity: None,
}), Some(Function {
name: "VLOOKUP",
fixed_arity: None,
}), Some(Function {
name: "LINKS",
fixed_arity: None,
}), Some(Function {
name: "INPUT",
fixed_arity: None,
}), Some(Function {
name: "ISREF",
fixed_arity: Some(1),
}), Some(Function {
name: "GET.FORMULA",
fixed_arity: Some(1),
}), Some(Function {
name: "GET.NAME",
fixed_arity: None,
}), Some(Function {
name: "SET.VALUE",
fixed_arity: Some(2),
}), Some(Function {
name: "LOG",
fixed_arity: None,
}), Some(Function {
name: "EXEC",
fixed_arity: None,
}), Some(Function {
name: "CHAR",
fixed_arity: Some(1),
}), Some(Function {
name: "LOWER",
fixed_arity: Some(1),
}), Some(Function {
name: "UPPER",
fixed_arity: Some(1),
}), Some(Function {
name: "PROPER",
fixed_arity: Some(1),
}), Some(Function {
name: "LEFT",
fixed_arity: None,
}), Some(Function {
name: "RIGHT",
fixed_arity: None,
}), Some(Function {
name: "EXACT",
fixed_arity: None,
}), Some(Function {
name: "TRIM",
fixed_arity: Some(1),
}), Some(Function {
name: "REPLACE",
fixed_arity: Some(4),
}), Some(Function {
name: "SUBSTITUTE",
fixed_arity: None,
}), Some(Function {
name: "CODE",
fixed_arity: Some(1),
}), Some(Function {
name: "NAMES",
fixed_arity: None,
}), Some(Function {
name: "DIRECTORY",
fixed_arity: None,
}), Some(Function {
name: "FIND",
fixed_arity: None,
}), Some(Function {
name: "CELL",
fixed_arity: None,
}), Some(Function {
name: "ISERR",
fixed_arity: Some(1),
}), Some(Function {
name: "ISTEXT",
fixed_arity: Some(1),
}), Some(Function {
name: "ISNUMBER",
fixed_arity: Some(1),
}), Some(Function {
name: "ISBLANK",
fixed_arity: Some(1),
}), Some(Function {
name: "T",
fixed_arity: Some(1),
}), Some(Function {
name: "N",
fixed_arity: Some(1),
}), Some(Function {
name: "FOPEN",
fixed_arity: None,
}), Some(Function {
name: "FCLOSE",
fixed_arity: Some(1),
}), Some(Function {
name: "FSIZE",
fixed_arity: Some(1),
}), Some(Function {
name: "FREADLN",
fixed_arity: Some(1),
}), Some(Function {
name: "FREAD",
fixed_arity: Some(2),
}), Some(Function {
name: "FWRITELN",
fixed_arity: Some(2),
}), Some(Function {
name: "FWRITE",
fixed_arity: Some(2),
}), Some(Function {
name: "FPOS",
fixed_arity: None,
}), Some(Function {
name: "DATEVALUE",
fixed_arity: Some(1),
}), Some(Function {
name: "TIMEVALUE",
fixed_arity: Some(1),
}), Some(Function {
name: "SLN",
fixed_arity: Some(3),
}), Some(Function {
name: "SYD",
fixed_arity: Some(4),
}), Some(Function {
name: "DDB",
fixed_arity: None,
}), Some(Function {
name: "GET.DEF",
fixed_arity: None,
}), Some(Function {
name: "REFTEXT",
fixed_arity: None,
}), Some(Function {
name: "TEXTREF",
fixed_arity: None,
}), Some(Function {
name: "INDIRECT",
fixed_arity: None,
}), Some(Function {
name: "REGISTER",
fixed_arity: None,
}), Some(Function {
name: "CALL",
fixed_arity: None,
}), Some(Function {
name: "ADD.BAR",
fixed_arity: None,
}), Some(Function {
name: "ADD.MENU",
fixed_arity: None,
}), Some(Function {
name: "ADD.COMMAND",
fixed_arity: None,
}), Some(Function {
name: "ENABLE.COMMAND",
fixed_arity: None,
}), Some(Function {
name: "CHECK.COMMAND",
fixed_arity: None,
}), Some(Function {
name: "RENAME.COMMAND",
fixed_arity: None,
}), Some(Function {
name: "SHOW.BAR",
fixed_arity: None,
}), Some(Function {
name: "DELETE.MENU",
fixed_arity: None,
}), Some(Function {
name: "DELETE.COMMAND",
fixed_arity: None,
}), Some(Function {
name: "GET.CHART.ITEM",
fixed_arity: None,
}), Some(Function {
name: "DIALOG.BOX",
fixed_arity: Some(1),
}), Some(Function {
name: "CLEAN",
fixed_arity: Some(1),
}), Some(Function {
name: "MDETERM",
fixed_arity: Some(1),
}), Some(Function {
name: "MINVERSE",
fixed_arity: Some(1),
}), Some(Function {
name: "MMULT",
fixed_arity: Some(2),
}), Some(Function {
name: "FILES",
fixed_arity: None,
}), Some(Function {
name: "IPMT",
fixed_arity: None,
}), Some(Function {
name: "PPMT",
fixed_arity: None,
}), Some(Function {
name: "COUNTA",
fixed_arity: None,
}), Some(Function {
name: "CANCEL.KEY",
fixed_arity: None,
}), Some(Function {
name: "FOR",
fixed_arity: None,
}), Some(Function {
name: "WHILE",
fixed_arity: Some(1),
}), Some(Function {
name: "BREAK",
fixed_arity: Some(0),
}), Some(Function {
name: "NEXT",
fixed_arity: Some(0),
}), Some(Function {
name: "INITIATE",
fixed_arity: Some(2),
}), Some(Function {
name: "REQUEST",
fixed_arity: Some(2),
}), Some(Function {
name: "POKE",
fixed_arity: Some(3),
}), Some(Function {
name: "EXECUTE",
fixed_arity: Some(2),
}), Some(Function {
name: "TERMINATE",
fixed_arity: Some(1),
}), Some(Function {
name: "RESTART",
fixed_arity: None,
}), Some(Function {
name: "HELP",
fixed_arity: None,
}), Some(Function {
name: "GET.BAR",
fixed_arity: None,
}), Some(Function {
name: "PRODUCT",
fixed_arity: None,
}), Some(Function {
name: "FACT",
fixed_arity: Some(1),
}), Some(Function {
name: "GET.CELL",
fixed_arity: None,
}), Some(Function {
name: "GET.WORKSPACE",
fixed_arity: Some(1),
}), Some(Function {
name: "GET.WINDOW",
fixed_arity: None,
}), Some(Function {
name: "GET.DOCUMENT",
fixed_arity: None,
}), Some(Function {
name: "DPRODUCT",
fixed_arity: Some(3),
}), Some(Function {
name: "ISNONTEXT",
fixed_arity: Some(1),
}), Some(Function {
name: "GET.NOTE",
fixed_arity: None,
}), Some(Function {
name: "NOTE",
fixed_arity: None,
}), Some(Function {
name: "STDEVP",
fixed_arity: None,
}), Some(Function {
name: "VARP",
fixed_arity: None,
}), Some(Function {
name: "DSTDEVP",
fixed_arity: Some(3),
}), Some(Function {
name: "DVARP",
fixed_arity: Some(3),
}), Some(Function {
name: "TRUNC",
fixed_arity: None,
}), Some(Function {
name: "ISLOGICAL",
fixed_arity: Some(1),
}), Some(Function {
name: "DCOUNTA",
fixed_arity: Some(3),
}), Some(Function {
name: "DELETE.BAR",
fixed_arity: Some(1),
}), Some(Function {
name: "UNREGISTER",
fixed_arity: Some(1),
}), None, None, Some(Function {
name: "USDOLLAR",
fixed_arity: None,
}), Some(Function {
name: "FINDB",
fixed_arity: None,
}), Some(Function {
name: "SEARCHB",
fixed_arity: None,
}), Some(Function {
name: "REPLACEB",
fixed_arity: Some(4),
}), Some(Function {
name: "LEFTB",
fixed_arity: None,
}), Some(Function {
name: "RIGHTB",
fixed_arity: None,
}), Some(Function {
name: "MIDB",
fixed_arity: Some(3),
}), Some(Function {
name: "LENB",
fixed_arity: Some(3),
}), Some(Function {
name: "ROUNDUP",
fixed_arity: Some(2),
}), Some(Function {
name: "ROUNDDOWN",
fixed_arity: Some(2),
}), Some(Function {
name: "ASC",
fixed_arity: Some(1),
}), Some(Function {
name: "DBCS",
fixed_arity: Some(1),
}), Some(Function {
name: "RANK",
fixed_arity: None,
}), None, None, Some(Function {
name: "ADDRESS",
fixed_arity: None,
}), Some(Function {
name: "DAYS360",
fixed_arity: None,
}), Some(Function {
name: "TODAY",
fixed_arity: Some(0),
}), Some(Function {
name: "VDB",
fixed_arity: None,
}), Some(Function {
name: "ELSE",
fixed_arity: Some(0),
}), Some(Function {
name: "ELSE.IF",
fixed_arity: Some(1),
}), Some(Function {
name: "END.IF",
fixed_arity: Some(0),
}), Some(Function {
name: "FOR.CELL",
fixed_arity: None,
}), Some(Function {
name: "MEDIAN",
fixed_arity: None,
}), Some(Function {
name: "SUMPRODUCT",
fixed_arity: None,
}), Some(Function {
name: "SINH",
fixed_arity: Some(1),
}), Some(Function {
name: "COSH",
fixed_arity: Some(1),
}), Some(Function {
name: "TANH",
fixed_arity: Some(1),
}), Some(Function {
name: "ASINH",
fixed_arity: Some(1),
}), Some(Function {
name: "ACOSH",
fixed_arity: Some(1),
}), Some(Function {
name: "ATANH",
fixed_arity: Some(1),
}), Some(Function {
name: "DGET",
fixed_arity: Some(3),
}), Some(Function {
name: "CREATE.OBJECT",
fixed_arity: None,
}), Some(Function {
name: "VOLATILE",
fixed_arity: None,
}), Some(Function {
name: "LAST.ERROR",
fixed_arity: Some(0),
}), Some(Function {
name: "CUSTOM.UNDO",
fixed_arity: None,
}), Some(Function {
name: "CUSTOM.REPEAT",
fixed_arity: None,
}), Some(Function {
name: "FORMULA.CONVERT",
fixed_arity: None,
}), Some(Function {
name: "GET.LINK.INFO",
fixed_arity: None,
}), Some(Function {
name: "TEXT.BOX",
fixed_arity: None,
}), Some(Function {
name: "INFO",
fixed_arity: Some(1),
}), Some(Function {
name: "GROUP",
fixed_arity: Some(0),
}), Some(Function {
name: "GET.OBJECT",
fixed_arity: None,
}), Some(Function {
name: "DB",
fixed_arity: None,
}), Some(Function {
name: "PAUSE",
fixed_arity: None,
}), None, None, Some(Function {
name: "RESUME",
fixed_arity: None,
}), Some(Function {
name: "FREQUENCY",
fixed_arity: Some(2),
}), Some(Function {
name: "ADD.TOOLBAR",
fixed_arity: None,
}), Some(Function {
name: "DELETE.TOOLBAR",
fixed_arity: Some(1),
}), Some(Function {
name: "user-defined function (UDF) or future function",
fixed_arity: None,
}), Some(Function {
name: "RESET.TOOLBAR",
fixed_arity: Some(1),
}), Some(Function {
name: "EVALUATE",
fixed_arity: Some(1),
}), Some(Function {
name: "GET.TOOLBAR",
fixed_arity: None,
}), Some(Function {
name: "GET.TOOL",
fixed_arity: None,
}), Some(Function {
name: "SPELLING.CHECK",
fixed_arity: None,
}), Some(Function {
name: "ERROR.TYPE",
fixed_arity: Some(1),
}), Some(Function {
name: "APP.TITLE",
fixed_arity: None,
}), Some(Function {
name: "WINDOW.TITLE",
fixed_arity: None,
}), Some(Function {
name: "SAVE.TOOLBAR",
fixed_arity: None,
}), Some(Function {
name: "ENABLE.TOOL",
fixed_arity: Some(3),
}), Some(Function {
name: "PRESS.TOOL",
fixed_arity: Some(3),
}), Some(Function {
name: "REGISTER.ID",
fixed_arity: None,
}), Some(Function {
name: "GET.WORKBOOK",
fixed_arity: None,
}), Some(Function {
name: "AVEDEV",
fixed_arity: None,
}), Some(Function {
name: "BETADIST",
fixed_arity: None,
}), Some(Function {
name: "GAMMALN",
fixed_arity: Some(1),
}), Some(Function {
name: "BETAINV",
fixed_arity: None,
}), Some(Function {
name: "BINOMDIST",
fixed_arity: Some(4),
}), Some(Function {
name: "CHIDIST",
fixed_arity: Some(2),
}), Some(Function {
name: "CHIINV",
fixed_arity: Some(2),
}), Some(Function {
name: "COMBIN",
fixed_arity: Some(2),
}), Some(Function {
name: "CONFIDENCE",
fixed_arity: Some(3),
}), Some(Function {
name: "CRITBINOM",
fixed_arity: Some(3),
}), Some(Function {
name: "EVEN",
fixed_arity: Some(1),
}), Some(Function {
name: "EXPONDIST",
fixed_arity: Some(3),
}), Some(Function {
name: "FDIST",
fixed_arity: Some(3),
}), Some(Function {
name: "FINV",
fixed_arity: Some(3),
}), Some(Function {
name: "FISHER",
fixed_arity: Some(1),
}), Some(Function {
name: "FISHERINV",
fixed_arity: Some(1),
}), Some(Function {
name: "FLOOR",
fixed_arity: Some(2),
}), Some(Function {
name: "GAMMADIST",
fixed_arity: Some(4),
}), Some(Function {
name: "GAMMAINV",
fixed_arity: Some(3),
}), Some(Function {
name: "CEILING",
fixed_arity: Some(2),
}), Some(Function {
name: "HYPGEOMDIST",
fixed_arity: Some(4),
}), Some(Function {
name: "LOGNORMDIST",
fixed_arity: Some(3),
}), Some(Function {
name: "LOGINV",
fixed_arity: Some(3),
}), Some(Function {
name: "NEGBINOMDIST",
fixed_arity: Some(3),
}), Some(Function {
name: "NORMDIST",
fixed_arity: Some(4),
}), Some(Function {
name: "NORMSDIST",
fixed_arity: Some(1),
}), Some(Function {
name: "NORMINV",
fixed_arity: Some(3),
}), Some(Function {
name: "NORMSINV",
fixed_arity: Some(1),
}), Some(Function {
name: "STANDARDIZE",
fixed_arity: Some(3),
}), Some(Function {
name: "ODD",
fixed_arity: Some(1),
}), Some(Function {
name: "PERMUT",
fixed_arity: Some(2),
}), Some(Function {
name: "POISSON",
fixed_arity: Some(3),
}), Some(Function {
name: "TDIST",
fixed_arity: Some(3),
}), Some(Function {
name: "WEIBULL",
fixed_arity: Some(4),
}), Some(Function {
name: "SUMXMY2",
fixed_arity: Some(2),
}), Some(Function {
name: "SUMX2MY2",
fixed_arity: Some(2),
}), Some(Function {
name: "SUMX2PY2",
fixed_arity: Some(2),
}), Some(Function {
name: "CHITEST",
fixed_arity: Some(2),
}), Some(Function {
name: "CORREL",
fixed_arity: Some(2),
}), Some(Function {
name: "COVAR",
fixed_arity: Some(2),
}), Some(Function {
name: "FORECAST",
fixed_arity: Some(3),
}), Some(Function {
name: "FTEST",
fixed_arity: Some(2),
}), Some(Function {
name: "INTERCEPT",
fixed_arity: Some(2),
}), Some(Function {
name: "PEARSON",
fixed_arity: Some(2),
}), Some(Function {
name: "RSQ",
fixed_arity: Some(2),
}), Some(Function {
name: "STEYX",
fixed_arity: Some(2),
}), Some(Function {
name: "SLOPE",
fixed_arity: Some(2),
}), Some(Function {
name: "TTEST",
fixed_arity: Some(4),
}), Some(Function {
name: "PROB",
fixed_arity: None,
}), Some(Function {
name: "DEVSQ",
fixed_arity: None,
}), Some(Function {
name: "GEOMEAN",
fixed_arity: None,
}), Some(Function {
name: "HARMEAN",
fixed_arity: None,
}), Some(Function {
name: "SUMSQ",
fixed_arity: None,
}), Some(Function {
name: "KURT",
fixed_arity: None,
}), Some(Function {
name: "SKEW",
fixed_arity: None,
}), Some(Function {
name: "ZTEST",
fixed_arity: None,
}), Some(Function {
name: "LARGE",
fixed_arity: Some(2),
}), Some(Function {
name: "SMALL",
fixed_arity: Some(2),
}), Some(Function {
name: "QUARTILE",
fixed_arity: Some(2),
}), Some(Function {
name: "PERCENTILE",
fixed_arity: Some(2),
}), Some(Function {
name: "PERCENTRANK",
fixed_arity: None,
}), Some(Function {
name: "MODE",
fixed_arity: None,
}), Some(Function {
name: "TRIMMEAN",
fixed_arity: Some(2),
}), Some(Function {
name: "TINV",
fixed_arity: Some(2),
}), None, Some(Function {
name: "MOVIE.COMMAND",
fixed_arity: None,
}), Some(Function {
name: "GET.MOVIE",
fixed_arity: None,
}), Some(Function {
name: "CONCATENATE",
fixed_arity: None,
}), Some(Function {
name: "POWER",
fixed_arity: Some(2),
}), Some(Function {
name: "PIVOT.ADD.DATA",
fixed_arity: None,
}), Some(Function {
name: "GET.PIVOT.TABLE",
fixed_arity: None,
}), Some(Function {
name: "GET.PIVOT.FIELD",
fixed_arity: None,
}), Some(Function {
name: "GET.PIVOT.ITEM",
fixed_arity: None,
}), Some(Function {
name: "RADIANS",
fixed_arity: Some(1),
}), Some(Function {
name: "DEGREES",
fixed_arity: Some(1),
}), Some(Function {
name: "SUBTOTAL",
fixed_arity: None,
}), Some(Function {
name: "SUMIF",
fixed_arity: None,
}), Some(Function {
name: "COUNTIF",
fixed_arity: Some(2),
}), Some(Function {
name: "COUNTBLANK",
fixed_arity: Some(1),
}), Some(Function {
name: "SCENARIO.GET",
fixed_arity: None,
}), Some(Function {
name: "OPTIONS.LISTS.GET",
fixed_arity: Some(1),
}), Some(Function {
name: "ISPMT",
fixed_arity: Some(4),
}), Some(Function {
name: "DATEDIF",
fixed_arity: Some(3),
}), Some(Function {
name: "DATESTRING",
fixed_arity: Some(1),
}), Some(Function {
name: "NUMBERSTRING",
fixed_arity: Some(2),
}), Some(Function {
name: "ROMAN",
fixed_arity: None,
}), Some(Function {
name: "OPEN.DIALOG",
fixed_arity: None,
}), Some(Function {
name: "SAVE.DIALOG",
fixed_arity: None,
}), Some(Function {
name: "VIEW.GET",
fixed_arity: None,
}), Some(Function {
name: "GETPIVOTDATA",
fixed_arity: None,
}), Some(Function {
name: "HYPERLINK",
fixed_arity: None,
}), Some(Function {
name: "PHONETIC",
fixed_arity: Some(1),
}), Some(Function {
name: "AVERAGEA",
fixed_arity: None,
}), Some(Function {
name: "MAXA",
fixed_arity: None,
}), Some(Function {
name: "MINA",
fixed_arity: None,
}), Some(Function {
name: "STDEVPA",
fixed_arity: None,
}), Some(Function {
name: "VARPA",
fixed_arity: None,
}), Some(Function {
name: "STDEVA",
fixed_arity: None,
}), Some(Function {
name: "VARA",
fixed_arity: None,
}), Some(Function {
name: "BAHTTEXT",
fixed_arity: Some(1),
}), Some(Function {
name: "THAIDAYOFWEEK",
fixed_arity: Some(1),
}), Some(Function {
name: "THAIDIGIT",
fixed_arity: Some(1),
}), Some(Function {
name: "THAIMONTHOFYEAR",
fixed_arity: Some(1),
}), Some(Function {
name: "THAINUMSOUND",
fixed_arity: Some(1),
}), Some(Function {
name: "THAINUMSTRING",
fixed_arity: Some(1),
}), Some(Function {
name: "THAISTRINGLENGTH",
fixed_arity: Some(1),
}), Some(Function {
name: "ISTHAIDIGIT",
fixed_arity: Some(1),
}), Some(Function {
name: "ROUNDBAHTDOWN",
fixed_arity: Some(1),
}), Some(Function {
name: "ROUNDBAHTUP",
fixed_arity: Some(1),
}), Some(Function {
name: "THAIYEAR",
fixed_arity: Some(1),
}), Some(Function {
name: "RTD",
fixed_arity: None,
}), Some(Function {
name: "CUBEVALUE",
fixed_arity: None,
}), Some(Function {
name: "CUBEMEMBER",
fixed_arity: None,
}), Some(Function {
name: "CUBEMEMBERPROPERTY",
fixed_arity: Some(3),
}), Some(Function {
name: "CUBERANKEDMEMBER",
fixed_arity: None,
}), Some(Function {
name: "HEX2BIN",
fixed_arity: None,
}), Some(Function {
name: "HEX2DEC",
fixed_arity: Some(1),
}), Some(Function {
name: "HEX2OCT",
fixed_arity: None,
}), Some(Function {
name: "DEC2BIN",
fixed_arity: None,
}), Some(Function {
name: "DEC2HEX",
fixed_arity: None,
}), Some(Function {
name: "DEC2OCT",
fixed_arity: None,
}), Some(Function {
name: "OCT2BIN",
fixed_arity: None,
}), Some(Function {
name: "OCT2HEX",
fixed_arity: None,
}), Some(Function {
name: "OCT2DEC",
fixed_arity: Some(1),
}), Some(Function {
name: "BIN2DEC",
fixed_arity: Some(1),
}), Some(Function {
name: "BIN2OCT",
fixed_arity: None,
}), Some(Function {
name: "BIN2HEX",
fixed_arity: None,
}), Some(Function {
name: "IMSUB",
fixed_arity: Some(2),
}), Some(Function {
name: "IMDIV",
fixed_arity: Some(2),
}), Some(Function {
name: "IMPOWER",
fixed_arity: Some(2),
}), Some(Function {
name: "IMABS",
fixed_arity: Some(1),
}), Some(Function {
name: "IMSQRT",
fixed_arity: Some(1),
}), Some(Function {
name: "IMLN",
fixed_arity: Some(1),
}), Some(Function {
name: "IMLOG2",
fixed_arity: Some(1),
}), Some(Function {
name: "IMLOG10",
fixed_arity: Some(1),
}), Some(Function {
name: "IMSIN",
fixed_arity: Some(1),
}), Some(Function {
name: "IMCOS",
fixed_arity: Some(1),
}), Some(Function {
name: "IMEXP",
fixed_arity: Some(1),
}), Some(Function {
name: "IMARGUMENT",
fixed_arity: Some(1),
}), Some(Function {
name: "IMCONJUGATE",
fixed_arity: Some(1),
}), Some(Function {
name: "IMAGINARY",
fixed_arity: Some(1),
}), Some(Function {
name: "IMREAL",
fixed_arity: Some(1),
}), Some(Function {
name: "COMPLEX",
fixed_arity: None,
}), Some(Function {
name: "IMSUM",
fixed_arity: None,
}), Some(Function {
name: "IMPRODUCT",
fixed_arity: None,
}), Some(Function {
name: "SERIESSUM",
fixed_arity: Some(4),
}), Some(Function {
name: "FACTDOUBLE",
fixed_arity: Some(1),
}), Some(Function {
name: "SQRTPI",
fixed_arity: Some(1),
}), Some(Function {
name: "QUOTIENT",
fixed_arity: Some(2),
}), Some(Function {
name: "DELTA",
fixed_arity: None,
}), Some(Function {
name: "GESTEP",
fixed_arity: None,
}), Some(Function {
name: "ISEVEN",
fixed_arity: Some(1),
}), Some(Function {
name: "ISODD",
fixed_arity: Some(1),
}), Some(Function {
name: "MROUND",
fixed_arity: Some(2),
}), Some(Function {
name: "ERF",
fixed_arity: None,
}), Some(Function {
name: "ERFC",
fixed_arity: Some(1),
}), Some(Function {
name: "BESSELJ",
fixed_arity: Some(2),
}), Some(Function {
name: "BESSELK",
fixed_arity: Some(2),
}), Some(Function {
name: "BESSELY",
fixed_arity: Some(2),
}), Some(Function {
name: "BESSELI",
fixed_arity: Some(2),
}), Some(Function {
name: "XIRR",
fixed_arity: None,
}), Some(Function {
name: "XNPV",
fixed_arity: Some(3),
}), Some(Function {
name: "PRICEMAT",
fixed_arity: None,
}), Some(Function {
name: "YIELDMAT",
fixed_arity: None,
}), Some(Function {
name: "INTRATE",
fixed_arity: None,
}), Some(Function {
name: "RECEIVED",
fixed_arity: None,
}), Some(Function {
name: "DISC",
fixed_arity: None,
}), Some(Function {
name: "PRICEDISC",
fixed_arity: None,
}), Some(Function {
name: "YIELDDISC",
fixed_arity: None,
}), Some(Function {
name: "TBILLEQ",
fixed_arity: Some(3),
}), Some(Function {
name: "TBILLPRICE",
fixed_arity: Some(3),
}), Some(Function {
name: "TBILLYIELD",
fixed_arity: Some(3),
}), Some(Function {
name: "PRICE",
fixed_arity: None,
}), Some(Function {
name: "YIELD",
fixed_arity: None,
}), Some(Function {
name: "DOLLARDE",
fixed_arity: Some(2),
}), Some(Function {
name: "DOLLARFR",
fixed_arity: Some(2),
}), Some(Function {
name: "NOMINAL",
fixed_arity: Some(2),
}), Some(Function {
name: "EFFECT",
fixed_arity: Some(2),
}), Some(Function {
name: "CUMPRINC",
fixed_arity: Some(6),
}), Some(Function {
name: "CUMIPMT",
fixed_arity: Some(6),
}), Some(Function {
name: "EDATE",
fixed_arity: Some(2),
}), Some(Function {
name: "EOMONTH",
fixed_arity: Some(2),
}), Some(Function {
name: "YEARFRAC",
fixed_arity: None,
}), Some(Function {
name: "COUPDAYBS",
fixed_arity: None,
}), Some(Function {
name: "COUPDAYS",
fixed_arity: None,
}), Some(Function {
name: "COUPDAYSNC",
fixed_arity: None,
}), Some(Function {
name: "COUPNCD",
fixed_arity: None,
}), Some(Function {
name: "COUPNUM",
fixed_arity: None,
}), Some(Function {
name: "COUPPCD",
fixed_arity: None,
}), Some(Function {
name: "DURATION",
fixed_arity: None,
}), Some(Function {
name: "MDURATION",
fixed_arity: None,
}), Some(Function {
name: "ODDLPRICE",
fixed_arity: None,
}), Some(Function {
name: "ODDLYIELD",
fixed_arity: None,
}), Some(Function {
name: "ODDFPRICE",
fixed_arity: None,
}), Some(Function {
name: "ODDFYIELD",
fixed_arity: None,
}), Some(Function {
name: "RANDBETWEEN",
fixed_arity: Some(2),
}), Some(Function {
name: "WEEKNUM",
fixed_arity: None,
}), Some(Function {
name: "AMORDEGRC",
fixed_arity: None,
}), Some(Function {
name: "AMORLINC",
fixed_arity: None,
}), None, Some(Function {
name: "ACCRINT",
fixed_arity: None,
}), Some(Function {
name: "ACCRINTM",
fixed_arity: None,
}), Some(Function {
name: "WORKDAY",
fixed_arity: None,
}), Some(Function {
name: "NETWORKDAYS",
fixed_arity: None,
}), Some(Function {
name: "GCD",
fixed_arity: None,
}), Some(Function {
name: "MULTINOMIAL",
fixed_arity: None,
}), Some(Function {
name: "LCM",
fixed_arity: None,
}), Some(Function {
name: "FVSCHEDULE",
fixed_arity: Some(2),
}), Some(Function {
name: "CUBEKPIMEMBER",
fixed_arity: None,
}), Some(Function {
name: "CUBESET",
fixed_arity: None,
}), Some(Function {
name: "CUBESETCOUNT",
fixed_arity: Some(1),
}), Some(Function {
name: "IFERROR",
fixed_arity: Some(2),
}), Some(Function {
name: "COUNTIFS",
fixed_arity: None,
}), Some(Function {
name: "SUMIFS",
fixed_arity: None,
}), Some(Function {
name: "AVERAGEIF",
fixed_arity: None,
}), Some(Function {
name: "AVERAGEIFS",
fixed_arity: None,
}), ];
pub(crate) fn function(id: u16) -> Option<Function> {
FUNCTIONS.get(usize::from(id)).copied().flatten()
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn official_ftab_has_every_assigned_xlsb_id() {
let missing: Vec<usize> = FUNCTIONS
.iter()
.enumerate()
.filter_map(|(id, function)| function.is_none().then_some(id))
.collect();
assert_eq!(missing, vec![92, 202, 203, 217, 218, 249, 250, 333, 468]);
assert_eq!(FUNCTIONS.iter().flatten().count(), 476);
}
#[test]
fn historically_mismapped_ids_match_the_official_table() {
for (id, name, arity) in [
(0x0018, "ABS", Some(1)),
(0x0022, "TRUE", Some(0)),
(0x0023, "FALSE", Some(0)),
(0x004A, "NOW", Some(0)),
] {
assert_eq!(
function(id),
Some(Function {
name,
fixed_arity: arity
})
);
}
}
#[test]
fn fixed_and_variable_parameter_classes_are_explicit() {
assert_eq!(function(0x001B).unwrap().fixed_arity, Some(2)); assert_eq!(function(0x00A5).unwrap().fixed_arity, Some(2)); assert_eq!(function(0x0000).unwrap().fixed_arity, None); assert_eq!(function(0x0001).unwrap().fixed_arity, None); }
}