Budgeting
You can total what one company or one tag carries in a budget formula, and you know why a budget has no such total by effect.
`SUM_COMPANY` and `SUM_TAG` total a part of the budget in a formula: everything assigned to a company, or every row that carries a tag.
You can type them in a budget cell in the **Quantity**, **Price/Unit** or **X** column, in the **Base** of a markup and in the **Calculation Formula** of a variable. The fields of extra costs, wage supplements and fringes do not offer them. For how to pick a function in the formula menu, see [write a formula](/kb/article/write-a-formula).
`SUM_COMPANY` totals the share of the budget that is assigned to a company. For each row assigned to the company, it takes the row's total multiplied by the company's percentage. For how to assign a company and its share to an account, see [split costs between companies](/kb/article/split-costs-between-companies).
If you type a share as an amount, KOSMA saves it as a percentage of the row's total. `SUM_COMPANY` treats it like any other share. If the row's total changes later, the company's amount changes with it.
Use this function for a coproduction handling fee. Give each partner a markup of their own. As its **Base**, enter `SUM_COMPANY` with the partner's name, and as its percentage, the rate of the partner's deal. When a partner's share on an account changes, KOSMA recalculates that partner's markup. In the demo project Northern Light, the budget Feature Film 2026 has such a markup: 9001 Overheads with 7.5 % of `SUM_COMPANY("Northlight")`. For how to create a markup, see [add and edit markups](/kb/article/add-and-edit-markups).
`COUNT_COMPANY("Company name")` counts the rows assigned to the company instead of adding up their totals. An account with subaccounts does not count itself. Each of its subaccounts counts instead. Use it for a cost that applies per budget line.
`SUM_TAG` totals every row that carries the tag, wherever the row sits in the category tree. Use it to total costs that have no place of their own in the budget's categories, such as VFX costs spread over camera, post-production and crew. `COUNT_TAG("VFX")` counts those rows instead of adding up their totals. For how to tag an account, see [use tags on accounts](/kb/article/use-tags-on-accounts).
In the demo project, the budget How KOSMA Calculates has the markup Cast levy: 2 % of `SUM_TAG("Cast")`. The rows tagged Cast total 1,000, so the markup comes to 20.
For an account with subaccounts, only the subaccounts count. A tag or company on that account applies to all of its subaccounts. For example, an account with subaccounts A (300) and B (200) carries the tag VFX. `SUM_TAG("VFX")` returns 500.
A deactivated account does not count in any of the four functions, and neither do the accounts of a deactivated group or the subaccounts of a deactivated account.
In a budget, all four functions leave markups out. Only in the **Info** value on the dashboard do they also count markups, and only those that are not deactivated.
A formula never counts its own row. If a tagged account uses `SUM_TAG` with its own tag, its own total stays out of the result.
All four functions need the exact name of an existing company or tag, in quotes. Pick the name from the dropdown in the formula menu, so the spelling is right. If the name is misspelled or does not exist, KOSMA still saves the formula, but the formula has no result: the field stays empty, does not show 0, and gets a red frame.
If you rename a company or a tag, KOSMA changes the name in every formula that uses it. The results stay the same.
If you delete a company or tag that a formula names, KOSMA first lists those formulas and offers **Delete anyway**. If you delete it anyway, the formulas lose their result and get the same red frame as a misspelled name.
An effect marks the accounts that count toward a funding condition. Budget formulas have no function that totals by effect, the way `SUM_COMPANY` and `SUM_TAG` do. `SUM_EFFECT` exists only in the **Amount** field of a financing plan and in an **Info** value on the dashboard. There it totals the financing sources assigned to the effect, not budget accounts.
In a budget, you see an effect total in a column, on a printout or on the dashboard. See [show company and effect columns](/kb/article/show-company-and-effect-columns). To calculate with the accounts that have an effect, give those accounts a tag as well and use `SUM_TAG`.
You can read every formula but not change it when the budget is read-only, for example on a Free licence, in a budget shared with you for reading only, in a budget linked to a cost control set, or when you are signed out. When you point at a greyed-out control, KOSMA names the reason. See [why a budget is read-only](/kb/article/save-discard-and-read-only).
As a guest, you need two things: the budget must be shared with you for editing, and your own licence must cover Budgeting. The demo project is the exception: there, any licence can edit formulas. For details, see [what your licence includes](/kb/article/what-your-licence-includes).
Markdown