The if function is incomplete but still give True as result

Copper Contributor

See the attached file Question about the if function.xlsx

 

I do not understand that =if(25-23;True;False) result is

5 Replies

@Harrie_Ribbers 

Excel regards 0 as FALSE and any other number as TRUE.

 

@Harrie_Ribbers 

The syntax of IF is IF(condition; value_if_true; value_if_false)

The function will return value_if_true if condition evaluates to TRUE, but also if it evaluates to a non-zero number.

If will return value_if_false if condition evaluates to FALSE, but also if it evaluates to 0.

 

In your example, condition evaluates to 25-23 = 2. Since this is non-zero, value_if_true is returned. This is used to return the last name if D11 contains a space, and the value of D11 itself if it doesn't contain a space.

Thanks for your quick response.
Thanks for your quick response.

@Harrie_Ribbers 

Other words, the equivalent of your IF() is

=25-23=0