CodeSteps

Python, C, C++, C#, PowerShell, Android, Visual C++, Java ...

Microsoft Excel – Logical Functions – IF, IFERROR and IFNA formulas

Microsoft Excel provides logical formulas to enable to select the data depending on the given criteria. For example, select the data; if some condition(s) satisfies.

In this Article, we will go through; IF, IFERROR and IFNA Logical Functions in Microsoft Excel.

IF function

The syntax of this function is:

=IF(condition, [true-value], [false-value])

IF function takes condition as an argument and if it satisfies the condition, the value given in true-value will be displayed; otherwise, the value given in false-value will be displayed.

Note that, all the arguments to IF formula are mandatory; but values to true-value and false-value are optional. Here are some examples of this function;

FormulaResultComments
=IF(10 > 8, 10, 8)10
=IF(“A” > “B”, “A”, “B”)B
=IF(TRUE=FALSE,,)0Observe, no values passed to last two arguments.

IFERROR function

The syntax of this function is:

=IFERROR(value, error-value)

IFERROR function verifies the result of the value is an error; if it has any error, the value of error-value argument will be displayed. Otherwise, the result of the value will be displayed. These arguments can be; values, expressions, formulas or etc,. Here is an example;

=IFERROR(1/0, “Division by zero”)

which displays the error value as the first argument evaluates an error.

IFNA function

The syntax of this function is:

=IFNA(value, na-value)

Excel will return #N/A errors, usually when a formula can’t find a reference value. Commonly LOOKUP functions produce this Error. Using this function, we are allowed to display an alternate value instead of #N/A Error, when it occurred.

We will discuss more Excel functions in upcoming Articles.

🙂 Sahida

Microsoft Excel – Logical Functions – IF, IFERROR and IFNA formulas

2 thoughts on “Microsoft Excel – Logical Functions – IF, IFERROR and IFNA formulas

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top