You are viewing limited content. For full access, please sign in.

Question

Question

Nested IF formula in "Forms" table

asked on August 1, 2022

My goal is for the cell (for the lack of a better work in LF jargon) to be blank until V_2__2022_Actual_Gross_Receipts is populated, and for the calculation to then produce that result when it is not blank as explained in the screenshot above.

 

This is the formula I am using; it calculates the nested formula and I get 50.00 even when the cell I referenced is blank…

=IF(INDEX(Supplemental_Calculation.V_2__2022_Actual_Gross_Receipts,ROW())<>"",IF(INDEX(Supplemental_Calculation.V_4__Tax_Amount,ROW())<50,50,INDEX(Supplemental_Calculation.V_4__Tax_Amount,ROW())),"")

I know the nested formula works as I get that result here as well as when I use it on its own, without the other part of the formula included at all.

 

This formula works correctly and does not calculate the nested formula if the Business Type is blank, so I know I must be using the correct syntax...

=IF(INDEX(Supplemental_Calculation.V_1__Business_Type,ROW())<>"",IF(INDEX(Supplemental_Calculation.V_4__Tax_Amount,ROW())<50,50,INDEX(Supplemental_Calculation.V_4__Tax_Amount,ROW())),"")

 

I have verified the variable name is the one associated with the field I’m using, and am using that exact variable in another formula (below) where it works correctly…

=MULT(INDEX(Supplemental_Calculation.V_2__2022_Actual_Gross_Receipts,ROW()),INDEX(Supplemental_Calculation.V_3__Tax_Rate,ROW()))

 

The V_2__2022_Actual_Gross_Receipts field type is “Currency” as is the field where I’m using the formula that does not work.  V_1__Business_Type, that does work, is “Single Line”, if that matters.

 

Thanks!

0 0

Replies

replied on August 2, 2022

You might try ISBLANK instead of comparing against "" (empty string). Not sure currency would evaluate as empty instead of null. I believe ISBLANK checks for both.

0 0
replied on August 3, 2022 Show version history

Why not handle this with javascript? 

I could do the following:

  • Give your table a class name of "table"
  • Actual Gross field a class name of "actualGross"
  • True tax field a class name of "trueTax"

 

Add the following code:

 

$(document).ready(function () {
    $('.table').on('change', '.actualGross input', function(){
      var actualGross = $(this).val();
      var trueTax = $(this).parents('tr').find('.trueTax input');
      if (actualGross > 0)
      {
        trueTax.val(50);
      } else if (actualGross <= 0 || !actualGross )
      {
        trueTax.val('');
      }
    }); 
}); 

I think that should get the work done. Hope that helps!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.