• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Creating conditional formulas based on check boxes

Community Beginner ,
Jun 17, 2024 Jun 17, 2024

Copy link to clipboard

Copied

Hi all! I am trying to add in conditional formulas into a column to calculate FTEs depending on which box is clicked. The lecture & LAB@LEC rate for FTE is 0.003704 and the lab rate is 0.002778. So if they check the lecture box, then the FTE column will calculate FTE by multiplying the amount of hours entered into the hours column by 0.003704, but if the check the lab box it will multiply the hours by 0.002778. I have attached the file for reference. Can anyone give me some guidance?

 

Thanks so much!

TOPICS
PDF forms

Views

497

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
2 ACCEPTED SOLUTIONS
Community Expert ,
Jun 17, 2024 Jun 17, 2024

Copy link to clipboard

Copied

You don't need a conditional statement.  Name the Lab checkboxes the sames as the corresponding Lec checkboxes, then use the rates as the export values for the corresponding checkboxes.  Use a "Product of" calculation in the FTE column that multiplies the corresponding checkbox by the hours.  This article explains how to do it for addition, but it works for multiplication as well.

View solution in original post

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 17, 2024 Jun 17, 2024

Copy link to clipboard

Copied

Enter the 0 before the decimal place for one of the export values:  0.002778 and don't enter if for the other that has the same value:  .002778.  The check boxes will be mutually exclusive and the math in the calculation should remain the same.  This article describes how to anticipate field names when writing calculation scripts so you only have to enter it once, and this article is about calculation order, which might come into play with your form.

View solution in original post

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 17, 2024 Jun 17, 2024

Copy link to clipboard

Copied

You don't need a conditional statement.  Name the Lab checkboxes the sames as the corresponding Lec checkboxes, then use the rates as the export values for the corresponding checkboxes.  Use a "Product of" calculation in the FTE column that multiplies the corresponding checkbox by the hours.  This article explains how to do it for addition, but it works for multiplication as well.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 17, 2024 Jun 17, 2024

Copy link to clipboard

Copied

Oh my gosh, that's amazing! It worked! Now the only problem I ran into is that the LEC and LAB @ LEC rate have the same export value, so when I click on one the other is also selected. Can I fix it so only one can be checked at a time and they don't check simultaneously?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 17, 2024 Jun 17, 2024

Copy link to clipboard

Copied

Enter the 0 before the decimal place for one of the export values:  0.002778 and don't enter if for the other that has the same value:  .002778.  The check boxes will be mutually exclusive and the math in the calculation should remain the same.  This article describes how to anticipate field names when writing calculation scripts so you only have to enter it once, and this article is about calculation order, which might come into play with your form.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 17, 2024 Jun 17, 2024

Copy link to clipboard

Copied

There are two solid solutions to the "same export value" issue.  

1. Use radio buttons instead of checkboxes, with the "radiosInUnison" option. 

2. Use a calculation script. 

 

The calculation script will give you the best results, because it is the easiest to modify for future updates. 

It should be written as a document level function, which is called from the FTE field's custom calculation.  It can also be applied quickly and easily to all of the FTE fields by running a script from the console window. 

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 17, 2024 Jun 17, 2024

Copy link to clipboard

Copied

LATEST

Nevermind, I just added an extra decimal point and it worked. Thank you soooo much, you have no idea how helpful this will be for so many people!

Votes

Translate

Translate

Report

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