# How to Use IF Function

IF function is one of the most popular Excel functions. The function returns one value when a condition is true and returns another value when it's false.

Formula:

= IF(logical_test, value_if_true, [value_if_false])

Explanation:

– Logical_test is required, the condition to test.

– Value_if_true is required, the value to return when logical_test is TRUE.

– Value_if_false is optional, the value to return when logical_test is FALSE.

Cautions:

– The function return to 0 (zero) when there is no value_if_true or value_if_False arguments

– The function return #NAME? error when the formula is misspelled.

= IF(A2=A3, "same","different")
= IF(A3=A4, "same","different")

If A2 = A3, the function returns "same", otherwise, the function returns "different". "Excelnotes" in A2 is the same as "Excelnotes" in A3, the result returns "same".

If A3 = A4, the function returns "same", otherwise, the function returns "different". "Excelnotes" in A3 is different from "Excelnotes.com" in A4, the result returns "different".