I am trying to convert a formula that I use in excel to Survey 123 Connect. Has anybody found a way to ^ (caret) for Exponential (power of)?
Hi Michael,
You can use the pow() function to do such calculations.
For example if question_one was equal to 2, pow(${question_one}, 3) would return 2 to the power of 3, or 2 * 2 * 2 = 8.
Kind regards,
Mikie
Still hitting a wall, can I send you file see if you can help with the formula?
Hi Michael,
See attached Excel file for a sample of how this function can be used.
type | name | label | readonly | calculation |
decimal | DecimalNumber | Number | ||
integer | ToThePowerOf | To The Power Of | ||
decimal | CalcResult | Result | yes | pow(${DecimalNumber}, ${ToThePowerOf}) |
The results doesn't necessarily have to be read only.
Mikie
(Observed*(((Static-20)^0.54)/((Static-Residual)^0.54))) |
That is the expression in excel spelled out. The observed(1061) comes from a previous formula and the static(90) along with residual(60) are hydrant readings final should be 1677.
(${Observed}*(pow(${Static}-20), 0.54)div(pow(${Static}-${Residual}), 0.54))
Hi Michael,
It looks like you may have some parenthesis misplaced. Because pow() is a function, you can probably eliminate a few of the parenthesis from the Excel equivalent as it will self-enforce order of operations by executing an expression in a parameter first. Additionally, you don't need to group the numerator terms - multiplication won't be affected by order (and since execution order is left to right, the multiplication will technically happen before the division anyways). This should be the equivalent in XLSform:
${Observed} * pow(${Static}-20, 0.54) div pow(${Static} - ${Residual}, 0.54)
That was it, I was over complicating the formula