When building out your sheets in Adaptive Insights it is critical to keep in mind the sheet’s load time and performance. There are many ways to improve load time of your sheets, one of which is to optimize the DIV and IF functions.
DIV vs DIVF
By adding an ‘F’ at the end of the DIV function, your DIVF function will evaluate faster than the previous DIV function. Both functions have the same syntax:
- DIV( N, D )
- DIVF( N, D )
The DIV function is used to help avoid errors that occur when a function divides by 0 with a valid numerator. In a normal N/D formula if the denominator is 0, it will generate an error. With the DIV function, if the denominator is 0, it will return a 0. If the numerator of the function throws an error the DIV function will produce that error as well.
The reason DIVF evaluates faster than its counterpart is because it will evaluate the denominator portion first, and if its value is 0, the function will not continue to evaluate. Even if the numerator throws an error, the DIVF function will return a 0.
The below Formula Pane screenshots illustrate the differences:
N/D Formula
- IF ACCT.SN.SN_Quantity = 0, then, answer = Zero Denominator Error.
- IF ACCT.SN.SN_ASP = Error1, then, answer = Error1.
DIV Formula
- IF ACCT.SN.SN_Quantity = 0, then, answer = 0.
- IF ACCT.SN.SN_ASP = Error1, then, answer = Error1.
DIVF Formula
- IF ACCT.SN.SN_Quantity = 0, then, answer = 0.
- IF ACCT.SN.SN_ASP = Error1, then, answer = 0.
IF vs IFF
Similarly, to the DIV function, by adding an ‘F’ at the end of the IF formula, your IFF formula will evaluate faster than the previous IF formula. Both functions also have the same syntax:
- IF( x, y )
- IFF( x, y )
The IFF formula evaluates the ‘x’ condition first and if that condition is met the formula does not evaluate the ‘y’ condition, whereas the IF formula evaluates the entire formula every time ( ‘x’ and ‘y’ conditions).
The below IF formula would be evaluated from top to bottom:
In the below IFF formula, if the Yellow section conditions are met, then the formula produces the Green section and the evaluation ends. The Red section is only evaluated if the Yellow section conditions are not met.
It is good practice to create the initial formulas with the DIV and IF statements to test that both conditions are working correctly. Once validated, it is recommended to use the DIVF and IFF statements.
A nice side note to help remember the differences; In both cases the additional ‘F’ stands for FAST!