Functions
Excel worksheet functions.
F builds a call for any function name, so nothing here limits which functions
you can use::
F.SUM(rng("B3:B10"))
F.XLOOKUP(key, lookup_range, return_range)
F.SOME_ADDIN_FUNCTION(a, b)
Functions added in Excel 2010 or later are stored in the file with an _xlfn.
prefix; written bare they show as #NAME? when the workbook is opened. That
rewriting happens automatically, so you always write the plain name.
Two checks run at construction, both aimed at mistakes that would otherwise survive as far as opening the workbook:
- Arity. Names in :data:
_ARITYare checked against their argument count and raise :class:TypeErroron the line that built them. Names outside the table are not checked at all, so add-in and future functions keep working. - Spelling. An unrecognised name close to a known one warns
(:class:
UnknownFunctionWarning) rather than raising, since an arbitrary name is legitimate.check=Falsesilences both.
Func
Bases: Expr
A worksheet function call.
None renders as an omitted argument, so Func("VLOOKUP", a, b, c, None)
gives VLOOKUP(a,b,c,).
Source code in src/pycountant/excel/functions.py
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 | |
UnknownFunctionWarning
Bases: UserWarning
An unrecognised function name that looks like a misspelling of a known one.
Source code in src/pycountant/excel/functions.py
35 36 | |
stored_name(name)
The name as it must appear inside the xlsx file.
Source code in src/pycountant/excel/functions.py
204 205 206 207 208 209 210 211 | |