Budgeting
You can make an account follow a share of another account's total and repair the formula when the other account is deleted.
Some costs are a fixed share of another cost. With the `ACCOUNT` function, you use the total of another account in a formula. When that total changes, KOSMA recalculates the share.
Double-click an empty **Price/Unit** cell in the account you want to calculate as a share. KOSMA opens a menu with **Variables** and **Functions**, each with an arrow  for its submenu.
Choose **Functions**, then `ACCOUNT`, and click the account in the list. KOSMA writes the whole call into the cell, for example `ACCOUNT("9.02")` for account 9.02, Legal & Accounting.
Always pick the account from the list. The list shows each number with its name. After a renumbering, a number you remember can belong to a different account.
After KOSMA has written `ACCOUNT("9.02")`, type `*` followed by the share as a decimal with a point, for example `0.75`. Then set **Quantity** to 1 so that **Price/Unit** gives the whole cost. In the demo budget, the **Price/Unit** of account 9.03, Financing & Bank Costs, is 75 per cent of account 9.02:
With a total of 16,000 in account 9.02, KOSMA shows 12,000 for account 9.03.
**What the function returns.** `ACCOUNT` returns the account's total in the budget's default currency. If the account uses another currency, KOSMA converts its total. For an account with subaccounts, that is the sum of the subaccounts. `ACCOUNT` returns neither a **Subtotal** of the budget nor an account's quantity. To use a quantity, see [use quantities in formulas](/kb/article/use-quantities-in-formulas).
An account cannot use its own total, either directly or through a chain of formulas that leads back to it. KOSMA does not save such a formula and shows one of these messages:
This formula would make the account's total depend on itself, which creates a circular reference.
This formula creates a circular reference, so the change could not be saved.
Refer to an account whose total does not depend on this one. Moving the reference into a variable does not get around this: if a variable's formula contains `ACCOUNT`, KOSMA saves no account line that uses that variable.
**If you renumber the referenced account.** KOSMA changes the number in the formula. This also applies when you use **Renumber Budget Items**. The result stays the same.
The formula keeps its text, and the cell loses its value. KOSMA frames the cell in red. When you point at the cell, KOSMA shows:
Unknown part of expression
Formulas that use the total of the account with the empty cell are empty too. Only the formula that names the deleted account has a red frame. When you repair it, KOSMA recalculates the others.
Point the formula at another account. KOSMA recalculates the cell and removes the red frame. If you save a formula that still points at a deleted account, KOSMA shows **Unknown Reference** with **Ok**:
The expression "ACCOUNT("9.02") \* 0.75" refers to something that does not exist. Fix the formula to clear the error.
Markdown