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

Question

Question

Forms Field Calculation - Math Problem includes 2 Multiply levels in one

asked on May 30, 2019

I can't seem to get Step 2 of this scenario and I'm hoping someone can help me with it: 

Step 1 formula is working and is:  =MULT(INDEX(Request_Details.Total_Days,ROW()),75)

Step 2 formula is not working:  (Total Days x 10) x Total Units

Step 3 formula is working and is:  =SUM(INDEX(Request_Details.SubTotalDays,ROW()),INDEX(Request_Details.SubTotalUnits,ROW()))

0 0

Replies

replied on May 30, 2019

Looks like you might just have an extra ( in front of the last INDEX function.

0 0
replied on May 31, 2019 Show version history

I've played with those and can't seem to find the right number of brackets in the right places.  I'm assuming I need an extra set of brackets around the first multiplication group, same as I would do in any math equation:

 

0 0
replied on May 31, 2019 Show version history

Your screenshot actually shows the issue, the brackets highlighted in red belong to the MULT function. Notice that it ends before that last INDEX function.

As a result, you're MULT ends with ,10 and doesn't include anything after that point so you have stray content causing syntax errors.

Since your Multiplying, you don't need to group individual pieces at all.

  1. Remove 1 of the left brackets between MULT and INDEX
  2. Remove both right brackets immediately after 10
  3. Remove the left bracket before the second INDEX
  4. Add 1 right bracket at the end

Just to save yourself trouble in the future, you don't want to start throwing brackets around because it will just cause more headaches.

Instead, build your calculations one piece/function at a time. For example, don't throw a bunch of indexes right into a MULT. Test an INDEX to make sure it gets you the value you want, then if so put it aside.

Then, build your MULT function with just placeholder values to test it out. If it works, copy and paste your INDEX functions in to replace the placeholders instead of having to try and count brackets and digging yourself in deeper.

1 0
replied on May 31, 2019

I think I translated this correctly.  Now instead of syntax error, I'm getting incorrect number of input parameters error.  ?  I wish there was a CPP course on this!

0 0
replied on May 31, 2019 Show version history

Actually, the formulas use OpenFormula, which is the same as what is used by Excel and other similar applications so it's not technically Forms specific.

It looks like MULT only accepts two values, use PRODUCT instead.

This page is helpful when you want to know requirements/formatting for the formulas.

1 0
replied on May 31, 2019 Show version history

Okay, I got it working by adding another hidden field so that the one field does not have to do two MULT functions within one formula (multiply this first then that).

Now, I will just hide the fields the applicant doesn't need to see.

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

Sign in to reply to this post.