0% found this document useful (0 votes)
6 views

Excel Logical Functions

The document explains various logical functions in Excel, including IF, IFS, AND, OR, NOT, and XOR, highlighting their uses in automating tasks and evaluating multiple conditions. It details how the IFS function simplifies multiple tests, while AND and OR functions allow for complex comparisons, often used in conjunction with IF. Additionally, it describes the NOT function's ability to reverse logical values and provides practical examples for better understanding.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Excel Logical Functions

The document explains various logical functions in Excel, including IF, IFS, AND, OR, NOT, and XOR, highlighting their uses in automating tasks and evaluating multiple conditions. It details how the IFS function simplifies multiple tests, while AND and OR functions allow for complex comparisons, often used in conjunction with IF. Additionally, it describes the NOT function's ability to reverse logical values and provides practical examples for better understanding.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Logical functions are some of the most popular and useful in Excel.

They can test values in


other cells and perform actions dependent upon the result of the test. This helps us to
automate tasks in our spreadsheets.

1) IF (Already done)
2) IFS
3) AND
4) OR
5) NOT
6) XOR

2) IFS
The Excel IFS function can run multiple tests and return a value corresponding to the first
TRUE result. Use the IFS function to evaluate multiple conditions without multiple nested
IF statements. IFS allows shorter, easier to read formulas.
The AND and OR Logical Functions
The AND and OR functions are used when you want to perform more than one
comparison in your formula. The IF function alone can only handle one condition, or
comparison.

The AND function returns TRUE only if every condition is met, and otherwise returns
FALSE.

The OR function returns TRUE if one or all of the conditions are met, and returns FALSE
only if no conditions are met.

These functions can test up to 255 conditions, so are certainly not limited to just two
conditions like is demonstrated here.

Below is the structure of the AND and OR functions. They are written the same. Just
substitute the name AND for OR. It is just their logic which is different.
You can see that it returns FALSE for Matt and Terry because although they both meet
one of the criteria, they need to meet both with the AND function.

OR Function Example

The OR function is used below to test if the customer spends at least £3,000 or has
been a customer for at least three years.
Using AND and OR with the IF Function

Because the AND and OR functions return the value of TRUE or FALSE when used
alone, it’s rare to use them by themselves.

Instead, you’ll typically use them with the IF function, or within an Excel feature such
as Conditional Formatting or Data Validation to perform some retrospective action if
the formula evaluates to TRUE.

In the formula below, the AND function is nested inside the IF function’s logical test. If the
AND function returns TRUE then 10% is discounted from the amount in column B; otherwise,
no discount is given and the value in column B is repeated in column D.

The XOR Function


In addition to the OR function, there is also an exclusive OR function. This is called the
XOR function. The XOR function was introduced with the Excel 2013 version.

This function can take some effort to understand, so a practical example is shown.

The structure of the XOR function is the same as the OR function.

When evaluating just two conditions the XOR function returns:

• TRUE if either condition evaluates to TRUE.


• FALSE if both conditions are TRUE, or neither condition is TRUE.

This differs from the OR function because that would return TRUE if both conditions
were TRUE.
Let’s look at a simple example of the XOR function.

In this example, sales are split over two halves of the year. If a salesperson sells
£3,000 or more in both halves, then they are assigned Gold standard. This is achieved
with an AND function with IF like earlier in the article.

But if they sell £3,000 or more in either half then we want to assign them Silver status.
If they don’t sell £3,000 or more in both then nothing.

The XOR function is perfect for this logic. The formula below is entered into column E
and shows the XOR function with IF to display “Yes” or “No” only if either condition is
met.

The NOT Function


The NOT function reverses the value of its argument. So, if the logical value is TRUE,
then it returns FALSE. And if the logical value is FALSE, it will return TRUE.

The structure of the NOT function is:

=NOT(logical)
Example:

In this example, imagine we have a head office in London and then many other regional sites.
We want to display the word “Yes” if the site is anything except London, and “No” if it is
London.

You might also like