> For the complete documentation index, see [llms.txt](https://docs.cascade.io/cascade/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cascade.io/cascade/cascade-faqs/functions-and-expressions/how-to-replace-null-values-with-0.md).

# How to replace null values with 0

By utilizing an [IF](/cascade/functions-and-expressions/functions/logical/if.md) Statement in conjunction with [ISNULL](/cascade/functions-and-expressions/functions/logical/isnull.md), you can easily replace any null values with 0.

<figure><img src="/files/nWB5qUgdkFnEb79bE6xm" alt=""><figcaption><p>Null values in a table</p></figcaption></figure>

The syntax for this is simply: IF(ISNULL(\[column]), 0, \[column]).

<figure><img src="/files/Svh4FqMJrts6rDUeylVe" alt=""><figcaption><p>Using the Expression Editor to write an <a href="/pages/-MYYVdWp5hn-zzPxldsW">IF</a> statement</p></figcaption></figure>

This statement will check to see if the value is null. If it is, it will replace it with 0; on the other hand, if not, it will preserve the original value in the column being tested.

<figure><img src="/files/odtcbHmohJgIvKYiTFFW" alt=""><figcaption><p>All null values are replaced with a zero in a calculated column</p></figcaption></figure>

{% hint style="info" %}
Remember to use the [Edit Columns](/cascade/tools/transform/editcolumns.md) tool to add a new calculated column with the [ISNULL](/cascade/functions-and-expressions/functions/logical/isnull.md) function.
{% endhint %}

## Another Method - [Find Replace](/cascade/tools/cleaning/findreplace.md)

You may also find it easier to use a [Find Replace](/cascade/tools/cleaning/findreplace.md) tool to replace all null values in the entire table, or in specific columns with your desired value; in our case, 0.

<figure><img src="/files/3XcvF6xZ2DKsCaQAe2ol" alt=""><figcaption><p>All null values are replaced with a zero in their origin column</p></figcaption></figure>

### Related Questions

<details>

<summary>How can I substitute null values with 0?</summary>

You can substitute null values with 0 by using an IF Statement in conjunction with ISNULL, or by using the Find Replace tool.

</details>

<details>

<summary>What is the IF syntax for replacing null values with 0?</summary>

The syntax to include in an IF statement to replace null values with 0 is IF(ISNULL(\[column]), 0, \[column]).

</details>

### Other Sources

{% content-ref url="/pages/-MYYVdWp5hn-zzPxldsW" %}
[IF](/cascade/functions-and-expressions/functions/logical/if.md)
{% endcontent-ref %}

{% content-ref url="/pages/-MYYX6Wm4hzIuIl0L3dq" %}
[ISNULL](/cascade/functions-and-expressions/functions/logical/isnull.md)
{% endcontent-ref %}

{% content-ref url="/pages/-MYR43cW3b1-7XM\_2Tsx" %}
[Find/Replace](/cascade/tools/cleaning/findreplace.md)
{% endcontent-ref %}
