PLUS macro

The PLUS macro is available in HCL® Campaign and HCL Interact.

Syntax

data PLUS addend data + addend

Parameters

data

The cell range containing numbers to add. This can be a constant value, a column, a cell range, or an expression evaluating to any of the above. For the format definition of data, see the "Macro Function Parameters" section in the chapter in this guide for your HCL product.

addend

The number(s) to add to all values in the specified column. This can be a constant value, a column, a cell range, or an expression evaluating to any of the above. The number of columns in data2 must equal the number of columns in data1, unless data2 is a constant. For the format definition of addend (same as data), see the "Macro Function Parameters" section in the chapter in this guide for your HCL product.

Description

PLUS adds the values in the two specified data ranges. It returns a new column for each input column, each containing the corresponding column in data1 summed with the corresponding column of data2 (that is, the first column of data1 is added to the first column of data, the second column with the second column, and so on).

If data2 is a constant, each value in data1 increased by that value. If data2 contains one or more columns, the calculations are performed on a row-by-row basis between one column from data2 and one column from data2. The first row of data1 is added to the first row value of data2, the second row with the second row, and so on. This row-by-row calculation produces a result for each row up to the last value of the shortest column.

Note: The PLUS operator can be abbreviated with a plus sign ( +).

Examples

TEMP = 3 PLUS 4 or TEMP = 3 + 4

Creates a new column named TEMP containing the value seven.

TEMP = V1 + 8

Creates a new column named TEMP, where each value is the contents of column V1 plus eight.

TEMP = V1 + V1

Creates a new column named TEMP containing two times the contents of column V1.

TEMP = V1 + V2

Creates a new column named TEMP, where each value is the row value of column V1 plus the corresponding row value of column V2.

TEMP = V1:V3 + V4:V6

Creates three new columns named TEMP, VX, and VY. The column TEMP contains the values in V1 plus the corresponding row values of column V4. The column VX sums columns V2 and V5. The column VY sums column V5 and V6.

TEMP = V1[10:20] + V2 or TEMP = V1[10:20] + V2[1:11]

Creates a new column named TEMP, where the first 11 cells contain the sums of the values in rows 10-20 of column v1 and the values in rows 1-11 of column V2. The other cells in TEMP are empty.

Related functions

Function Description
MINUS Subtracts one specified data range from another
SUM or TOTAL Computes the sum of a range of cells