Theory of IF() and Nested IF() Functions
IF <condition> Logical Operators
if (<condition>) IF (<C2>=35) T T
Do something Pass T F
Else Else F T
Do something Fail F F
Endif; Endif
IF <condition> AND
if (<condition> and <condition>) () All Brackets first
Do something ^ starts from innermost bra
Else */ Left to right whichever com
Do something +- Left to right whichever com
Endif;
IF <condition> OR ( <
if (<condition> or <condition>) ) >
Do something ( ] < and >=
Else [ ) <= and >
Do something ( ) < and >
Endif; [] <= and >=
Nested IF <condition>
if (<condition>)
If (<condition>)
Do Something
Else
IF (<condition>)
Do something
else
IF (<condition>)
Do something
Endif;
Endif;
Endif;
Else
Do Something
Endif;
AND OR
T T
F T
F T
F F
BODMAS
Brackets first x=(y+z)/3
rts from innermost bracket y=2
ft to right whichever comes first z=4
ft to right whichever comes first 3
3.33333333333 =2+4/3
2
[ ] Both the end points are inclusive
[ ) Left Value inclusive, right value exclusive
( ] Left Value exclusive, right value inclusive
( ) Both the end points are exclusive
Basics Fundamentals of IF()
IF() Function Basics
From 15,000 15,000
Criteria for
Dynamic IF() To 20,000
Remarks Good Very Good
Logical Operators Used Simple-IF() IF() with AND
Revenue > 15000
Product Reveue Revenue > 15000 then "Good" and < 20000
then "Good"
Product-01 11,649
Product-02 7,718
Product-03 15,033 Good Very Good
Product-04 18,701 Good Very Good
Product-05 14,432
Product-06 11,022
Product-07 17,760 Good Very Good
Product-08 20,400 Good
Syntax =IF(AND(D15>$F
=IF(D15>$E$3,$E$5,"") $3,D15<$F$4),
$F$5,"")
Practice
From 18,000 15,000
Criteria for
Dynamic IF() To 18,000
Remarks Fantastic IRA Edu-Tech
Logical Operators Used Simple-IF() IF() with AND Operator
Revenue > 15000
Product Revenue Revenue > 15000 then "Good" and < 20000
then "Good"
Product-01 11,000
Product-02 7,718
Product-03 15,033 IRA Edu-Tech
Product-04 18,701 Fantastic
Product-05 14,432
Product-06 11,022
Product-07 17,760 IRA Edu-Tech
Product-08 20,400 Fantastic
Syntax =IF(AND(D25>$F
=IF(D25>$E$20,$E$22,"") $20,D25<$F$21),
$F$22,"")
Dynamic
Static
04/05/2024
IF() Function Basics
15,000 20,000
20,000 15,000
Exceptional Flag
Nested IF() with AND IF() with OR
Revenue > 15000 and < 20000 then
"Good",
Revenue >= 20000 or <= 15000 then "Flag"
Revenue >= 20000 is "Exceptional",
rest is value
11,649 Flag
7,718 Flag
Good
Good
14,432 Flag
11,022 Flag
Good
Exceptional Flag
=IF(AND(D15>$G$3,D15<$G$4),"Go
od",IF(D15>=$G$4,"Exceptional",D1 =IF(OR(D15>=$H$3,D15<=$H$4),"Flag","")
5))
Practice
15,000 20,000
20,000 15,000
Exceptional Flag
Nested IF() with AND IF() with OR
Revenue > 15000 and < 20000 then
"Good",
Revenue >= 20000 or <= 15000 then "Flag"
Revenue >= 20000 is "Exceptional",
rest is value
11,000 Flag
7,718 Flag
Exceptional
Exceptional
14,432 Flag
11,022 Flag
Good
Exceptional Flag
=IF(AND(D25>$G$20,D25<
$G$21), =IF(OR(D25>=20000,D25<=15000),"Flag","")
$G$22,IF(D25>=$G$21,$G
$22,D25))