What are Formulas in Excel? #
A formula is an expression used to perform calculations.
Always starts with =
Example: #
=A1 + B1
What are Functions? #
A function is a predefined formula in Excel.
Example:
=SUM(A1:A5)
Logical Functions (Important for Analysis) #
Logical functions help in decision-making based on conditions.
IF Function #
Definition #
The IF function checks a condition and returns:
- One value if TRUE
- Another value if FALSE
Syntax #
=IF(condition, value_if_true, value_if_false)
Example #
Scenario: Pass or Fail #
| Marks | Result |
|---|---|
| 80 | Pass |
| 40 | Fail |
=IF(A2>=50, "Pass", "Fail")
If marks ≥ 50 → Pass
Else → Fail
Multiple IF (Nested IF) #
=IF(A2>=80,"A", IF(A2>=50,"B","C"))
Grading system
AND Function #
Definition #
Returns TRUE only if all conditions are true
Syntax #
=AND(condition1, condition2)
Example #
Scenario: Eligible for Bonus #
| Sales | Target | Bonus |
|---|
=IF(AND(A2>=100, B2="Yes"), "Bonus", "No Bonus")
Both conditions must be true
OR Function #
Definition #
Returns TRUE if any one condition is true
Syntax #
=OR(condition1, condition2)
Example
=IF(OR(A2>=100, B2="Yes"), "Approved", "Rejected")
Only one condition needs to be true
IF + AND + OR (Combined Use) #
Example: #
=IF(AND(A2>=50, OR(B2="Yes", C2="Yes")), "Pass", "Fail")
Logic:
- Marks ≥ 50
- AND (Attendance OR Assignment complete)
IFERROR Function #
Definition #
Handles errors in formulas
Syntax #
=IFERROR(value, value_if_error)
Example #
Scenario: Division #
=A2/B2
❌ If B2 = 0 → Error
✅ Fix:
=IFERROR(A2/B2, "Error")
Shows “Error” instead of crash
Practical Example (Full Scenario) #
| Sales | Target | Result |
|---|
=IF(AND(A2>=100, B2="Yes"), "Achieved", "Not Achieved")
Table #
| Function | Purpose | Example |
|---|---|---|
| IF | Condition check | =IF(A1>50,"Pass","Fail") |
| AND | All conditions true | =AND(A1>50,B1="Yes") |
| OR | Any condition true | =OR(A1>50,B1="Yes") |
| IFERROR | Handle errors | =IFERROR(A1/B1,"Error") |
