Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 24

LOGICAL

FUNCTIONS
IN MICROSOFT EXCEL
Agenda
Introduction to Logical Functions
IF Function
AND Function
OR Function
NOT Function
NESTEDIF Logical Function
IFS Function
Summary Table
Overview Of Logical Function
What is Logical Function?
*A logical function is a type of function that performs operations based on logical conditions. These
functions help you make decisions in your spreadsheets by evaluating whether a specified condition
is true or false.
• formulas to control the flow of calculations or to categorize data based on certain criteria.

Benefits of using Logical Functions?


Logical Functions are essential for creating dynamic and flexible Spreadsheets and they allow users
to build complex decision trees, Validate data, and perform conditional calculations which are crucial
for data analysis.
Logical Operators are used in logical functions to perform operations that involve
logical values (i.e. true or false) and to make decisions based on conditions.
Few Logical Functions
LOGICAL FUNCTION - IF
IF function, is one of logical functions that evaluates
a certain condition and returns one value if the condition is “TRUE”,
and another value if the condition is “FALSE”

FORMULA
=IF(LOGIC TEST , VALUE IF TRUE , VALUE IF FALSE)
FOR EXAMPLE :- IF THE FRUITS SUBTOTAL IS LESS
THEN 6000 THEN FRUITS CAN “BUY” OR OTHER
“DON’T BUY”.
=IF(E4<6000,”YES”,”NO”)

LOGIC TEST IS “E4”,


VALUE IF TRUE IS “YES”
VALUE IF TRUE IS “NO”
LOGICAL FUNCTION - AND
CHECK THAT ALL THE CONDITIONS THAT WE NEED ARE TRUE, HERE WE CAN ENTER UP TO 255
CONDITIONS. ARGUMENTS ARE IN THE FORM OF CONSTANT AND LOGICAL EXPRESSIONS.
AND(logical1,logical2,…)

Figure 1: This figure says IF(employees from Training department and from North Region)
give allowance of Rs.1000.
LOGICAL FUNCTION - AND
AND logical function is also used when we give statement for one department and Region.
Arguments provided by AND function is also Array and Cell references.

Figure 2: In this Figure, Statement says that IF(department is “Training” and Region is
“East”) then the Employees get Bonus of 10%.
LOGICAL FUNCTION - OR
1. Purpose :The OR function is a logical function that tests multiple conditions
at the same time to determine if any of them are true.
2. Formula Syntax: =OR(logical1,[logical2],….)
3. Example: to compare A1 for either “a” or “b,” you can use
=OR(A1=”a”,A1=”b”).
4. Special Remark: The function can be used as the logical test inside
the IF function to avoid extra nested IFs, and can be combined with
the AND function. We can use the function to test multiple
conditions at the same time – up to 255 conditions in total.
LOGICAL FUNCTION- NOT
• NOT function – Reverses the logic of its argument
• Returns True if the condition is false and returns false if condition is true
• Syntax: =NOT(logical)

• Things to remember
#VALUE! error –
Occurs when the given
argument is not a
logical value or
numeric value.
LOGICAL FUNCTION - Nested IF

• Nested IF function in Excel is used to find the outcome using multiple


criterias.

• IF function has 3 arguments – logical_test, value if true, value if false.

• The nested IF function in Excel, in simple terms includes a function


within IF function.
Example

Calculate the Professional tax of all the employees who are working in the Organization by using the below
table.
Syntax

IF(condition1, result1, IF(condition2, result2,


IF(condition3, result3, result4)))

steps

Step 1: Select the cell where we want to find the result. In this example, it is
cell J2.

Step 2: Now, insert the formula,


=IF(H2<=20000,200,IF(H2<=40000,250,IF(H2<=60000,300,IF(H2<=80000,350,4
00))))

Step 3: Press Enter key.


What is the difference between IF and nested IF function?

The major difference of IF and nested IF functions are:


· IF function has only one test and 2 possible outcomes, which is TRUE or
FALSE.

· Nested IF function allows users to test with multiple criterias


Nested IF with OR conditions

By using the OR function you can check two or more different conditions in the logical test of each IF
function and return TRUE if any (at least one) of the OR arguments evaluates to TRUE. To see how it
actually works, please consider the following example.

=IF (OR(B2>150, C2>150), 10%, IF (OR(B2>=101, C2>=101),7%, IF(OR(B2>=51, C2>=51), 5%,IF (O


R(B2>=1, C2>=1), 3%, ""))))
Nested IF with AND conditions

If your logical tests include multiple conditions, and all of those conditions should evaluate to TRUE, express them by using the
AND function.

=IF (AND (B2>150, C2>150), 10%, IF(AND(B2>=101, C2>=101), 7%, IF(AND(B2>=51, C2>=51), 5%,
IF (AND (B2>=1, C2>=1), 3%, 0%))))
LOGICAL FUNCTION - IFS
The IFS function in Excel is a logical function that performs multiple logical tests and returns a value
corresponding to the first TRUE result. It is available in Excel 365, Excel 2021, and Excel 2019
Purpose:
Test Multiple Conditions, Return first True

Return Value:
Value Corresponding with first TRUE Result

Formula:
=IFS (test1, value1, [test2, value2],…..)

Arguments:
Test1 – First logical test
Value1 – Result when test1 is TRUE
Test2, value2 – [optional] second test/value pair.
IFS Function
=IFS(C6>=90,"A",C6>80,"B",C6>70,"C",C6>=60,"D",C6<60,"F")

Grade Format
IFS Function
POINTS TO REMEMBER:

• The IFS function is an extension of the IF function that allows you to test multiple
conditions in a single formula. It takes multiple pairs of logical tests and values, and
returns the value corresponding to the first true condition.

• IF function for simple one-condition scenarios, and use the IFS function when you need
to evaluate multiple conditions.

• The IFS does not return any default if all conditions are FALSE. It will return an #N/A
error instead.

• All logical tests should either return a TRUE or FALSE binary value. A #VALUE error will
appear if any other value is returned.
Summary Table
SR. NO. FUNCTION DESCRIPTION
1 IF Verifies whether a condition is met or not. If the condition is met, it returns true. If
the condition is not met, it returns false.
2 AND Checks multiple conditions and returns true if they all the conditions evaluate to
true.
3 OR Used when evaluating multiple conditions. Returns true if any or all of the
conditions are true. Returns false if all of the conditions are false
4 NOT Returns true if the condition is false and returns false if condition is true
5 NESTEDIF A nested IF function is an IF function within another IF function
6 IFS The IFS function checks whether one or more conditions are met, and returns a
value that corresponds to the first TRUE condition.
7 IFERROR Returns the expression value if no error occurs. If an error occurs, it returns the
error value
THANK YOU

You might also like