# Power Automate Functions - Mod, Div, Mul, Sub, Add, Max, Min Function

What is mod Function?

A function that returns the remainder after the division of any number

Create a New Flow:

Go to power automate select “Instant cloud floe” then select trigger option manually. Finally hi on create button.

For example:

For example, we have 20 total cars and out of total cars we have 6 cars are new cars. The remaining cars are old. Now we have to find how many cars are old?

Total / new

20/6

The remainder is 2.

Variable One:

First of all, initialize two variables one for total cars and the other for new cars having the below attributes:

Name: Total Cars

Type: integer

Values: 20

Variable two:
Name: New Cars
Type: integer
Values: 6

Now add ‘mod function in expression editor’:
Add a compose action in thirst step
mod(variables('Total Cars'),variables('New Cars'))
output:
Div Function
What is the Div function?
Div function is a device function. Used to make a division.
For example, we have 365 days in a year
We have 7 days in a week
We have to calculate how many weeks in a year?
In that case, we have to use the div function.
Days in Year = 365
Days in Week = 7
Week in Year?
Go to power automate create a new flow >> instant cloud flow >> trigger manually
Add a variable using initialize a variable with the following attributes
Name: Total Days In Year
Type: Integer
Value: 365

Calculate total Weeks in a Year?
Add a Compose action to calculate Total Weeks
Add ‘div function’ to compose action. Go to expression editor add following code there.
Code:
div(variables('Total Days In Year'),variables('Total Days In Week'))

Output:

Mul Function
What is mul function?
mul function is used to perform multiplication
Go to power automate create a new flow >> instant cloud flow >> trigger manually
Name: Total Weeks In A Year
Type: Integer
Value: 52
Name: Total Days In A Week
Type: Integer
Value: 7

Output:

Sub function
What is a sub-function?
Sub function is used to perform a subtraction between two integers or two bumpers
Go to power automate create a new flow >> instant cloud flow >> trigger manually
Name: First Number
Type: Integer
Value: 50

Name: Second Number
Type: Integer
Value: 25q qbn 1
\q’;/.p

Now add a Compose Action to perform Sub Function between two Numbers:Output:

Go to power automate create a new flow >> instant cloud flow >> trigger manually

Output:

Max Function
What is a max function?
Max function is used to find a greater number from the list
Go to power automate create a new flow >> instant cloud flow >> trigger manually
Name: First Number Max
Type: Integer
Value: 70

Name: Second Number Max
Type: Integer
Value: 60

Add Compose Action to perform Max Function:
Max function find a greater number from the list and return the maximum number

Output:

Min Function
What is Min Function?
Min function is used to minimum number from the list
Go to power automate create a new flow >> instant cloud flow >> trigger manually
Name: First Number Max
Type: Integer
Value: 70