--- title: "sum (Addition)" slug: "calc-function-sum" updated: 2026-05-12T13:04:44Z published: 2026-05-12T13:04:44Z canonical: "docs.lobstersoftware.com/calc-function-sum" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # sum (Addition) *See als*o: [calc (Calculate expression)](/v1/docs/en/calc-function-calc) > [!NOTE] > The function $sum forms a sum over the passed parameters. The parameters can either be a fixed numeric value or another expression that returns a numeric value. You can use any number of parameters in this function. > > > [!TIP] > > Tooltip > > > > Syntax: *$sum(a[,b[,c[...]]])* > > > > | Parameter | Description | > > | --- | --- | > > | `a` | First summand, a value (e.g. "5"), a list (e.g. $el(3,true)) or a reference to a value (e.g. $el(3)). | > > | `other parameters` | Other summands of type a. | > > > > Example: $sum(3,5,7) – returns 15 ## Syntax *$sum(a [, b[, c[...]]])* ## Parameter | Name | Description | | --- | --- | | a | First summand, a value (e.g. " 5 "), a list (e.g. $el(3,true) ) or a reference to a value (e.g. $el(3) ). | | Other parameters | Other summands of type a. | ## Return value The result of the addition over all summands. ## Example The sum over the contents of the fields with the indices 2, 3 and 4. ```plaintext $sum( $el(2), $el(3), $el(4) ) ``` The sum over all fields of the repeating element with the id 4. ```plaintext $sum($el(4,true) ) ```