# Power Automate Sub Function Explained The Power Automate Sub function lets you subtract two numbers.

Its counterpart is the add function that lets you compute the sum of two numbers.

In this article, I’ll introduce you to the sub function and will provide a step-by-step guide on how to use the function in a Microsoft flow.

Power Automate Sub Function

## Power Automate Sub Function

Retrieve the outcome of subtracting the second number from the first number.

### Syntax

``sub(<minuend>, <subtrahend>)``

#### Input parameters

• minuend (mandatory): The number from which the subtrahend will be subtracted.
• subtrahend (mandatory): The number which will be subtracted from the minuend.

#### Return value

• Returns the difference between the first and second numbers.

### Power Automate Sub Example

``````sub(3,1)
=> 2  // 3-1=2

// sample with use of a variable

sub(variables('myNumber'),1)``````

## How To Use The Power Automate Sub Function

Follow the steps to use the Power Automate sub function in a flow.

1. #### Create a new flow with trigger ‘Manually trigger a flow’ New flow

2. #### Add a new step by clicking on ‘+ New step’ 3. #### Search for ‘initialize’ and click on ‘Initialize variable’ 4. #### Setup Initialize variable: 1) Provide a name, 2) select type Integer, 3) Set value to 3 Setup variable

5. #### Add a compose by searching for ‘compose’ and clicking on ‘Compose’   