# Calculate - Mismatched brackets error

478
4
07-11-2021 06:41 PM
Occasional Contributor

I have a pretty complicated self scoring survey123 form, and I'm getting a mismatched brackets error for an equation that seems to not have mismatched brackets.

``1/(1+(pow(2.718,(10*(\${InletPerchLow}-0.5))))``

When I change to the following, I get an unexpected beginning of path.

``1/(1+pow((2.718,(10*(\${InletPerchLow}-0.5)))))``

4 Replies
by
MVP Esteemed Contributor

One of the problems with complex formulas in Survey123 is that it can often be easy to lose track of your formula. It might help to write it out in an IDE first to keep things straight.

``````1 / (
1 + (
pow(
2.718, (
10 * (
\${InletPerchLow)-0.5
)
)
)
)
<------ missing bracket``````

Writing out your expression as you have it written, it would appear you're missing a single ')' at the end.

- Josh Carlson
Kendall County GIS
Occasional Contributor

Thank you! When I add one on the end, then I receive the error:  Unexpected beginning of Path in expression

by
MVP Esteemed Contributor

I broke it out step by step, and it appears that it's the "1 / " that is the problem. Instead, try using this:

``pow((1+pow((2.718,(10*(\${InletPerchLow}-0.5))))), -1)``

It's mathematically equivalent, but Survey123 seems to not have a problem with doing it this way.

- Josh Carlson
Kendall County GIS
Occasional Contributor

Thank you! It appears that division has to be represented by "div" in the XLS form. I changed it to div and added the bracket you suggested and it worked!