# Error handling

## Infinity (division by zero?)

This error, more often known as "#DIV/0!", 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 that contains numeric values of zero.

**Common causes:**

Calculating margins or KPIs 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 built-in IF-statements to check the divisor:

`IF("DENOMINATOR"[0] = 0, 0, "NUMERATOR"[0] / "DENOMINATOR"[0]) `

`IF("Revenue"[0] = 0, 0, "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 own 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 never is met.

## 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