# MINUS macro

The `MINUS`

macro
is available in Unica Campaign and Unica Interact.

## Syntax

```
data MINUS subtrahend data -
subtrahend
```

## Parameters

`data`

The
cell range containing numbers to subtract from. 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 product.

`subtrahend`

The
number(s) to subtract from 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 `subtrahend`

must
equal the number of columns in `data`

, unless `subtrahend`

is
a constant. For the format definition of `subtrahend`

(same
as `data`

), see the "Macro Function Parameters"
section in the chapter in this guide for your product.

## Description

`MINUS`

subtracts `subtrahend`

from
the specified data range `data`

. It returns a new column
for each input column, each containing the corresponding column in `data`

minus
the corresponding column of `subtrahend`

(that is,
the first column of `data`

subtracts the first column
of `subtrahend`

, the second column with the second
column, and so on).

If `subtrahend`

is a constant,
each value in `data`

is subtracts that value. If `subtrahend`

contains
one or more columns, the calculations are performed on a row-by-row
basis between one column from `data`

and one column
from `subtrahend`

. The first row of `data`

subtracts
the first row value of `subtrahend`

, 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.

`MINUS`

operator can be abbreviated
with a minus sign or hyphen (`-`

).## Examples

`TEMP = 7 MINUS 4` or `TEMP = 7 - 4` Creates
a new column named |

`TEMP = V1 - 8` Creates a new column named |

`TEMP = V1:V3 - 2` Creates three new columns
named |

`TEMP = V1 - V1` Creates a new column named |

`TEMP = V1 - V2` Creates a new column named |

`TEMP = V1:V3 -V4:V6` Creates three new columns
named |

`TEMP = V1[10:20] - V2` or ```
TEMP = V1[10:20]
- V2[1:11]
``` Creates a new column named |

## Related functions

Function | Description |
---|---|

`PLUS` |
Adds the contents of two data ranges |

`SUM` or `TOTAL` |
Computes the sum of a range of cells |