Addition operator (+)

Value1 + Value2

Value1

Number or { Number }

The number to add together with the other number (the first addend).

Value2

Number or { Number }

The number to add together with the other number (the second addend).

Returns

Number or { Number }

The sum of the numbers.

Adds two numbers together and returns the result. 2 + 42 + 4 returns 6.

This operator also works with arrays. { 1, 2 } + 6{ 1; 2 } + 6 returns the array { 7, 8 }{ 7; 8 } (equivalent to { 1 + 6, 2 + 6 }{ 1 + 6; 2 + 6 }) and { 1, 2 } + { 6, 7 }{ 1; 2 } + { 6; 7 } returns the array { 7, 9 }{ 7; 9 } (equivalent to { 1 + 6, 2 + 7 }{ 1 + 6; 2 + 7 }).

Adding together many values

The SUM function is equivalent to this operator. These formulas both return 6:

1 + 2 + 31 + 2 + 3
SUM(1, 2, 3)SUM(1; 2; 3)

However, SUM can be invoked with arrays with an arbitrary number of elements. To add all the field values of the Field1:Field3Field1:Field3 range together and return the result, use this formula:

SUM(Field1:Field3)SUM(Field1:Field3)

(The Field1:Field3Field1:Field3 range is a short-hand way of expressing an array containing Field1 and Field3, as well as any fields that appear between them, such as Field2. If only Field2 appears between the other two fields, Field1:Field3Field1:Field3 and { Field1, Field2, Field3 }{ Field1; Field2; Field3 } are equivalent.)

Using + for "logical or"

Spreadsheet users often use + to mean "logical or" (disjunction) when manipulating logical arrays. This formula returns those fields whose values are greater than 5 or are less than 2:

FILTER(Field1:Field3, (Field1:Field3 > 5) + (Field1:Field3 < 2))FILTER(Field1:Field3; (Field1:Field3 > 5) + (Field1:Field3 < 2))

Calcapp supports this usage of +, but its standard "logical or" operator || can also be used:

FILTER(Field1:Field3, (Field1:Field3 > 5) || (Field1:Field3 < 2))FILTER(Field1:Field3; (Field1:Field3 > 5) || (Field1:Field3 < 2))

Refer to the documentation of the || operator for an in-depth example.

Examples

2 + 42 + 4

Returns 6.

{ 1, 2 } + 6{ 1; 2 } + 6

Returns the array { 7, 8 }{ 7; 8 }, equivalent to { 1 + 6, 2 + 6 }{ 1 + 6; 2 + 6 }.

{ 1, 2 } + { 6, 7 }{ 1; 2 } + { 6; 7 }

Returns the array { 7, 9 }{ 7; 9 }, equivalent to { 1 + 6, 2 + 7 }{ 1 + 6; 2 + 7 }.

FILTER(Field1:Field3, (Field1:Field3 > 5) + (Field1:Field3 < 2))FILTER(Field1:Field3; (Field1:Field3 > 5) + (Field1:Field3 < 2))

Returns those fields whose values which are greater than 5 or less than 2.

FILTER(Field1:Field3, (Field1:Field3 > 5) || (Field1:Field3 < 2))FILTER(Field1:Field3; (Field1:Field3 > 5) || (Field1:Field3 < 2))

Returns those fields whose values which are greater than 5 or less than 2. This example uses the standard || Calcapp operator for "logical or" (disjunction) instead of the + operator.