The if function is incomplete but still give True as result

%3CLINGO-SUB%20id%3D%22lingo-sub-1803560%22%20slang%3D%22en-US%22%3EThe%20if%20function%20is%20incomplete%20but%20still%20give%20True%20as%20result%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1803560%22%20slang%3D%22en-US%22%3E%3CP%3ESee%20the%20attached%20file%20Question%20about%20the%20if%20function.xlsx%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20do%20not%20understand%20that%20%3Dif(25-23%3BTrue%3BFalse)%20result%20is%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1803560%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1803971%22%20slang%3D%22en-US%22%3ERe%3A%20The%20if%20function%20is%20incomplete%20but%20still%20give%20True%20as%20result%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1803971%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F840637%22%20target%3D%22_blank%22%3E%40Harrie_Ribbers%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EExcel%20regards%200%20as%20FALSE%20and%20any%20other%20number%20as%20TRUE.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1803972%22%20slang%3D%22en-US%22%3ERe%3A%20The%20if%20function%20is%20incomplete%20but%20still%20give%20True%20as%20result%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1803972%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F840637%22%20target%3D%22_blank%22%3E%40Harrie_Ribbers%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20syntax%20of%20IF%20is%20IF(%3CEM%3Econdition%3C%2FEM%3E%3B%20%3CEM%3Evalue_if_true%3C%2FEM%3E%3B%20%3CEM%3Evalue_if_false%3C%2FEM%3E)%3C%2FP%3E%0A%3CP%3EThe%20function%20will%20return%20%3CEM%3Evalue_if_true%3C%2FEM%3E%20if%20%3CEM%3Econdition%3C%2FEM%3E%20evaluates%20to%20TRUE%2C%20but%20also%20if%20it%20evaluates%20to%20a%20non-zero%20number.%3C%2FP%3E%0A%3CP%3EIf%20will%20return%20%3CEM%3Evalue_if_false%3C%2FEM%3E%20if%20%3CEM%3Econdition%3C%2FEM%3E%20evaluates%20to%20FALSE%2C%20but%20also%20if%20it%20evaluates%20to%200.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20your%20example%2C%20%3CEM%3Econdition%3C%2FEM%3E%20evaluates%20to%2025-23%20%3D%202.%20Since%20this%20is%20non-zero%2C%20%3CEM%3Evalue_if_true%3C%2FEM%3E%20is%20returned.%20This%20is%20used%20to%20return%20the%20last%20name%20if%20D11%20contains%20a%20space%2C%20and%20the%20value%20of%20D11%20itself%20if%20it%20doesn't%20contain%20a%20space.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New 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
Highlighted

@Harrie_Ribbers 

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

 

Highlighted

@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.

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

@Harrie_Ribbers 

Other words, the equivalent of your IF() is

=25-23=0