PDF Editing Issues

Create a Rate Calculation in an Adobe Acrobat PDF Form

Steve KSteve K Nov 19, 2026 869 views

Question details

Create a calculated Rate field in a fillable PDF using the Total and Hours fields.

Create a Rate Calculation in an Adobe Acrobat PDF Form
Product
Adobe Acrobat
Device & OS
not provided
Scenario
A PDF form needs to calculate Rate as Total multiplied by 200,000 and divided by Hours.
Observed behavior
The Rate field should update from the entered values and remain blank when Hours is zero or empty.
Before you start

Open the fillable PDF in an Acrobat version that can edit forms, such as Acrobat Pro. Check the exact field names in Prepare a form; the script must match them.

Solution 1Recommended

Add a custom calculation script to the Rate field

Use this method to calculate the rate automatically while preventing division by zero.

1
Open the form editor

In Acrobat, open the PDF and select All tools > Prepare a form.

2
Check the field names

Select the Total and Hours fields and check their names in Properties. Also identify the field that will display the Rate.

3
Open the calculation settings

Double-click the Rate field, select the Calculate tab, and choose Custom calculation script. Click Edit.

4
Enter the script

In the JavaScript editor, enter: var total = Number(this.getField("Total").value); var hours = Number(this.getField("Hours").value); event.value = hours ? (total * 200000 / hours) : ""; Replace Total and Hours with the exact names of your form fields, then save the script and close the properties.

5
Test and save the form

Exit form editing or select Preview, enter values in Total and Hours, and check the Rate. Test Hours as zero and blank; Rate should be blank in both cases. Save the PDF.

Add a custom calculation script to the Rate field
Calculation order: If Total or Hours is itself calculated, use Prepare a form > More > Set field calculation order to place those fields before Rate.
Free Microsoft Office alternative

Work with PDFs and office documents in WPS Office

WPS Office is a free, lightweight alternative for viewing PDFs and working with office documents in a familiar interface. Its format compatibility makes it easy to bring existing files into your workflow. Use Acrobat to configure and test the custom PDF calculation described above.

Open and view PDF forms alongside office documentsCompatible with Microsoft Word, Excel, and PowerPoint formatsFamiliar interface for a smooth transition from Microsoft OfficeFree office tools in a lightweight package
microsoft office alternative - wps office

Frequently Asked Questions

What formula does the Rate field use?

The script calculates Rate as Total × 200,000 ÷ Hours. For example, Total of 10 and Hours of 40 produce a Rate of 50,000.

Why is the Rate field blank when Hours is zero?

The custom calculation script checks Hours before dividing. If Hours is zero or empty, it sets Rate to a blank value to avoid division by zero.

What if my fields have different names?

In Prepare a form, open each field's Properties to check its name. Replace "Total" and "Hours" in the script with those exact names.

Why doesn't Rate update after another calculated field changes?

In Prepare a form, open More > Set field calculation order and make sure any calculated Total or Hours fields appear before Rate.

Can every PDF viewer run the calculation script?

PDF viewers differ in their support for form JavaScript. Test the saved form in the viewer your recipients will use; Acrobat or Acrobat Reader with JavaScript enabled is a suitable place to start.