# Math & Arithmetic

Formula Pro math functions with optional string concatenation support for formatted values.

***

## ADD / PLUS

Adds numbers together. With `enableStringConcatenation`, concatenates strings when operands are non-numeric.

**Syntax:** `ADD(operand1, operand2, ...)` or `PLUS(...)`

**Example:**

```
ADD(5, 10, 15)
```

**Result:** `30`

**Example:**

```
ADD(100, 50)
```

**Result:** `150`

***

## MINUS / SUBTRACT

Subtracts operands sequentially: first - second - third - ...

**Syntax:** `MINUS(operand1, operand2, ...)` or `SUBTRACT(...)`

**Example:**

```
MINUS(100, 30, 10)
```

**Result:** `60`

***

## MULTIPLY

Multiplies all operands. Returns product.

**Syntax:** `MULTIPLY(operand1, operand2, ...)`

**Example:**

```
MULTIPLY(5, 4, 2)
```

**Result:** `40`

***

## DIVIDE

Divides numbers. Wraps Formula.js DIVIDE (handles division by zero).

**Syntax:** `DIVIDE(numerator, denominator)`

**Example:**

```
DIVIDE(100, 4)
```

**Result:** `25`

***

## RAND\_BETWEEN

Returns a random integer between min and max (inclusive).

**Syntax:** `RAND_BETWEEN(min, max)`

**Example:**

```
RAND_BETWEEN(1, 100)
```

**Result:** (varies) e.g. `42`

***

## Comparison Operators

Formula Pro provides comparison functions that work with both numbers and strings:

| Function                 | Alias   | Description |
| ------------------------ | ------- | ----------- |
| EQUAL                    | IS      | `a === b`   |
| NOT\_EQUAL               | IS\_NOT | `a !== b`   |
| LESS\_THAN               |         | `a < b`     |
| LESS\_THAN\_OR\_EQUAL    |         | `a <= b`    |
| GREATER\_THAN            |         | `a > b`     |
| GREATER\_THAN\_OR\_EQUAL |         | `a >= b`    |

**Example:**

```
IF(GREATER_THAN({item's Number}, 10), "High", "Low")
```

**Example:**

```
IF(IS({item's Status}, "Done"), "Complete", "Incomplete")
```

***

## String Concatenation Mode

When `enableStringConcatenation` is enabled (in automation context), ADD and MINUS can concatenate strings:

* **ADD** with strings: concatenates without separator (e.g., `"A" + "B"` → `"AB"`)
* **MINUS** with strings: joins with `" - "` (e.g., `"A" - "B"` → `"A - B"`)

This supports formatted arithmetic patterns like `"A - 5"` where continued operations preserve the format.


---

# Agent Instructions: 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://formulapro.shadebridge.com/formula-pro/formula-pro-custom-functions/math.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.
