> For the complete documentation index, see [llms.txt](https://docs.valq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.valq.com/model/formula-functions/math-functions/sum.md).

# SUM

The SUM function returns the sum of all numbers in the arguments, which can be numbers or node references.

### Syntax

SUM(value1, ...valueN?) - > number

### Arguments

<table><thead><tr><th width="159">Arguments</th><th width="148">Datatype</th><th>Description</th></tr></thead><tbody><tr><td>value1</td><td>Number/Node reference</td><td>The first node or number to be added. This is a required argument.</td></tr><tr><td>...valueN?</td><td>Number/Node reference</td><td>The additional nodes or numbers to be added. These are optional arguments.</td></tr></tbody></table>

### Example

Consider sales of a particular product across different regions East, South, Central and West to be as follows. The total sales is to be calculated.

<figure><img src="/files/2mVNLAwLGwjTavWDtlYL" alt=""><figcaption></figcaption></figure>

To achieve this, the following formula should be written in the \[Total Sales] node:

<mark style="color:blue;">**`SUM`**</mark>**`(`**<mark style="color:purple;">**`[East],`**</mark><mark style="color:orange;">**`[South]`**</mark>**`,`**<mark style="color:red;">**`[Central]`**</mark>**`,`**<mark style="color:green;">**`[West]`**</mark>**`)`**

### **Result**

<figure><img src="/files/S7M69eNERIucSIzuoSsy" alt=""><figcaption><p><strong>Sum</strong></p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.valq.com/model/formula-functions/math-functions/sum.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
