Add to formula

This utility allows the user to add another IF statement to a preexisting formula. In Figure 1, cell A20 is selected. It already has a formula in it which is:

=IF(OR(ISERROR($A$8),ISBLANK($A$8)),””,$A8)

When this cell is selected, and the Add to Formula utility is run, the form automatically retrieves the source cell (A8) that the formula is referring to. If there are multiple source cells, the utility picks the first one. The user can then set what value this cell should equal (or any other comparator function can be typed here, including a more complicated formula involving multiple source cells for evaluation) for the target cell to be set to the new user defined value (typed in the “Value or Formula” field). Likewise, the user is free to enter a single numeric value or even another formula if they so wish.

Figure 1: In this example, cell A20 is selected. The formula in this cell is referring to another cell (A8). The Add to Formula function allows the user to add an Excel If statement to the formula such that it checks if the value of A8 meets the condition you type in the condition box (in this example A8=0). If you have selected the option True in the “Value or formula if condition is” section, then if A8 equals 0, the value of A20 will be set to whatever value you type in the “Value or Formula Field”. In this example the value is set to equal “1e-10” or 1 x 10-10. If the condition evaluates as false, then the original formula that was in A8 {=IF(OR(ISERROR($A$8),ISBLANK($A$8)),””,$A8)} will be used.

In our example, we want the formula in A20 to give the value 1 x 10-10 if A8 equals 0 otherwise we want the original formula to be active for all other values.

Therefore, the condition is A8=0

And the Value or Formula is equal to 1e-10 (this is the way scientific notation is entered in Excel). Finally, we want this value to be set if the condition is True, so we leave the “Value or Formula if condition is” option box set to True as shown in Figure 1.

After pushing the OK button, A20’s formula will now be:

=IF(A8=0,0.0000000001,IF(OR(ISERROR($A$8),ISBLANK($A$8)),””,$A$8))

The text in blue is the new If statement with the condition and value that has been added to the formula by the Add to Formula utility. In summary, this little utility helps simplify the building of more complex Excel IF formulas and can be used sequentially to create difficult to construct formulas which can be confusing to write in a single attempt inside an empty cell.

If the user enters a formula that does not evaluate correctly then the following error message will be displayed.

Likewise, if the user has multiple cells selected and they try to run this utility then the following error message will be displayed.

Scroll to Top