← All how-to recipes

How to write an IF with multiple conditions (AND / OR)

✓ Verified in LibreOffice 25.8.7.3

Return one result only when several conditions are all true (or when any is true).

The formula

AppFormulaNotes
Excel=IF(AND(A2>=60,B2>=60),"Pass","Fail")AND requires all conditions true; swap in OR() to require any one.
Google Sheets=IF(AND(A2>=60,B2>=60),"Pass","Fail")Identical.
LibreOffice Calc=IF(AND(A2>=60,B2>=60),"Pass","Fail")Identical.

How it works

AND(cond1, cond2, ...) is TRUE only when every condition is true, so IF returns 'Pass' only when both scores are at least 60. Here 75 and 80 both pass. Replace AND with OR to return 'Pass' when at least one condition is met.

Verified, not just documented

We ran =IF(AND(A2>=60,B2>=60),"Pass","Fail") in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned Pass — exactly the expected result. Every formula here is confirmed by actually executing it.