Calculate Earliest Date from a Range of Inputted Dates

  • Profile Image
    wroccreative
    Asked on April 15, 2026 at 7:45 PM

    I have several Date Picker fields on my form (settings detailed below). I want a calculation that looks at the user input from 6 of these elements and determines the EARLIEST date in the set (of course, ignoring any empty fields). How would I go about doing this?

    Date Picker settings are the same across all instances:

    • Lite Mode enabled
    • "/" separator
    • MM-DD-YYYY formate
    • Default Date = NONE
    • Time limit = future only, 7 days a week
  • Profile Image
    Podo: Support Specialist
    Replied on April 15, 2026 at 7:46 PM

    Hi WROC,

    Thanks for reaching out to Jotform Support. I'm an AI assistant here to assist you.

    Let me help you with that:

    1. Use the Form Calculation widget or Update/Calculate Field for the calculation.
    2. Apply the min() function, since it returns the lowest value from a set of numbers.
    3. Convert each Date Picker value into a comparable date value, then include only the fields that have values in the calculation.

    The knowledge base confirms that date and time functions are available in Form Calculation and Update/Calculate Field, and it also confirms that min() is available for finding the lowest value. It also confirms that dateString() converts a Date Picker value to a date string.

    Available functions confirmed in the knowledge base:

    • min() returns the lowest value from a set of numbers.
    • dateString() converts a Date Picker value to a date string in D M d Y format.
    • avgNoZero() excludes zeroes and empty fields, but this is listed for averages, not dates.

    Important: the knowledge base does not provide a specific formula for comparing multiple Date Picker fields to return the earliest date while ignoring empty fields. It only confirms the available date and math functions.

    I don't know this information and our support team will handle your request.

    Reach out again if you need any other help.

  • Profile Image
    Rahul JotForm Support
    Replied on April 15, 2026 at 9:01 PM

    Hi wroccreative,

    I understand that you have multiple date fields in your form and would like to display the earliest date among them. I’ll need a little time to look into this and will get back to you as soon as possible.

  • Profile Image
    Rahul JotForm Support
    Replied on April 15, 2026 at 10:56 PM

    Hi wroccreative,

    Thanks for your patience while I looked into this. You can use a Form Calculation widget in your form to display the earliest date from your Input Date fields by using the min() with dateString() function in the formula. Here’s how you can set it up:

    1. In Form Builder, click on Add Element in the top-left corner.

    2. In the panel that opens on the left, go to the Widgets tab.

    3. Search for Form Calculation and drag it into your form.

    Calculate Earliest Date from a Range of Inputted Dates Image 1 Screenshot 80

    Now, let’s configure the formula in the Form Calculation widget. Here’s how you can do it:

    1. Click on the wand icon in the Form Calculation widget to open the formula editor.

    Calculate Earliest Date from a Range of Inputted Dates Image 2 Screenshot 91

    2. In the formula editor, click on the function f(x) icon.

    3. From the functions dialog, search for and select both dateString () and min () functions.

    Calculate Earliest Date from a Range of Inputted Dates Image 3 Screenshot 102

    4. Click on Add Field, then choose your desired date fields, separating each with a comma from the kaypad on your system.

    Calculate Earliest Date from a Range of Inputted Dates Image 4 Screenshot 113

    5. Click on each comma and make sure its type is set to Number (you’ll see this option just below the f(x) section).

    Calculate Earliest Date from a Range of Inputted Dates Image 5 Screenshot 124

    6. Finally, click Save.

    Calculate Earliest Date from a Range of Inputted Dates Image 6 Screenshot 135You can also clone my demo form 261048499704061 to review the added fields, their settings, the formula used in the widget, and how the result is displayed. You can check out the screencast below to see my results:

    Calculate Earliest Date from a Range of Inputted Dates Image 7 Screenshot 146 Note that this setup currently requires all date fields to be filled in. I’ll check with our team to see if there’s a way to ignore empty date fields and will update you as soon as I have more information.

    Give it a try and let me know how it goes!

  • Profile Image
    Rahul JotForm Support
    Replied on April 16, 2026 at 6:31 AM

    Hi wroccreative,

    I heard back from our team with an update. At the moment, this setup isn’t possible using a simple formula in the Form Calculation widget, as there’s no built-in way to conditionally include date field values. But, you can achieve this by adding a few additional fields and using conditional logic. Here’s how you can set it up:

    Step 1: Add supporting Date fields

    1. In Form Builder, click Add Element from the top-left corner.

    Calculate Earliest Date from a Range of Inputted Dates Image 1 Screenshot 120

    2. From the panel on the left, drag and drop a Date Picker field and label it as Date Today.

    3. Set its default value to Current Date.

    Calculate Earliest Date from a Range of Inputted Dates Image 2 Screenshot 131

    4. Add additional Date Picker fields for each of your existing date fields. Name them something like Placeholder + [Original Field Name].

    Calculate Earliest Date from a Range of Inputted Dates Image 3 Screenshot 142

    Step 2: Add conditions for when Date field is filled or empty

    1. In Form Builder, go to Settings from the top bar.

    2. Select Conditions from the left panel.

    3. Click + Add Condition.

    4. Select Update/calculate Field condition.

    Calculate Earliest Date from a Range of Inputted Dates Image 4 Screenshot 153

    5. Setup the condition when the Date field is filled, then click Save.

    Calculate Earliest Date from a Range of Inputted Dates Image 5 Screenshot 164

    6. Setup the condition when the Date field is empty, then click Save.

    Calculate Earliest Date from a Range of Inputted Dates Image 6 Screenshot 175

    Step 3: Add a Form Calculation widget for showing the earliest date among the input date

    1. In Form Builder, click Add Element from the top left corner.

    Calculate Earliest Date from a Range of Inputted Dates Image 7 Screenshot 186

    2. From the panel on the left, go to the Widgets tab.

    3. Drag and drop the Form Calculation widget into your form.

    Calculate Earliest Date from a Range of Inputted Dates Image 8 Screenshot 197

    4. Next, click on the wand icon to open the formula editor.

    5. Configure the formula to calculate the earliest date, then click Save.

    Calculate Earliest Date from a Range of Inputted Dates Image 9 Screenshot 208 Step 4: Hide unwanted form fields

    1. Click a Date Placeholder field.

    2. Then keep pressing the Ctrl key in the keyboard and click on other unwanted fields.

    3. Click Hide button at the top right corner of the screen.

    Calculate Earliest Date from a Range of Inputted Dates Image 10 Screenshot 219 You can also clone my demo form 261052457738966 to review the added fields, their configurations, and how everything works together. You can check out the screencast below to see my results:

    Calculate Earliest Date from a Range of Inputted Dates Image 11 Screenshot 2210 Give it a try and let me know how it goes.

Your Reply