Financing
You can enter a source's amount as a formula that follows the budget, and you know why an Amount or Total stays empty.
In the **Amount** of a source, you can type a formula instead of a number. When the budget changes, KOSMA recalculates the amount, so a share such as 20 % of the budget stays up to date. An installment gets its amount in the installments dialog. The **Amount** of a subtotal shows the subtotal's name.
Click the source's **Amount** cell and type the formula, for example `250000 * 0.2` or `(NPC * 0.2) - 15000`. A formula calculates with `+`, `-`, `*`, `/` and parentheses. There is no percent sign: for 20 %, write `* 0.2`. Inside a function, put a name in double or single quotes, for example `ACCOUNT("3.01")`. KOSMA saves a plain number such as `350000` as a formula too. In the demo project, the source **Producer Equity** holds `GT() - 1297000`, which gives 110,622.15 EUR.
Write decimals with a point in every language, for example `0.2`, and without thousands separators. A comma only separates the arguments of a function. With `0,2`, the formula is invalid.
While you type, KOSMA shows a menu of the names a formula can use. The menu opens at the start of the formula and after each `+`, `-`, `*`, `/`, `(` and `,`. **Functions** lists the functions, and **Variables** lists **Phases**, **Subtotals** and your own variable groups. When you type letters, KOSMA shows only the matching names. When you pick a function that needs a name, KOSMA inserts the whole call with the quotes, for example `ACCOUNT("3.01")`. A name you pick from the menu cannot have a typing error.
Press `Tab` or click outside the cell. KOSMA saves the formula and shows the result in **Amount**. **Total** shows the result converted into the currency in its header, for example **Total (EUR)**.
KOSMA counts the result of a formula in the currency of the source. `NPC`, `GT`, `ACCOUNT`, `SUM_COMPANY` and `SUM_TAG` give budget money in the budget's default currency. On a source in another currency, KOSMA reads such a figure as an amount in the source's currency and converts it a second time for **Total**.
| Kind | Examples | Figures from | | ---------------------------------------- | ----------------------------------------------------------------------- | ------------------------------- | | The whole budget | `NPC`, `GT` | the linked budget | | One budget account | `ACCOUNT("3.01")` | the linked budget | | Budget money by company or tag | `SUM_COMPANY("…")`, `SUM_TAG("…")` | the linked budget | | Number of budget lines by company or tag | `COUNT_COMPANY("…")`, `COUNT_TAG("…")` | the linked budget | | Variables | **Phases**, **Subtotals**, your own variable groups | the linked budget | | This plan's sources by company or effect | `SUM_COMPANY_F("…")`, `SUM_EFFECT("…")` | the sources of this plan | | This plan's sources by tag | `SUM_TAG_F("…")` | the sources of this plan | | This plan's sources by status | `FINANCING_CONFIRMED()`, `FINANCING_SUBMITTED()`, `FINANCING_PENDING()` | the active sources of this plan |
For the functions that read the budget, see [reference the budget in a source amount](/kb/article/reference-the-budget-in-a-source-amount). For the functions that total this plan's sources, see [aggregate financing sources in a formula](/kb/article/aggregate-financing-sources-in-a-formula). For variables, see [use variables in a financing plan](/kb/article/use-variables-in-a-financing-plan).
If KOSMA cannot read the formula or does not know a name in it, the cell shows **Invalid** in a red frame, and the menu of names closes. If the formula contains an unknown name, point at **Invalid**. KOSMA then lists the unknown names:
Unknown part of expression: {names}
If you leave the cell while it shows **Invalid**, KOSMA keeps the previous **Amount** and does not save the formula. Correct the formula before you leave the cell.
An empty **Amount** and **Total** has one of two causes: the source has no amount yet, or its formula gives no result. To see which, click  in the toolbar. The **Amount** column then shows the formula or typed number of each source, and a source without an amount stays empty. For this view, see [switch between values and formulas](/kb/article/switch-between-financing-values-and-formulas).
An empty **Amount** adds nothing to the totals of the plan. It is the most common reason a Financing total is lower than expected.
A formula gives no result in three cases:
- Someone deleted the account, company, tag or variable the formula names. - Someone copied the plan onto a budget that does not have a name the formula uses. See [copy a financing plan](/kb/article/copy-a-financing-plan). - Someone typed a name inside quotes wrongly, for example `SUM_TAG("Bayren")`. KOSMA does not check names inside quotes, so the cell does not show **Invalid**.
If you renumber an account or rename a company, tag or variable, KOSMA changes the formula to match, so it still gives a result.
Markdown