How to Create a Custom Math Formula

Create your own custom math formulas inside of Adalo

Skill Level: Intermediate

Before You Begin

Walkthrough

Using Custom Formulas with Magic Text

When adding Magic Text, youโ€™ll notice the option "New Formula..." at the bottom of the menu. Selecting this will insert a "Custom Formula" chip into your text box. Follow these steps to use the formula:

  1. Click on the "Custom Formula" chip to open the formula editor.

  2. In the editor, you can type any number along with the following operators:

    • + for addition

    • - for subtraction

    • / for division

    • * or x for multiplication

    • ( ) for parentheses to group parts of the formula

  3. Insert Magic Numbers:

    • Magic Numbers use Number properties from your data, and you can filter them by Counts, Sums, Averages, etc., of related collections.

  4. Insert Functions:

    • The Magic Number icon also allows you to insert functions into your formulas. The following functions are supported:

Supported Functions

  • Round: Rounds a number to the nearest integer.

    ROUND(4.32) โ†’ 4
    ROUND(4.5) โ†’ 5
  • Integer (INT): Removes the decimals from a number (rounding down).

    INT(4.32) โ†’ 4
    INT(4.999) โ†’ 4
  • Absolute Value (ABS): Displays the absolute (positive) value of a number.

    ABS(-4.32) โ†’ 4.32
  • Square Root (SQRT): Displays the square root of a number.

    SQRT(9) โ†’ 3
  • Exponent (EXP): Raises one number to the power of another.

    EXP(3, 2) โ†’ 9 (which is 3ยฒ)
  • Random Number (RAND): Generates a random number between two specified values.

    RAND(0, 1) โ†’ A random number between 0 and 1
  • Logarithm (LOG): Displays the base 10 logarithm of a number.

    LOG(100) โ†’ 2

Example: Calculating Trip Cost Per Person

Letโ€™s say you want to calculate the cost of a trip per person using a custom math formula.

  1. Insert a text box.

  2. Select the Magic Text button (red accented letter).

  3. Choose "New Formula" from the popup menu.

  4. Click on the pencil icon to open the formula editor.

  5. Click the Magic Number icon and select Trip Cost.

  6. Enter / (to divide).

  7. Click the Magic Number icon again and select Group Size.

Now, your formula will divide the total trip cost by the group size.

Additional Tips

  • You can combine multiple Magic Numbers, operators, and functions in the same formula to create more complex calculations.

  • Custom formulas are flexibleโ€”tailor them to your specific needs by adjusting the numbers or properties from your database. Check out some used by our Adalo Makers Here.

Help

If you need additional help with this article, you can always ask in our community forum! Be sure to paste the link to this article in your post as well!

Last updated