PDF Editing Issues

Add Two PDF Form Fields and Multiply by a Fixed Rate

Steven ParkerSteven Parker Nov 19, 2026 869 views

Question details

Calculate a PDF form field by adding holiday and vacation hours and multiplying the total by a fixed rate of 11.

How to Add Two PDF Form Fields and Multiply by a Fixed Rate
Product
PDF form editor, such as Adobe Acrobat Pro
Device & OS
not provided
Scenario
A form needs to calculate a value from two hour fields using a fixed hourly rate.
Observed behavior
The current calculation uses only one of the two fields.
Before you start

Open the PDF in a form editor that supports custom calculation scripts. Check that the source field names are exactly "Holiday Hours MC" and "Vacation Hours MC", including spaces and capitalization.

Solution 1Recommended

Use a Custom Calculation Script in the PDF Form

Use this method to update the calculated field automatically when either hour value changes.

The script converts both field values to numbers before adding them, then multiplies their sum by 11.

1
Open the form editor

In Adobe Acrobat Pro, open the PDF and choose All tools > Prepare a form.

2
Open the result field properties

Double-click the field that should display the calculated result, then select the Calculate tab.

3
Enter the calculation script

Select Custom calculation script, click Edit, and enter: var holiday = Number(this.getField("Holiday Hours MC").value); var vacation = Number(this.getField("Vacation Hours MC").value); event.value = 11 * (holiday + vacation);

4
Save and test the form

Close the field properties, save the PDF, and enter values in both hour fields. For example, 2 holiday hours and 3 vacation hours should produce 55.

Use a Custom Calculation Script in the PDF Form
Check viewer support: The calculation requires a PDF viewer that supports form JavaScript and allows it to run. A calculated field may not update in every browser or PDF viewer.
Calculate hours in WPS Office

Calculate the Fixed-Rate Total in WPS Spreadsheets

Use WPS Spreadsheets to calculate the total from both hour values, then enter the result manually in a suitable PDF field. This workaround does not add an automatic calculation script to the PDF.

  1. 1. Enter the hour values: Open WPS Spreadsheets and enter holiday hours in cell A1 and vacation hours in cell B1.
  2. 2. Calculate the total: In cell C1, enter =(A1+B1)*11 and press Enter.
  3. 3. Transfer the result: Open the PDF in WPS Office and enter the value from C1 into a suitable editable result field. Recalculate and update it manually if the hours change.
Add holiday and vacation hours with a fixed-rate formula.Open and save Microsoft Excel XLSX workbooks.Open PDF files in WPS Office to review or fill supported fields.
microsoft office alternative - wps office

Frequently Asked Questions

Why does the script convert each field value to a number?

PDF form values may be stored as text. Number() converts them before addition so that, for example, 2 and 3 are added rather than joined as 23.

What if my PDF field names are different?

In Prepare a form, check each field's name in its properties. Replace the names inside getField() with the exact names used in your PDF.

What happens if an hour field is blank?

In this script, Number() converts an empty field value to 0, so the calculation can use the other field's value. Enter numeric values rather than text in the hour fields.

Why does the calculated field not update in my browser?

Some browser PDF viewers do not support PDF form JavaScript. Open the saved form in a compatible viewer with JavaScript enabled and test both source fields again.