Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Highlighted
##

Form Calculation: add a code to multiply a summed column

New Here
,

Aug 13, 2020

Copy link to clipboard

Copied

I am hoping to get help with a calculation to multiply a summed total by a fixed amount. The example is on a timesheet which totals the stipend for all staff . I would like to take the "project total field" and multiply it by .144 to calculate the cost of benefits plus wages. I was able to figure out the sum of the stipend but I cannot figure out how to multiply the stipend total.

Thanks in advance for any help!!

TOPICS

How to,
PDF forms

Community Guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Form Calculation: add a code to multiply a summed column

New Here
,

Aug 13, 2020

Copy link to clipboard

Copied

I am hoping to get help with a calculation to multiply a summed total by a fixed amount. The example is on a timesheet which totals the stipend for all staff . I would like to take the "project total field" and multiply it by .144 to calculate the cost of benefits plus wages. I was able to figure out the sum of the stipend but I cannot figure out how to multiply the stipend total.

Thanks in advance for any help!!

TOPICS

How to,
PDF forms

Community Guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

MzKinn

Aug 13, 2020
0
/t5/acrobat/form-calculation-add-a-code-to-multiply-a-summed-column/td-p/11358095
15
Replies
15

Adobe Community Professional
,

Aug 13, 2020

Copy link to clipboard

Copied

In the Project Total field you can use something like this:

```
var f= this.getField("Total");
var g = f.getArray();
var v = 0.0;
for (var i=0; i<=g.length; i++) {
event.value =
var subtotal = v += g[i].value;
event.value = subtotal +(subtotal*.144);
}
```

This example is using the **getArray()** method so it is intended to work if you have a parent field prefixed and all the children fields suffixed. If you use different fieldnames then you would need to employ a slightly different method to have the script calculate numerical fields with the **new Array()** method,for example.

For my example, every field under the Total Stipends column I renamed to "Total.1", "Total.2", "Total.3", etc. which made everything very easy and more organized. But this can be achieved in many other ways with JavaScript.

Community Guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Reply

Loading...

ls_rbls

Aug 13, 2020
0
/t5/acrobat/form-calculation-add-a-code-to-multiply-a-summed-column/m-p/11358330#M270793
Engaged
,

Aug 13, 2020

Copy link to clipboard

Copied

You want it to show result in total field? if yes then do like this:

if you just want to show .144 use: (field1+field2+field3)*.144

if you want to add .144 to "total" field sum use (field1+field2+field3)*1.144

Of course change field names to the names you are using.

Community Guidelines

Reply

Loading...

Nesa Nurani

Aug 13, 2020
0
/t5/acrobat/form-calculation-add-a-code-to-multiply-a-summed-column/m-p/11358335#M270795
New Here
,

Aug 14, 2020

Copy link to clipboard

Copied

is not working for me...clearly user error! I am stumped and perhaps

overthinking the process.

--

Robin Kinn

Administrative Assistant

Park Community Charter School

509 Lawe Street | Kaukauna, WI 54130

kinnr@kaukaunasd.org | 920.766.6129

Community Guidelines

Reply

Loading...

MzKinn

Aug 14, 2020
0
/t5/acrobat/form-calculation-add-a-code-to-multiply-a-summed-column/m-p/11360207#M270980
Explorer
,

Aug 14, 2020

Copy link to clipboard

Copied

Community Guidelines

Reply

Loading...

Marietaa

Aug 14, 2020
0
/t5/acrobat/form-calculation-add-a-code-to-multiply-a-summed-column/m-p/11360232#M270985
New Here
,

Aug 14, 2020

Copy link to clipboard

Copied

multiply in the same field? #calculationnewbie

Thanks, for the help!

--

Robin Kinn

Administrative Assistant

Park Community Charter School

509 Lawe Street | Kaukauna, WI 54130

kinnr@kaukaunasd.org | 920.766.6129

Community Guidelines

Reply

Loading...

MzKinn

Aug 14, 2020
0
/t5/acrobat/form-calculation-add-a-code-to-multiply-a-summed-column/m-p/11360245#M270988
Explorer
,

Aug 14, 2020

Copy link to clipboard

Copied

You can use simplified field notation and write your field names (field1+field2) *. 144

Community Guidelines

Reply

Loading...

Marietaa

Aug 14, 2020
1
/t5/acrobat/form-calculation-add-a-code-to-multiply-a-summed-column/m-p/11360258#M270990
Adobe Community Professional
,

Aug 14, 2020

Copy link to clipboard

Copied

Hey Nesa and Marietta:

I just noticed in the equations that you've posted, if you're employing the Simplified Field Notation method for the Total Project field, this is only calulating the total cost of benefits plus wages.

The Total Cost of Project is actually a Grand Total, not the cost of benefit plus wages. So the formula should be

Grand Total = Total Stipends +(Total Stipends * .144)

You need to add all of the stipend fields together then multipliy that total by .144; AND THEN, add the total SUM of all stipend fields. Otherwise, the current calculation only outputs the total for the cost of benefits plus wages.

It should be phrased like this :

`field1+field2+field3+field4+field5+field6+field7+field8 +((field1+field2+field3+field4+field5+field6+field7+field8)*.144) `

Community Guidelines

Reply

Loading...

ls_rbls

Aug 14, 2020
0
/t5/acrobat/form-calculation-add-a-code-to-multiply-a-summed-column/m-p/11360503#M271011
New Here
,

Aug 14, 2020

Copy link to clipboard

Copied

errors; cannot figure out what I am missing.

I appreciate your patience and assistance!!

--

Robin Kinn

Administrative Assistant

Park Community Charter School

509 Lawe Street | Kaukauna, WI 54130

kinnr@kaukaunasd.org | 920.766.6129

Community Guidelines

Reply

Loading...

MzKinn

Aug 14, 2020
0
/t5/acrobat/form-calculation-add-a-code-to-multiply-a-summed-column/m-p/11360556#M271016
Adobe Community Professional
,

Aug 14, 2020

Copy link to clipboard

Copied

We are just posting examples for the field names.

With your document opened in Acrobat, clicl on "Prepare Form" then verify what are the fieldnames that you used in the form under the Total Stipends column.

The fieldnames that you assigned must be spelled exaclty the same way in whatever method of scripting or calculation you employ.

See slide below:

Community Guidelines

Reply

Loading...

ls_rbls

Aug 14, 2020
0
/t5/acrobat/form-calculation-add-a-code-to-multiply-a-summed-column/m-p/11360701#M271030
New Here
,

Aug 14, 2020

Copy link to clipboard

Copied

--

Robin Kinn

Administrative Assistant

Park Community Charter School

509 Lawe Street | Kaukauna, WI 54130

kinnr@kaukaunasd.org | 920.766.6129

Community Guidelines

Reply

Loading...

MzKinn

Aug 14, 2020
0
/t5/acrobat/form-calculation-add-a-code-to-multiply-a-summed-column/m-p/11360721#M271032
Adobe Community Professional
,

Aug 14, 2020

Copy link to clipboard

Copied

Community Guidelines

Reply

Loading...

ls_rbls

Aug 14, 2020
0
/t5/acrobat/form-calculation-add-a-code-to-multiply-a-summed-column/m-p/11360749#M271035
Adobe Community Professional
,

Aug 14, 2020

Copy link to clipboard

Copied

Share an example of how you named those fields.

That is why I specified in my initial reply about prefixing and suffixing.

If you've employed a field name that prefix a name like this : "**Stipends.1**" (without the quotes, of course) then you can't use this field name in the Simplified field notation.

Spaces, periods, underscores, dashes (or any other special characters that you've used for a field name) must be escaped with a back slash ( \ ) when you use Simplified Field Notation.

For example : **Stipends\.1 + Stipends\.2**

If your field names are prefixed, and you want to use Simplified Field Notation, then you need to phrase it like this:

`Stipends\.1 + Stipends\.2 + Stipends\.3 + Stipends\.4 + Stipends\.5 + Stipends\.6 + Stipends\.7 + Stipends\.8) +((Stipends\.1 + Stipends\.2 + Stipends\.3 + Stipends\.4 + Stipends\.5 + Stipends\.6 + Stipends\.7 + Stipends\.8) +)*.144) `

Now, be advised that using Simplified Field Notation won't rond down the value automatically , it will always round up automatically. While this is convenient you may want to consider how to work around this if you need the total to be precise, specially on governement forms .

Community Guidelines

Reply

Loading...

ls_rbls

Aug 14, 2020
0
/t5/acrobat/form-calculation-add-a-code-to-multiply-a-summed-column/m-p/11360779#M271036
Engaged
,

Aug 14, 2020

Copy link to clipboard

Copied

Community Guidelines

Reply

Loading...

Nesa Nurani

Aug 14, 2020
0
/t5/acrobat/form-calculation-add-a-code-to-multiply-a-summed-column/m-p/11360841#M271046
Adobe Community Professional
,

Aug 14, 2020

Copy link to clipboard

Copied

Totally agree.

Community Guidelines

Reply

Loading...

ls_rbls

Aug 14, 2020
0
/t5/acrobat/form-calculation-add-a-code-to-multiply-a-summed-column/m-p/11360861#M271049
MzKinn
LATEST

New Here
,

Aug 14, 2020

Copy link to clipboard

Copied

I feel this is probably something simple and I am just completely missing

it.

--

Robin Kinn

Administrative Assistant

Park Community Charter School

509 Lawe Street | Kaukauna, WI 54130

kinnr@kaukaunasd.org | 920.766.6129

Community Guidelines

Reply

Loading...

MzKinn

Aug 14, 2020
0
/t5/acrobat/form-calculation-add-a-code-to-multiply-a-summed-column/m-p/11360889#M271050
Resources

About Adobe Acrobat

Adobe Inc

Adobe Inc

Adobe Inc

Adobe Acrobat Feature & Workflow

FAQs

Using the Community
Experience League
Terms of Use
Privacy Policy
Cookie preferences
AdChoices
Language:

- Deutsch
- English
- Español
- Français
- 日本語コミュニティ
- Português

Copyright © 2020 Adobe. All rights reserved.