# Math Functions examples in Power Automate Flow

Here are the examples of how you can use the Math Functions from Dynamic Content in a Power Automate Flow –

In this example, I’ll use the below Inputs to perform the Math Operations on and I’ll have the Math Functions perform in the Example of the functions shown below – ## Min()

Minimum gives out the smallest value in the Array of numbers.

1. Here, I’ve created an array of numbers and from this, I’m selecting the minimum value. 2. And the result is as below – ## Max()

Inversely as the Min() function above, the Max function will return the highest number from the Array or Collection –

1. Here’s how I use the Max function – 2. And the result of the Max function is as below – As it suggests, this is the addition function which will add the 2 numbers provided as arguments –

1. In the variable, I’ll look for add and enter the 2 arguments from the Manual Trigger i.e. passing values while running the Flow.
And as you can see below, I’m using add() function and passing the parameters separated by a comma. 2. Then, I’m passing the below arguments when I run the Flow. 3. And then I run the Flow, the result is as below – ## Sub()

As the function suggests, you can subtract number 2 from number 1. Here’s an example –

1. In the below Sub() function, I can see 2. And when I pass the below arguments 20 and 5 – 3. And the result will be 20 – 5 = 15. ## Rand()

Rand() function will give out a random number from the collection at each run. Hence, the result will vary on each run –

1. I’m providing the start number range and the end number range. And the function will select the a random number from within the range – 2. So, when I run it for the first time, I’ll get a number 3. And when I run it one more time, I’ll get a different number. ## Mul()

Mul() function will multiple the 2 numbers passed in the arguments –

1. I’m passing the 2 arguments within the function itself like I did for some of the above functions. 2. And the result will be as follows – ## Div()

Div function will divide the first number by the second one –

1. In this example, I’m providing the 2. And the result in this case is 25. ## Mod()

Mod() function will give the modulo / modulus or the division happening between the dividend and the divisor i.e. you’ll get the remainder value –

1. I’m supplying the below parameters which will give a modulus. 2. And the result obtained is the remainder of the division – ## Range()

Range() function will generate a range between –

1. The 2 arguments required by range() function are startIndex and count. Count meaning how many numbers you want in the array.
Notice the type of the variable has been changed to an Array now. 2. And the result is the below Array with 6 items in the Array starting from value 2. Hope this was useful!

Here are some Power Automate posts you want to check out –

Thank you!

## 2 thoughts on “Math Functions examples in Power Automate Flow”

1. Carl Williams says:

Thanks. Very useful.

Liked by 1 person

• priyeshwagh777 says:

I’m happy it’s useful for you.

Like

This site uses Akismet to reduce spam. Learn how your comment data is processed.