PDF Editing Issues

Calculate Yes, No, and NA Radio Button Totals in Adobe Acrobat

Amos GikundaAmos Gikunda Nov 19, 2026 868 views

Question details

Calculate separate totals for Yes, No, and NA selections across radio-button groups in an Acrobat PDF form.

Calculate Yes, No, and NA Radio Button Totals in Adobe Acrobat
Product
Adobe Acrobat
Device & OS
not provided
Scenario
A PDF form contains radio-button groups named Group1 through Group48 and needs a total for each response.
Observed behavior
Each total field should count groups whose selected export value matches Yes, No, or NA.
Before you start

Open the PDF in Acrobat and use Prepare a form to check that the groups are named Group1 through Group48. Verify that their radio-button export values are exactly Yes, No, and NA.

Solution 1Recommended

Count each response with an Acrobat custom calculation script

Use a calculation script in each total field to count the selected value of every radio-button group.

The script reads the value of each parent radio-button group directly. Do not call getField("Yes") on the group field object.

1
Open the form editor

In Acrobat, open the PDF and select All tools > Prepare a form. Add three text fields for the Yes, No, and NA totals if they do not already exist.

2
Add the Yes calculation

Open the Yes total field's Properties, select Calculate, choose Custom calculation script, and click Edit. Enter: var total = 0; for (var i = 1; i <= 48; i++) { if (this.getField("Group" + i).valueAsString == "Yes") total++; } event.value = total;

3
Add the other calculations

Open the Calculate tab for the No total field and add the same script, replacing "Yes" with "No". Repeat for the NA total field, replacing "Yes" with "NA".

4
Test the totals

Close the field properties, preview the form, and select different responses in several groups. Confirm that each total changes to match the selections.

Count each response with an Acrobat custom calculation script
Match the form's field names and values: Change the loop limit or field-name prefix if your form differs. Unselected groups are not counted because their value does not match Yes, No, or NA.
Free Microsoft Office alternative

Use WPS Office for PDF and spreadsheet workflows

WPS Office is a free, lightweight alternative with a familiar interface for working with PDFs and Office files. It does not fix Acrobat calculation scripts, but you can use WPS Spreadsheets to count responses recorded in a worksheet.

Count worksheet responses with spreadsheet formulasOpen and edit compatible Microsoft Excel XLSX filesWork with PDF and office documents in one applicationMove familiar Office files into a lightweight workspace
microsoft office alternative - wps office

Frequently Asked Questions

Why does calling getField("Yes") on the radio group fail?

The parent radio group is already a field object. Read this.getField("Group" + i).valueAsString and compare it with "Yes" instead of calling getField on that object.

How do I count No or NA instead of Yes?

In each total field's Properties > Calculate > Custom calculation script, use the same loop and replace "Yes" with the exact export value "No" or "NA".

What if my form has fewer than 48 groups?

Change the loop limit from 48 to the number of consecutively named groups in your form. Also change the "Group" prefix if your field names use a different prefix.

Why is a selected response missing from the total?

In Prepare a form, check the radio button's export value and its group name. The script compares the export value exactly, so a different spelling or capitalization will not match.