Capital allocation functions

Decide whether capital earns its keep.

Syntax

Write the function's name and its arguments. Rates are fractions, so 8 percent is 0.08.

WACC(equity, debt, cost_of_equity, cost_of_debt, tax_rate)
CAPM(risk_free_rate, beta, market_return)
COST_OF_DEBT(interest_rate, tax_rate)
NOPAT(ebit, tax_rate)
ROIC(nopat, invested_capital)
ECONOMIC_PROFIT(roic, wacc, invested_capital)
EVA(nopat, wacc, capital_invested)
SHARPE_RATIO(portfolio_return, risk_free_rate, std_dev)
INVESTED_CAPITAL(inventory, net_book_value, prepaid, working_capital)
VALUE_AT_RISK(
  portfolio_value,
  mean_return,
  std_dev,
  confidence,
  time_horizon
)

Parameters and arguments

Arguments are written in brackets, separated by commas. An argument in square brackets is optional.

  • WACC

    equity

    Required: Yes
  • debt

    Required: Yes
  • cost_of_equity

    Required: Yes
  • cost_of_debt

    Required: Yes
  • tax_rate

    Required: Yes
  • CAPM

    risk_free_rate

    Required: Yes
  • beta

    Required: Yes
  • market_return

    Required: Yes
  • COST_OF_DEBT

    interest_rate

    Required: Yes
  • tax_rate

    Required: Yes
  • NOPAT

    ebit

    Required: Yes
  • tax_rate

    Required: Yes
  • ROIC

    nopat

    Required: Yes
  • invested_capital

    Required: Yes
  • ECONOMIC_PROFIT

    roic

    Required: Yes
  • wacc

    Required: Yes
  • invested_capital

    Required: Yes
  • EVA

    nopat

    Required: Yes
  • wacc

    Required: Yes
  • capital_invested

    Required: Yes
  • SHARPE_RATIO

    portfolio_return

    Required: Yes
  • risk_free_rate

    Required: Yes
  • std_dev

    Required: Yes
  • INVESTED_CAPITAL

    inventory

    Required: Yes
  • net_book_value

    Required: Yes
  • prepaid

    Required: Yes
  • working_capital

    Required: Yes
  • VALUE_AT_RISK

    portfolio_value

    Required: Yes
  • mean_return

    Required: Yes
  • std_dev

    Required: Yes
  • confidence

    Required: Yes
  • time_horizon

    Required: Yes

Examples

A business funded by 600 of equity and 400 of debt: the cost of equity from the market, the cost of debt after tax and the blended cost.

Return type and behaviour

Each function returns one value. The table shows its type, what it does and one way to write it; the examples use the functions in realistic statements.

FunctionReturnsBehaviourForm
WACCdecimalThe weighted average cost of capitalWACC(600, 400, 0.1, 0.05, 0.3)
CAPMdecimalThe expected return on the assetCAPM(0.03, 1.2, 0.08)
COST_OF_DEBTdecimalThe cost of debt after taxCOST_OF_DEBT(0.06, 0.3)
NOPATdecimalOperating profit after taxNOPAT(100, 0.3)
ROICdecimalThe return on invested capitalROIC(100, 1000)
ECONOMIC_PROFITdecimalThe profit above the cost of capitalECONOMIC_PROFIT(0.12, 0.08, 1000)
EVAdecimalEconomic value added: operating profit less the charge for capitalEVA(100, 0.08, 1000)
SHARPE_RATIOdecimalThe return above the risk free rate for each unit of riskSHARPE_RATIO(0.1, 0.03, 0.15)
INVESTED_CAPITALdecimalThe capital tied up in the business: the four amounts addedINVESTED_CAPITAL(500000, 700000, 50000, 200000)
VALUE_AT_RISKdecimalThe value at risk: a negative amount, the loss that is not exceeded at the confidenceVALUE_AT_RISK(1000000, 0.001, 0.02, 0.95, 10)
Errors and exceptions
ErrorWhat happenedHow to recover
HTQL-5001The function was given the wrong number of arguments. The message names the function and the countsGive it the arguments listed under Parameters
HTQL-1004 Unsupported functionThe name is not a function this engine runsCheck the name and its spelling against this entry
HTQL-5004 Not enough paramsAn argument is missing. The message lists the names the function expectsGive every argument it lists
HTQL-5005An argument is not allowed, such as a standard deviation of 0 or capital of 0, or a finance function's result passed inPass a positive number that you typed in
Limitations
  • WACC takes the value of equity and of debt as amounts, and the rates as fractions.
  • The functions take values you supply. They do not read your records.
  • A capital amount, the total capital of WACC or the standard deviation of SHARPE_RATIO must be positive, or the function answers HTQL-5005 (for example "Invested capital must be positive").
  • Coming: a finance function's result cannot be an argument of another finance function: WACC(600, 400, CAPM(0.03, 1.2, 0.08), 0.05, 0.3) and ROIC(NOPAT(150, 0.3), 1000) answer [HTQL-5005] Invalid params for FinanceFunctions: Expected number, got Func(Finance(…)). Type the value in, as the examples do; the result can be compared in IF, MULTIPLY and DIVIDE.
Permissions and security

These functions read nothing from your tables and write nothing.

When a function is applied to a column or a variable, the statement that reads the data needs read access, as its own entry says.

Best practices
  • Compare ROIC with WACC: value is created when it is higher.
  • Use the same tax rate throughout a calculation.