Run calculations in your Make scenarios with Math Functions

Make's wide variety of math functions allow you to add numbers together, round numbers to the nearest integer, calculate an average, and more. In this post, we'll show you how to use math functions in Make (formerly Integromat).

Written by
Matt Jasinski
and

December 14, 2022

A few simple calculations can be the difference between a perfect workflow automation and a frustrating tool that doesnā€™t do what you need it to.Ā 

Make (formerly Integromat) gives you an extensive selection of math operations that you can use in any text field in your scenarios.Ā 

You can use these functions to add numbers, round off a decimal point, find the average value in a set of numbers, or even generate a random value.Ā 

In this post, weā€™ll show you how to perform each of these functions with short, step-by-step tutorials. Weā€™ll use a Slack module as an example, so the result of every function will be sent as a Slack message.Ā 

Add numbers together

With the ā€œsumā€ function, Make will calculate the sum of every number you enter between the parentheses. Hereā€™s how it works:

ā€¢ Open any text field in your scenario

ā€¢ Select the X1 symbol to access math functions

ā€¢ Click on the ā€˜sumā€™ function to add it to your selected field

ā€¢ Enter the numbers you want to add together, separated by semicolons

ā€¢ Alternatively, you can enter an array of numbers to add together

ā€¢ Run the module to output the sumĀ 

Round decimal values to whole numbers

Makeā€™s ā€œroundā€ function will round any number with a decimal point to the nearest whole integer. For example, 3.7 would be rounded to 4, while 7.23 would be rounded to 7. To use the round function:

ā€¢ Open any text field in your scenario

ā€¢ Select the X1 symbol to access math functions

ā€¢ Click on the ā€œroundā€ function to add it to your selected field

ā€¢ Enter the number you want to round between the parentheses

ā€¢ Run the module, and the output will include the number rounded to the nearest integer

Find the average of a set of numbersĀ 

Make lets you easily calculate the average of several numbers with this simple function. Just enter an array of numbers or values separated by semicolons to calculate the mean. For example, the average of 5, 6, and 7 would be 6.Ā 

ā€¢ Open any text field in your scenario

ā€¢ Select the X1 symbol to access math functions

ā€¢ Click on the ā€œaverageā€ function to add it to your selected field

ā€¢ Enter the numbers that you want to use, separated by a semicolon

ā€¢ Alternatively, you can enter an array of numbersĀ 

ā€¢ Run the module to output the average

Generating a random number

Generating a random number can be a useful technique for many automated workflows. To create one in Make, all you have to do is use the prebuilt variable called ā€œrandomā€. Hereā€™s how it works:

ā€¢ Open any text field in your scenario

ā€¢ Select the X1 symbol to access math functions

ā€¢ Click on the ā€œrandomā€ variable to add it to your selected field

ā€¢ Run the module to generate a random number between 0 and 1

Generating a number between 0 and 100

In many cases, it will be more appropriate to generate a whole number between 0 and 100 rather than a decimal value between 0 and 1. To do that, you just need to multiply the ā€œrandomā€ variable by 100 and round the result.Ā 

ā€¢ Open any text field in your scenario

ā€¢ Select the X1 symbol to access math functions

ā€¢ Click on the ā€œroundā€ function to add it to your selected field

ā€¢ Add the ā€œrandomā€ variable between the parentheses of the ā€œroundā€ function

ā€¢ Click on the green multiplication symbol to multiply the ā€œrandomā€ variable by 100

ā€¢ Run the module to check your result

Build more advanced scenarios with math functions

Using Makeā€™s math functions will let you build more sophisticated automations that transform your data and respond effectively to different circumstances. The functions in this post are just a sample of whatā€™s available; try exploring the rest to discover everything you can do with these tools.

If youā€™d like to learn more about workflow automation with tools like Make and Zapier, check out our blog or our YouTube channel. You can also follow XRay on Twitter, Facebook, or LinkedIn.

ā€

Similar Blog Posts

Not sure where to start with automation?

Hop on a 15-minute call with an XRay automation consultant to discuss your options and learn more about how we can help your team to get more done.

Schedule a 15-Minute Call