# Error handling

## #DIV!/0: DIVISION_BY_ZERO

This error occurs when a division by zero is attempted.

While this error may be caused by incorrect cell referencing or unintentional deletion of a referenced value, it is most often caused when division is attempted on a time series containing numeric values of zero.

**Common causes:**

Margins or KPIs are calculated based on a metric such as revenue that is occasionally zero.

Using calculations for subtotals, but where forecasts are missing.

To prevent this from happening, use our purpose-built function `ignore_div_zero(a/b)`

to check the divisor:

`ignore_div_zero(a/b)`

`ignore_div_zero("Gross profit"[0] / "Revenue"[0])`

In other words, if the denominator is zero, the function returns zero, avoiding the error. Otherwise, the function performs the division as intended.

## #INF_LOOP: Infinite loop detected, caused by a recursive back-reference

The `INF_LOOP`

error is caused by a formula entering a continuous, non-terminating loop. This error is commonly caused by recursive references in formulas, where a call refers back to itself either directly or indirectly, causing an endless loop.

**Common causes**

**Direct self-referencing:**A formula directly refers to a previous period in its row.**Indirect self-referencing:**A chain of cell references leads back to previous periods of the original row. With interconnected formulas, dependencies can create infinite loops.

The INF_LOOP error is often caused by a calculation referencing itself. As calculations have time-consistent formulas, an infinite loop continues without stopping because its termination condition is never met.

## #CANNOT_REFERENCE_FUTURE: You cannot make references to the future. Use zero or a negative number inside the square brackets

This error message is triggered when an attempt is made to reference a future period (positive index). In Francis, cells are referenced by (1) their row name and (2) their index relative to the current cell you are editing. It's important to note that Francis supports references only to cells within current or previous periods (i.e., non-positive indices).

**Common Causes**

**Forecast-based purchase orders:**When purchase orders in the current period are based on the forecasted sales of products in a future period.**Hiring based on future revenue forecasts:**When hiring decisions in the current period are made in anticipation of forecasted revenues in future periods.

**Recommended Solutions**

**Manual value entry:**Directly input the required values into your formulas.**Time-shifted referencing:**Adjust by lagging the values by the necessary time period. This method effectively shifts future values into the current period for valid referencing.

Last updated