IF formula and example in Excel and Google Sheets
Formula, examples and how to use it=IF(logical_expression, value_if_true, value_if_false)
One of the most popular functions used in Excel and Google Sheets, and returns one value if a logical expression is 'TRUE' and another if it is 'FALSE'.
IF formula and example in Excel and Google Sheets
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
LIVE IF FUNCTION AND EXAMPLE
- SUMIF formulas and example
- SUMIFS formulas and example
- COUNTIF formulas and example
- TEXT formulas and example
- CONVERT formulas and example
- Sum by month
- SUMIF cells if contains part of a text string
- Sum total sales based on quantity & price
- Combine date and time
- Convert 1-12 to month name
- Dynamic current date and time
- Count blank cell
- Count cell between two values
- Combine two or more cell
- Extract left before first space
- Extract the nth words in a text string
- Flip the first and last name
- SUMIFS formulas and example
- IF formulas and example
- Change the negative number to zero
- Change negative to positive numbers
- Calculate percentage changes for containing zero or negative values
- Convert date to text
- Convert time to text
- Convert weekday string to number
- Combine two or more cells with a line break
- Combine two or more cells and transpose
- Count cells over 10 characters
- Count cells that are not blank
- Count if cells contain a specific text
- Count cells that begin with a specific text
- COUNTIF based on multiple criteria