Watch out for Nulls

Consider this (albeit fictional) formula:

One would expect that this would return either “Fruit” or “Not a fruit” depending upon the value of s1.

However, what happens if s1 is null?

The engine that Scribe uses to test equality will return null if one of the operators is null.

So :

<anything> == #NULL!  –>  #NULL!

And an ‘if’ statement using this test will also return #NULL!

So, if s1 is null, like this:

Then Scribe will behave like this:

The solution?

Nulls have to handled specifically, using the iserror() function:

Scribe Certified Partner
Scribe MVP

%d bloggers like this: