---
schema_version: "1"
id: 779c019503f31faf7b33e475c619b0dbd544542186848fa6989621d69f3048f8
title: Subtract()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/ampscript/references/math/mc-ampscript-reference-math-subtract.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-math/mc-ampscript-reference-math-subtract.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 6072ef1bcf5dbb4c004bf98e9428a73330757398be229851a7aad99ff4608ce5
products:
  - AMPscript for Marketing Cloud
  - Marketing Cloud
---
# Subtract()

Returns the result of subtracting the second parameter from the first parameter.

## Availability

<table>
  <tr>
    <td>Marketing Cloud Engagement</td>
    <td>✅ Yes</td>
  </tr>
  <tr>
    <td>Marketing Cloud Next</td>
    <td>✅ Yes</td>
  </tr>
</table>

This function became available in Marketing Cloud Next during the Summer ’26 release (API version 67.0).

## Syntax

```
Subtract(minuend, subtrahend)
```

The `Subtract()` function has two parameters:

- `minuend` (number): Required. The initial number.
- `subtrahend` (number): Required. The number to subtract from the minuend.

## Usage

To use this function, pass it two numbers. The numbers can be positive or negative integer or decimal numbers.

```
%%=Subtract(512,256)=%%
```

The function returns the difference of the two numbers: `256`.
