Master the IF function for conditional logic in Excel. Learn syntax, nested IFs, combining with AND/OR, and practical examples.
Syntax
IF(logical_test, value_if_true, [value_if_false])Parameters
logical_testThe condition to evaluate (TRUE or FALSE)
value_if_trueValue returned if condition is TRUE
value_if_falseValue returned if condition is FALSE (optional)
Examples
=IF(A1>100, "High", "Low")Return 'High' if A1>100, otherwise 'Low'
=IF(AND(A1>0, B1>0), "Both Positive", "Check Values")IF with AND condition
=IF(A1="", "Empty", A1)Check if cell is empty
Common Errors
#VALUE! - Logical test doesn't return TRUE/FALSE
Nested IF limit (64 levels)
Pro Tips
Use IFS for multiple conditions instead of nested IFs
Combine with AND/OR for complex logic
Use IFERROR to handle errors gracefully
Related Functions
Need Help with IF?
Describe your specific use case and our AI will generate the perfect IF formula for you.
Generate IF Formula