Title: Count values
Last modified: August 30, 2016

---

# Count values

 *  Resolved [stevew1234](https://wordpress.org/support/users/stevew1234/)
 * (@stevew1234)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/count-values/)
 * I would like to count the number of fields with a given value. Is this possible?
   eg. in a survey with multiple questions I want to count the number with “Yes”
   as the response and another count for “No”.
 * [https://wordpress.org/plugins/calculated-fields-form/](https://wordpress.org/plugins/calculated-fields-form/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/count-values/#post-6621597)
 * Hi,
 * In this case you can insert a button at the end of the survey, with “Calculate”
   as the type of button, and a calculated field with the following equation:
 *     ```
       (function(){
       return jQuery('.fields input[type="radio"][value="Yes"]:checked').length;
       })()
       ```
   
 * and that’s all.
 * The previous equation requires that the value of the affirmative answers is: 
   Yes
 * Best regards

Viewing 1 replies (of 1 total)

The topic ‘Count values’ 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/)

## Tags

 * [count](https://wordpress.org/support/topic-tag/count/)
 * [field](https://wordpress.org/support/topic-tag/field/)
 * [values](https://wordpress.org/support/topic-tag/values/)

 * 1 reply
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/count-values/#post-6621597)
 * Status: resolved