ExcelR - Logical Functions
ExcelR - Logical Functions
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.
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”)
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
Calculate the Professional tax of all the employees who are working in the Organization by using the below
table.
Syntax
steps
Step 1: Select the cell where we want to find the result. In this example, it is
cell J2.
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 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