Find trending topics and quick answers here

Hi, how can we help?

There no matching results.

Can my online form calculate my customers’ age

Question

Can my online form calculate my customers’ age?


Answer

Yes, PlatoForms enables you to calculate a customer’s age based on their input. All you need to do is utilize the Text Input field and conditional logic.

Here’s how you can do it:

  1. Add two Text Input fields, setting them both as “Date” type:

    add text input fields

    • One for the customer’s birthday, named “Birthday”.

    • Another for today’s date, named “Today”. Make sure to hide this field so customers don’t see it.

      add birthday date and today’s date

  2. For the field “Today”, set its “Initial Value” to Today's Date.

    set “Initial Value” to `Today’s Date

  3. Add a text input field named “Result”. Make sure to hide this field so customers don’t see it.

    text input for result

  4. Add a text input field named “Age”, and open its properties panel.

    text input for age

    • Set it as “Number” type.

    • Check Currency.

    • Click Decimal places and select ROUND from the dropdown.

    In this way, the calculated age can be rounded to a whole number.

  5. Set up conditional logic, as shown below:

    set “Initial Value” to `Today’s Date

    If the customer’s birthday (#birthday) is answered, the form will automatically calculate their age. It does this by finding the difference in days between today’s date and the birthday entered by the customer. Then, it divides this difference by 365 (the approximate number of days in a year) to get the customer’s age. Finally, it displays this age in the “Age” field on the form.

Result

Let’s say today’s date is April 14, 2024, and a customer enters their birthday as January 1, 1990, into the form.

check final age result

  1. The form calculates the difference between today’s date (April 14, 2024) and the customer’s birthday (January 1, 1990):

    • Days between April 14, 2024, and January 1, 1990 = 12,175 days
  2. Then, it divides this difference by 365 (approximate days in a year) to get the customer’s age:

    • Age = 12,175 days / 365 days per year ≈ 33.32 years (round up to 34)

So, the form would display the customer’s age as 34 in the “Age” field.


Have more questions? Visit our FAQs page or contact us.