Mathematical as well as date and time functions are available in the Form Calculation widget and Update/Calculate Field conditional logic. You can use this guide as your reference to build perfect calculation forms.
To use math functions in Form Calculation or Update/Calculate Field
- Select the function icon in the formula editor.
- In the functions dialog, search and choose your desired function.
The functions’ arguments can either be fixed or variable from your form fields.
Here are the available functions:
Function | Description |
---|---|
abs() | Returns the absolute (positive) value of a number. abs(-100) = 100 |
acos() | Returns the arc cosine of a number. acos(0.5) = 1.05 |
asin() | Returns the arc sine of a number. asin(0.5) = 0.52 |
atan() | Returns the arc tangent of a number in radians. atan(1) = 0.7854 |
atan2() | Returns the arc tangent of two variables, similar to calculating the arc tangent of y/x. atan2(4, 8) = 0.4636 |
ceil() | Rounds a number up to the nearest integer. ceil(1.3) = 2 |
cos() | Returns the cosine of a number. cos(2) = -0.42 |
exp() | Returns e raised to the power of a given number. exp(1) = 2.7183 |
floor() | Rounds a number down to the nearest integer. floor(1.7) = 1 |
log() | Returns the natural logarithm of a number. log(2) = 0.69 |
max() | Returns the highest value from a set of numbers. max(4, 8, 2) = 8 |
min() | Returns the lowest value from a set of numbers. max(1, 2, 5) = 1 |
pow() | Returns a number raised to the power of a given exponent. pow(2, 3) = 8 |
random() | Generates a random float between 0 and 1. random() * 100 = a random number between 0 and 100 |
round() | Rounds a number to the nearest integer. round(2.5) = 3 |
sin() | Returns the sine of a number. sin(3) = 0.14 |
sqrt() | Returns the square root of a number. sqrt(25) = 5 |
tan() | Returns the tangent of a number. tan(45) = 1.62 |
E | Return the Euler’s number. E * 1 = 2.7183 |
LN2 | Returns the natural logarithm of 2. LN2 * 1 = 0.6931 |
LN10 | Returns the natural logarithm of 10. LN10 * 1 = 2.3026 |
LOG2E | Returns the base-2 logarithm of E. LOG2E * 1 = 1.4427 |
LOG10E | Returns the base-10 logarithm of E. LOG10E * 1 = 0.4343 |
PI | Returns the value of PI. PI * 1 = 3.1416 |
SQRT1_2 | Return the square root of 1/2. SQRT1_2 * 1 = 0.7071 |
SQRT2 | Return the square root of 2. SQRT2 * 1 = 1.4142 |
avg() | Returns the average of supplied numbers. avg(0, 2, 4) = 2 |
avgNoZero() | Returns the average of supplied numbers while excluding zeroes and empty fields. avgNoZero(0, 2, 4) = 3 |
count() | Returns the number of selected options in a Multiple Choice or Single Choice element. |
commaSeparate() | Include comma separators in large numbers. commaSeparate(1234567) = 1,234,567.00 |
dateString() | Converts a Date Picker‘s value (or epoch time in days) to a date string in “D M d Y” format. dateString({Date Picker}) returns the Date Picker’s date in “D M d Y” format, like Wed Dec 25 2030. |
addDays() | Adds days to a Date Picker or Appointment element’s value. addDays({Date Picker}, 2) returns the Date Picker’s date plus two days, like Fri Jan 19 2024. |
subtractDays() | Subtracts days from a Date Picker or Appointment element’s value. subtractDays({Appointment}, 2) returns the Appointment’s date minus two days, like Mon Jan 15 2024. |
nth() | Returns the nth largest value from a set of numbers. nth(2, 20, 30, 40) = 30 |
minutes() | Converts minutes to milliseconds. minutes(1) = 60000 |
hours() | Converts hours to milliseconds. hours(1) = 3600000 |
days() | Converts days to milliseconds. days(1) = 86400000 |
weeks() | Converts weeks to milliseconds. weeks(1) = 604800000 |
months() | Converts months to milliseconds. months(1) = 2592000000 |
Send Comment:
31 Comments:
11 days ago
Is there a way to calculate the total answered options using an Input Table Properties with Radio Button options?
I have about five tables with options from None (1) to Extreme (5). I need to store in a calculated field the total number of options answered and the value of each option (I already do that).
This is one of the formulas I have, but others change depending on the amount of answers.
SCORE = [(sum of n responses ( / n) - 1] x 25, where n is the number of completed responses.)
26 days ago
On the previous question, I found the answer...
Weight / ((Height/100) x (Height/100)) = BMI
26 days ago
How do I calculate a number Squared using the functions in a Widget?
I'm using the Medical Questionnaire Template, but adding Weight and Height number fields, plus then giving feedback based on these two parameters on the BMI, which needs to be calculated by BMI = weight (kg) / [height (m)]2
Please advise or assist
Thank you
27 days ago
Is there a way to calculate the total answered options using an Input Table Properties with Radio Button options?
I have about five tables with options from None (1) to Extreme (5). I need to store in a calculated field the total number of options answered and the value of each option (I already do that).
This is one of the formulas I have, but others change depending on the amount of answers.
SCORE = [(sum of n responses ( / n) - 1] x 25, where n is the number of completed responses.)
44 days ago
How do I make a retirement calculator ?
51 days ago
How can I calculate the duration using start datetime and end datetime?
In the form I am collecting start datetime and end datetime.
I need duration in the google calendar integration.
69 days ago
Is there a way to format a number field to show as currency?
92 days ago
Good Day
Please advise if Jotform Tables can do the following calculations:
1. Stamp Duty Calculation (whereby the Annual Rental, say $10,000 is taken, divided by 1000, answer is converted with ceiling up, multiply answer by 5,
2. Work out percentages for e.g what percentage is 300 square metre out of 1200 square metre
3. Work out Rate per square metre in rental market ( Rental is $10,000 and space leased is 350 square metre)
4. Work out the rental escalation of 7% over each of a 5 year lease starting with
$ 10,000 per month in Year 1
5. Deposit Payable (by taking the Deposit Amount Required, Less the Deposit on Hold, = Deposit Payable)
6. Given the Start Date, say 1 Oct 2024, and duration of the lease in months, for e.g 60 months, can Jotform Tables calculation the End Date of the lease
102 days ago
I would love it if you can add a TEXT or FIRST or LEFT function so that I can take the first three characters of a Postal Code to use in a lookup. EG client enters address with postal code of M6G 3E9
LEFT(M6G 3E9) = M6G
I calculate the first three characters as M6G so I can use that for area lookups.
109 days ago
Is there a substring() function or something similar?
117 days ago
I agree with other comments, string functions (like remove spaces) would be soooo helpful.
121 days ago
I would need the same functions as here: https://www.jotform.com/help/tables-advanced-formula-date-functions/#day
151 days ago
I want to calculate 75% of a number, how do I do that?
152 days ago
These numerical functions are pretty handy, but now we need some string functions. A find and replace function, substring function, and search function would all be extremely useful.
174 days ago
A countif function would be helpful, as in "count all answers in a table of quiz questions that = -2"
237 days ago
como le hago para que me salga la suma de todos los campos en el cuadro te calculo?
257 days ago
I think a mod function would be pretty handy. More date string options would be nice too. If I want the current month as a number, for example, there doesn't seem to be a good way to do it without a lot of manual calculation.
306 days ago
How do I define a field to calculate the total of two other fields (Field - Fields 2 = Total)
Assets - Liabilities = Net worth
More than a year ago
Survey with 40 single choice questions, possibility of 4 different alpha values (E, A, I, S)...how do I tally the results?
More than a year ago
Honestly, why is there not a function for: SUM(A-Z)?
More than a year ago
How do i calculate the answers in my quiz form to know the total correct answer?
Which function should i use in adding the value in the calculation widget?
More than a year ago
Is there a way to round to 2 decimals instead of to the integer?
More than a year ago
Description of the "date" function that returns the sequential number that represents a particular date is not listed. It should be between "commaSeparate()" and "dateString()".
More than a year ago
how to calculate survey responses, scale of 1-5
More than a year ago
How do i calculate the difference between to times. For instance, how much time passed from 8:30AM to 3:30 PM?