Getting #Error in a formula field when using exponentiation

Published in Not-So-Secret Diary

Do you know that power should be integer number? Otherwise, you will get #Error in a formula field. It was a surprise for me because I didn't find something like POW or POWER function that accepts double power value. Luckily, Salesforce support EXP(returns the value of e to the specific power) and LN(returns the natural logarithm) functions in formula fields. Now when we know it all, let's think about how we can use it.

Mathematics will help us, based on the information that e ^ (ln a) = a, we can rewrite a ^ b to the next format:

A ^ B = e ^ (B * ln(A)) = EXP(B * LN(A))

Useful links:

Comments powered by CComment