> 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

Use an IF statement or Find Replace tool to replace null values

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="https://2577551913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MW_FvcY52Jcyt8JHFGs%2Fuploads%2FtWQnVKQHRCjDJ4hRtn89%2FReplace%20null%20values%20with%200-1.png?alt=media&amp;token=752f458c-e37d-4e28-befa-8b77324928c9" 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="https://2577551913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MW_FvcY52Jcyt8JHFGs%2Fuploads%2FGu1Xmlw8B5Fk9NdaBT8w%2FReplace%20null%20values%20with%200-2.png?alt=media&amp;token=55c70d37-8065-4d59-8704-df7366417913" alt=""><figcaption><p>Using the Expression Editor to write an <a href="/cascade/functions-and-expressions/functions/logical/if.md">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="https://2577551913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MW_FvcY52Jcyt8JHFGs%2Fuploads%2FH07U6gWLktqTVcGyN6r9%2FReplace%20null%20values%20with%200-3.png?alt=media&amp;token=1ab68928-d19f-4856-87bc-f6e8ecb0e002" 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="https://2577551913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MW_FvcY52Jcyt8JHFGs%2Fuploads%2FADGUa4SG2XZqqJNO8OIS%2FReplace%20null%20values%20with%200-4.png?alt=media&amp;token=01bddf1f-e9b9-4932-a97b-6cb284fcdce5" 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 %}
