excelFormula($formula)
Creates an Excel formula that can be used in a cell. The function takes an Excel formula as a string and wraps it in a special format that is recognized and processed by the Excel creator. Formulas enable the creation of dynamic and interactive Excel tables in which values are automatically calculated based on other cell contents.
| Formula name | Type | Type Description | Mandatory | Default |
|---|---|---|---|---|
| formula | Character string | The Excel formula as a string (without leading equals sign). | yes |
Type: Map
A special map object that contains the formula information for processing by excelCell().
excelCell(row: 5, col: 3, content: excelFormula("SUM(B3:D3)"))
Output: Cell with formula that calculates the sum of cells B3 to D3.
excelCell(row: 2, col: 4, content:
excelFormula("IF(B2>1000, \"Überschritten\", \"Im Rahmen\")"),
style: {"color": "blue"})
Output: Cell with conditional formula that displays "Exceeded" if B2 > 1000, otherwise "In range".
excelCell(row: 10, col: 5, content:
excelFormula("AVERAGEIFS(D2:D100, B2:B100, \">=2024-01-01\", C2:C100, \"Marketing\")"),
style: excelStyle(numberFormat: "0.00"))
Output: Two cells with the current date and time, suitably formatted.
excelCell(row: 0, col: 0, content: excelFormula("TODAY()"),
style: excelStyle(numberFormat: "DD.MM.YYYY"))
excelCell(row: 0, col: 1, content: excelFormula("NOW()"),
style: excelStyle(numberFormat: "DD.MM.YYYY HH:MM"))
Output: Cell with conditional formula that displays "Exceeded" if B2 > 1000, otherwise "Within range".
excelCell(row: 10, col: 5, content:
excelFormula("AVERAGEIFS(D2:D100, B2:B100, \">=2024-01-01\", C2:C100, \"Marketing\")"),
style: excelStyle(numberFormat: "0.00"))
Output: Cell with complex calculation of the average value based on several conditions.
excelCell(row: 15, col: 2, content: excelFormula("COUNTIF(A2:A100, \">1000\")"),
style: excelStyle(background: "#FFF3CD"))
excelCell(row: 16, col: 2, content: excelFormula("MAX(C2:C50)"),
style: excelStyle(background: "#D4EDDA"))
excelCell(row: 17, col: 2, content: excelFormula("MIN(C2:C50)"),
style: excelStyle(background: "#F8D7DA"))
Output: Three cells with statistical calculations (number, maximum, minimum) and color highlighting.