Title: Dynamic checkbox value calculation
Last modified: January 12, 2022

---

# Dynamic checkbox value calculation

 *  Resolved [raj12345](https://wordpress.org/support/users/raj12345/)
 * (@raj12345)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/dynamic-checkbox-value-calculation/)
 * Is there a way to add custom calculations for checkboxes?
 * For example, if I have a checkbox with choice of 6 options – how can I make 2/
   6 free items i.e. ‘0’ value, but the other options with a value.
 * I understand this is possible to add set values for each item in the value field,
   but I would prefer if the any two ticked show 0 value, but any additional selected
   show additional values.
 * Is this possible?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/dynamic-checkbox-value-calculation/#post-15245732)
 * Hello [@raj12345](https://wordpress.org/support/users/raj12345/)
 * Yes, of course, that’s possible. Every choice in the checkbox field has two entry
   boxes for the choice value and text. For free choices enter the number 0 as their
   values, and the corresponding numbers in the other choices’ values.
 * To get the sum of the ticked choices, you should use only the field’s name.
 * For example, if the checkbox field is the fieldname1, and you want to get the
   sum of ticked choices, the equation associated with the calculated field would
   be:
 * `fieldname1`
 * Best regards.
 *  Thread Starter [raj12345](https://wordpress.org/support/users/raj12345/)
 * (@raj12345)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/dynamic-checkbox-value-calculation/#post-15248193)
 * Hi,
 * Many thanks for your support. My query was relating to something else, but your
   colleague has answered it via email support. I have shared their response below
   in case other users wanted to know the solution. Cheers.
 *     ```
       Hello,
   
       There are multiple alternatives, but if not matter the choices selected, the two first ticked are free, a possible solution would be to enter the number 1 as the choices' values, and I'll try to describe the equation with a hypothetical example:
   
       Assuming the checkbox field is the fieldname1, and the price for every additional checkbox (two first free) is $10, the equation can be implemented as follows:
   
       MAX(fieldname1-2,0)*10
       ```
   
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/dynamic-checkbox-value-calculation/#post-15248212)
 * Perfect !!!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Dynamic checkbox value calculation’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [4 years, 3 months ago](https://wordpress.org/support/topic/dynamic-checkbox-value-calculation/#post-15248212)
 * Status: resolved