Complex Calculations

Below are some examples of calculations shared by the Adalo Community.

1. Rounding a Number to Nearest Hundredths Using *100/100

If you want to round a number to two decimal places manually, you can multiply it by 100, round it, and then divide by 100 again. For example, to round the number 12.34567 to two decimal places:

ROUND(12.34567 * 100) / 100

This calculation works by:

  • Multiplying 12.34567 by 100 → 1234.567

  • Rounding it to the nearest integer → 1235

  • Dividing by 100 to get it back to the original scale → 12.35


2. Calculating a Percentage Increase/Decrease

Let’s say you have a property for last year’s revenue and another for this year’s revenue, and you want to calculate the percentage increase:

((This_Year_Revenue - Last_Year_Revenue) / Last_Year_Revenue) * 100

This formula will:

  • Subtract last year’s revenue from this year’s revenue to get the difference.

  • Divide that difference by last year’s revenue to calculate the change as a decimal.

  • Multiply by 100 to convert the result to a percentage.


3. Compound Interest Formula

To calculate compound interest, where you have a principal amount, an interest rate, and a number of periods (e.g., years), you can use the formula:

Principal * (1 + Rate / 100)^Periods

For example, if you invest $1,000 at an annual interest rate of 5% for 3 years, the formula would look like this:

1000 * (1 + 5 / 100)^3

This will calculate the total value after interest is compounded over 3 years.


4. Combining Rounding with Other Functions

You might want to round a calculated percentage to one decimal place. For example, if you’re calculating the percentage completion of a task and want to round it:

ROUND((Completed_Tasks / Total_Tasks) * 100, 1)

This formula:

  • Divides the number of completed tasks by the total tasks to get the completion rate as a decimal.

  • Multiplies by 100 to convert it into a percentage.

  • Rounds the result to one decimal place.


5. Adjusting Time Based on User Hours

If you want to adjust the current date by a partial day based on the user’s hours, you can use this formula:

Current_Date + ((24 - User_Hours) / 24)

This formula works by:

  • Subtracting User_Hours from 24 to get the remaining hours in the day.

  • Dividing by 24 to convert the remaining hours into a fraction of a day.

  • Adding that fraction of a day to the Current_Date to adjust the time.


6. Simple Percentage Calculation

If you want to calculate what percentage a number (Part) is of a total (Total):

(Part / Total) * 100

For example, if you completed 30 tasks out of 50, the formula would be:

(30 / 50) * 100 → 60%

7. Adding Days to a Date

To calculate a new date by adding a certain number of days to the current date, you can use:

Current_Date + Days

For example, to add 7 days to today’s date:

Current_Date + 7

This will give you the date that’s 7 days from now.


8. Calculating a Discount

If you want to calculate the discounted price of an item, you can subtract the discount from the original price:

Original_Price - (Original_Price * Discount_Percentage / 100)

For example, if an item costs $100 and there is a 20% discount, the formula would be:

100 - (100 * 20 / 100) → $80

Last updated