Example:
If a student has a score greater than 59 then "Pass" else "Fail"
=IF(A2>59,"Pass","Fail")
If an item price is less than or equal to 1000 then “Within Budget" else "Over Budget"
=IF(A2<=1000,"Within Budget", "Over Budget")
IF can be also used with AND and OR functions. AND function returns a value if two conditions are meet and OR function returns a value if one of two conditions are met.
AND Function
If an item price is between 200 and 1000 then "Buy" else "Review" before making a decision and the formula will look like this.
=IF(AND(A2<=1000,A2>=200),"Buy","Review")
OR Function
If an item colour is Red, Blue or White then "Popular Colours", else "Other Colours". The formula will look like this.
=IF(OR(A2="Red",A2="Blue",A2="White"),"Popular Colours","Other Colours")
Check below live Google Sheets for Calculating Student Grades, How to use AND & OR function with IF function and Logical operators