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:
26 Comments:
5 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.
23 days ago
Is there a way to format a number field to show as currency?
45 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
56 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.
63 days ago
Is there a substring() function or something similar?
71 days ago
I agree with other comments, string functions (like remove spaces) would be soooo helpful.
74 days ago
I would need the same functions as here: https://www.jotform.com/help/tables-advanced-formula-date-functions/#day
104 days ago
I want to calculate 75% of a number, how do I do that?
105 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.
128 days ago
A countif function would be helpful, as in "count all answers in a table of quiz questions that = -2"
191 days ago
como le hago para que me salga la suma de todos los campos en el cuadro te calculo?
210 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.
260 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?
More than a year ago
How I can calculate total number of jpg files upload in form and the number that still remains to add 100 files. I want to make a form for printing photos up to 100 files.
More than a year ago
How can I calculate the number of hours worked based on time
More than a year ago
Hi, I have this big equation that I am trying to put on jotform calculations and it doesn't seem to work. Would you be help out?
In the places of F4, E4 and D4 i would number fields to fill in.
=495/(1.0324-0.19077*log10(F4-E4)+0.15456*log10(D4))-450
More than a year ago
min function not working even on the template provided above.
More than a year ago
Is it possible to lock this widget so that a form user cannot mess with the formula calculations being done? I can ask them to not reconfigure the math completed in this field, but it would just be easier if they just didn't have the opportunity to do so.
Thanks!