How to Calculate a Percentage Based on Answered Acrobat Form Questions
Question details
A user needs a survey form to calculate a percentage score using exclusively answered radio-button questions, ensuring that skipped or unanswered questions do not negatively impact the total possible score.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating an interactive dynamic PDF survey or quiz form where the maximum score adjusts based on completion.
- Observed behavior
- By default, the form calculates the percentage against a fixed total of all questions, but it needs to dynamically adjust the denominator to only include questions the user actually answered.
Ensure you have access to a PDF editor with advanced form creation capabilities like Adobe Acrobat Pro, and verify that all your survey radio button groups follow a consistent naming convention (e.g., Question1, Question2).
Use a Custom JavaScript Calculation Script (Recommended)
Implement a custom loop script in your percentage field to count exactly how many question groups have been answered, dynamically adjusting the maximum possible score.
This solution works by iterating through your named question fields. It checks if a radio button group is answered (i.e., its value is not 'Off'). It then tallies the total score and divides it only by the maximum score of the answered questions.
Open your PDF form in Adobe Acrobat, navigate to the 'Tools' menu, and select 'Prepare Form' to enable field editing.
Right-click on the text field where you want the final percentage to display, and select 'Properties' from the context menu.
Navigate to the 'Calculate' tab in the Properties dialog. Choose the 'Custom calculation script' radio button, then click the 'Edit' button.
Enter the following JavaScript code (assuming questions are named Question1 to Question10 and the max score per question is 5): var total = 0; var answered = 0; for (var i = 1; i <= 10; i++) { var value = this.getField('Question' + i).value; if (value != 'Off') { total += Number(value); answered++; } } event.value = answered && total != 0 ? (total / (answered * 5)) * 100 : '';
Click 'OK' to save the script, close the Properties dialog, and use the 'Preview' mode to test selecting different radio buttons to ensure the percentage updates accurately.

Add an 'N/A' Default Option for Unanswered Questions
Provide a default 'Not Applicable' or 'Unanswered' radio button option for each question that equals zero, preventing empty fields from breaking the calculation.
Easily Fill and Manage PDF Forms with WPS Office
WPS Office offers a comprehensive, lightweight PDF editor that allows you to seamlessly view, fill, and manage interactive PDF forms. Whether you're answering survey questions or managing document layouts, WPS Office provides an intuitive interface for all your PDF needs.
- 1. Launch WPS Office: Open the WPS Office desktop application and select 'PDF Edit' from the main dashboard.
- 2. Open Your PDF Form: Click 'Open' and browse your files to select the interactive PDF survey or form you need to fill out.
- 3. Fill Form Fields: Click directly on the highlighted text boxes, radio buttons, or checkboxes to input your answers.
- 4. Save and Export: Go to 'Menu' > 'Save As' to save your completed form, or share it directly via email.

Frequently Asked Questions
Why does my PDF form calculation show a blank result or an error?
A blank result usually occurs if the field names referenced in your JavaScript (e.g., 'Question1') do not exactly match the actual names of your form fields, or if there is a division by zero error because no questions have been answered yet.
Can I apply this calculation script to checkboxes instead of radio buttons?
Yes, but checkboxes return different export values depending on how you set them up (often 'Yes' or 'Off'). You must ensure the 'if (value != 'Off')' condition in the script matches your specific checkbox export values.
How do I change the maximum score per question in the calculation script?
In the formula '(total / (answered * 5)) * 100', the number '5' represents the maximum score per question. You can change this number to match the highest possible export value assigned to your radio buttons.
Do custom JavaScript form calculations work on mobile PDF readers?
Custom JavaScript support varies widely among mobile PDF apps. While Adobe Acrobat Reader for mobile supports many basic calculation scripts, third-party apps or built-in OS viewers may ignore the code entirely. It is recommended to fill these forms on a desktop environment for guaranteed functionality.




