PDF Editing Issues

How to Create a Yes/No Formula Based on Multiple Fields in Acrobat PDF

Bushra ParveenBushra Parveen Nov 5, 2026 868 views

Question details

The user wants to display 'YES' if any of several specific PDF form fields contain a value below 2, and 'NO' if none of the fields meet that condition.

How to Create a Yes/No Acrobat PDF Formula Based on Multiple Fields
Product
Adobe Acrobat PDF
Device & OS
not provided
Scenario
Creating dynamic PDF forms with conditional text values that evaluate multiple numerical inputs.
Observed behavior
A target form field needs to automatically output a 'YES' or 'NO' result using a custom formula or script that reads other specific fields.
Before you start

Ensure you have Adobe Acrobat Pro or a PDF editor that supports JavaScript calculations, and note down the exact names of all the form fields you intend to include in your formula.

Solution 1Recommended

Use a Custom JavaScript Calculation in Adobe Acrobat

Apply a custom JavaScript formula to your target field to evaluate an array of specific form fields and automatically return 'YES' or 'NO' based on their values.

PDF forms use JavaScript for advanced custom calculations. By grouping your target fields into an array, you can loop through them to check if any contain a value below your threshold.

1
Open Prepare Form mode

Open your document in Adobe Acrobat, navigate to the Tools menu, and select 'Prepare Form'.

2
Access field properties

Right-click the target text field where you want 'YES' or 'NO' to appear, and select 'Properties'.

3
Set calculation type

Navigate to the 'Calculate' tab in the Properties window and select the 'Custom calculation script' option.

4
Enter the custom script

Click the 'Edit' button and paste the following script: `var fields = ["Productivity Score", "Documentation Score", "Accuracy Score", "Feedback Score", "Monitors work Score", "Asks for help Score", "Job duties Score"]; var under2 = false; for (var i = 0; i < fields.length; i++) { var f = this.getField(fields[i]); if (f && f.valueAsString !== "" && Number(f.valueAsString) < 2) { under2 = true; break; } } event.value = under2 ? "YES" : "NO";`

5
Adjust field names and save

Replace the array strings with the exact names of your actual form fields. Click 'OK' to save the script, then close the Properties window to test the form.

Use a Custom JavaScript Calculation in Adobe Acrobat
Handling Empty Fields: The script specifically includes `f.valueAsString !== ""` so that empty fields are ignored and do not falsely trigger the 'below 2' condition.
Advanced PDF Editor

Edit and Manage PDF Forms Seamlessly with WPS Office

WPS Office provides a comprehensive PDF editor that allows you to effortlessly fill, edit, and manage interactive PDF forms, ensuring all built-in scripts and calculations function smoothly.

  1. 1. Launch WPS PDF: Open WPS Office and navigate to the 'PDF' tab to access the PDF editor.
  2. 2. Open your form: Click 'Open' and select the interactive PDF form that contains your custom calculations.
  3. 3. Fill the form: Input your data into the respective fields; the built-in formulas will execute automatically.
  4. 4. Save your document: Once completed, click the 'Save' icon or export the filled PDF to secure your data.
Easily fill and interact with complex PDF formsFully compatible with standard Adobe PDF formats and calculationsLightweight architecture for fast document loadingCross-platform support for Windows, Mac, iOS, and Android
microsoft office alternative - wps office

Frequently Asked Questions

Why is my PDF calculation script not updating automatically when I enter numbers?

You may need to check the field calculation order in your PDF editor. If a field calculates before the data fields it relies on have updated, it will show outdated results. You should also verify that 'Automatically calculate field values' is enabled in your software's preferences.

Can I change the threshold value in the provided formula?

Yes. To change the threshold, locate the `Number(f.valueAsString) < 2` section of the script and replace the number '2' with your required value.

Do custom PDF calculation scripts work in all PDF readers?

Most standard desktop PDF applications, such as Adobe Acrobat and WPS Office, fully support JavaScript calculations. However, some basic browser-based PDF viewers or mobile readers might not execute these scripts correctly.