Budgeting
You can look up any budget function — what it takes, what it returns, where it is offered, and what it says when it fails.
| Function | Argument | Returns | When it fails | | ----------------------- | --------------------- | ----------------------------------- | ----------------------- | | `ACCOUNT("1101")` | an account number | that account's total | *No such account* | | `SUM_COMPANY("Name")` | a company | that company's share of the budget | *No such company* | | `COUNT_COMPANY("Name")` | a company | how many accounts it is assigned to | *No such company* | | `SUM_TAG("VFX")` | a tag | the total of accounts carrying it | *No such tag* | | `COUNT_TAG("VFX")` | a tag | how many accounts carry it | *No such tag* | | `SUBACCOUNT_QTY(2)` | a subaccount position | that subaccount's quantity | *No such subaccount* | | `ACCOUNT_QTY` | — | the current account's quantity | *No quantity specified* |
Two more take no argument and return a budget-wide total: **`NPC`** — net production costs, everything except markups — and **`GT`** — the grand total.
Arguments go in quotes and must match something that exists. A mismatch is an error, never a silent zero: the cell shows the message rather than a number you might trust.
**Availability is per field.** A function offered in one place is genuinely absent in another, which is the most surprising thing about the whole system:
- **`NPC` is valid as a markup base and refused in an account expression.** A budget total inside an account that feeds that total is circular, which is why. - **`GT` is not available anywhere in a budget.** It can only be used inside a variable.
So a formula copied from a markup into an account may stop working, and that is the reason rather than a mistake on your part.
Three more functions belong to **financing** rather than to a budget. They are offered in a financing plan's Amount field, and nowhere in a budget:
| Function | Argument | Returns | Resolves over | When it fails | | -------------------------- | --------- | ---------------------------------------------------------- | -------------------- | ----------------- | | `SUM_EFFECT("effect")` | an effect | the effect's total — each account total × its effect share | the connected budget | *No such effect* | | `SUM_COMPANY_F("company")` | a company | that company's total | the financing plan | *No such company* | | `SUM_TAG_F("tag")` | a tag | the total of entries carrying the tag | the financing plan | *No such tag* |
**The `_F` suffix is the whole distinction.** `SUM_COMPANY` and `SUM_TAG` add up the **budget**; `SUM_COMPANY_F` and `SUM_TAG_F` add up the **financing plan**. Reaching for the unsuffixed name in a financing amount gives you the budget's figure, which is a different number and usually not the one you meant.
`SUM_EFFECT` is the exception in the other direction: it has no budget counterpart, because in a budget effect totals are read as columns rather than calculated on — see [aggregate by company, tag or effect](/kb/article/aggregate-by-company-tag-or-effect).
`COUNT_COMPANY` and `COUNT_TAG` return **how many** rather than **how much** — useful where a charge is per line rather than per euro. Each counts exactly the rows its `SUM_` twin adds up, so `SUM_TAG("VFX") / COUNT_TAG("VFX")` is the average of what it summed.
A count is never blocked by a missing total: where `SUM_TAG` cannot give you a number because one of the accounts it covers has none, `COUNT_TAG` still answers.
Two functions were renamed: **`SUM_PROD` is now `SUM_COMPANY`** and **`COUNT_PROD` is now `COUNT_COMPANY`**. The old names are not accepted and a formula still using one will throw, so a budget carrying them needs the name changed — the arguments and the result are unchanged.
Markdown