Logical Formula
Logical Formula
Name Range :- Any sheet within the workbook will have the same name reference.
Advantage of name range:- (i) Navigation , (ii) We can take print out of the name as
selection.
Disadvantages:- I n case of excutim of relative reference name range is failed.
(*) I F Function :- The I F function is a logical function in Excel that allows you to
test a condition and return one value if the condition is true and another value if
the condition is false.
Syntax:-
I F(logical_test, [ value_if_true] , [ value_if_false] )
Example:
Suppose we want to check if a student's score is greater than or equal to 60, and
return "Pass" if true and "Fail" if false.
=I F(A1>=60, "Pass", "Fail")
The I F function is a versatile and widely used function in Excel, and it can be
applied in various scenarios, including:
Financial Analysis
1. Budgeting: Use I F to create formulas that allocate funds based on conditions,
such as "I f sales exceed $10,000, then allocate $2,000 for marketing."
2. Expense tracking: Use I F to categorize expenses based on conditions, such as "I f
expense amount is greater than $100, then categorize as 'High Priority'."
Data Analysis
1. Data filtering: Use I F to filter data based on conditions, such as "I f country is
'USA', then show data."
2. Data validation: Use I F to validate data based on conditions, such as "I f date is
before today, then show error message.
AND Function:-The AND function is a logical function in Excel that returns TRUE
if all conditions are true, and FALSE otherwise.
Syntax:
AND(logical1, [ logical2] , ...)
Example:
=AND(A1>10, B1<20)
In this example, the AND function returns TRUE if the value in cell A1is
greater than 10 and the value in cell B1is less than 20. If either condition is
false, the function returns FALSE.
Using AND with IF:
The AND function is often used in combination with the IF function to test
multiple conditions. For example:
=IF(AND(A1>10, B1<20), "True", "False")
In this example, the IF function returns "True" if both conditions are true,
and "False" otherwise.
Common uses of AND:
1. Data filtering: Use AND to filter data based on multiple conditions.
2. Conditional formatting: Use AND to apply conditional formatting to cells
based on multiple conditions.
3. Logical tests: Use AND to performlogical tests on data, such as testing
if a value is within a certain range.
NESTING Function:- Argumenting one mathematical function inside another
mathematical (logical function) is called nesting function. In excel and the
composite function is called the nested function.
COUNTIF Function:- The COUNTI F function is a statistical function in Excel that
counts the number of cells in a range that meet a specified condition.
Syntax:
COUNTI F(range, criteria)
Syntax:
SUMI F(range, criteria, [ sum_range] )
Arguments:
1. range: The range of cells to be searched.
2. criteria: The condition to be met.
3. sum_range: The range of cells to be summed (optional).
Example:
=SUMI F(A1:A10, ">10", B1:B10)
I n this example, the SUMI F function sums up the values in the range B1:B10 where
the corresponding values in the range A1:A10 are greater than 10.
SUMI FS Function:-
The SUMI FS function is a mathematical function in Excel that sums up values in a
specified range based on multiple conditions.
Syntax:
SUMI FS(sum_range, range1, criteria1, [ range2] , [ criteria2] , ...)
N.B:- For checking more than one conditions we have to use SUMI FS function.
Syntax:
IFERROR(cell, value_if_error)
Difference between regular IF and nested IF:-
(1)Regular IF deals with single condition or a single logical test .
Nested IF deals with more than one condition or more than one logical
test in a single formula.
(2) Regular IF function:->
=IF(logical test,true,false)
Nested IF function:->
=IF(logical test 1,true 1, IF(logical test 2,true 2, IF(logical test 3,true 3,
(…)))
Therefore in nested IF in the place of “false” situation another new‘IF”
statement will be plugged in.
Multiple Nested IF with arithmetic operation:-
**Nested IF OR function:-
By using the OR function in IF as nested part of each function , we can
check two or more different condition in a single formula.
Remember:- IF OR statement returns TRUE if atleast one of the OR
argument is true while IF AND statement returns TRUE if all the AND
arguments arewtrue.
VLOOKUP/ VERTICAL LOOK UP:-
DEFINITION:- VLOOKUP is a function which searches the value in a coloumn and
result another value from another coloumn. I t has 4 arguments
Syntax:
VLOOKUP(lookup_value, table_array, col_index_num, [ range_lookup] )
For exact match logic will be “False/0”
For approximate match logic will be “True/1”.
First three entries of VLOOKUP function are compalsary while the last entry is
optional.
Index:-
I t has three arguments.
Syntax:
I NDEX(array, row_num, [ column_num] )
Arguments:
1. array: The range of cells that you want to search.
2. row_num: The row number of the cell that you want to return.
3. [ column_num] : Optional. The column number of the cell that you want to return. I f
omitted, the function returns the entire row.
Definition:- I ndex() is a function where a user has to provide the column name as
well as the row name and the value name of the cell will return.
MATCH:-
Syntax: MATCH(lookup_value, lookup_array, [ match_type] )
Arguments:
1. lookup_value: The value you want to search for.
2. lookup_array: The range of cells that contains the data you want to search.(Only
column where the lookup value lies)
3. [ match_type] : Optional. Specifies the type of match:
- 0 (default): Exact match
- 1: Less than
- -1: Greater than
1:- Largest value that is less than or equal to the lookup value. For this optional
choice we have to arrange lookup array in an increasing order.
0:- Exactly equal to the lookup value.
-1:- Smallest value that is greater than or equal to lookup value.
Syntax:-
The syntax for nested I NDEX and MATCH functions is as follows:
=I NDEX(range, MATCH(lookup_value, lookup_array, [ match_type] ), [ column_num] )
Where:
- range is the range of cells that contains the data you want to retrieve.
- lookup_value is the value you want to search for.
- lookup_array is the range of cells that contains the values you want to search.
- [ match_type] is optional and specifies the type of match (exact or approximate).
- [ column_num] is optional and specifies the column number from which to return a
value.