Expression Pruning

This page in 2007
Top  Previous  Next

What is the difference between these two formulas?

=INDEX(B15:Z19,4,7)*INDEX(B25:Z29,2,4)

=H18*E26

The difference between them is at the same time

considerable, in that the second is much shorter and easier to understand

negligible, in that both formulas multiply the same cells together.

OAK provides facilities for taking formulas that use complicated conditional functions, such as CHOOSE, INDEX, VLOOKUP and OFFSET, and changing them so that they show the cells that are really involved.

Operis calls this action pruning because it decodes the formula and makes an internal representation that resembles a tree.

For example, =IF(A1>B2,C3+D4,E5*F6) is represented as

Pruning picture 1

Assuming that the value in cell A1 is larger than the value in cell B2, then the result of the IF will be C3+D4, the branch of the tree marked "then".  In such circumstances, OAK trims away the "test" and the "else" branches of the IF, and preserves simply the "then" branch, leaving a formula that is much easier to read.

Pruning picture 2

This expression pruning is offered by OAK in three contexts.

OAK's Formula | Prune Inactive Path  command will make transformations directly to the formula in the currently selected cells.

OAK's technologies for preparing reconstructions of formulas can generate long expressions as the hierarchy of precedent cells fans out.  This fan-out can be controlled by discarding the branches that are not active at any moment.  (It is for this purpose that the expression pruning was developed.)

Similarly, OAK's reports that explain the discrepancies between two cells can become very large due to precedent fan out, and the expression pruning can control this.