← Cheat Sheets
Spreadsheet Logical and Conditional Functions
IF, AND, OR and conditional aggregates.
# Spreadsheet Logical and Conditional Functions
IF, AND, OR and conditional aggregates.
| Task | Formula |
|---|---|
| If | `=IF(A1>10,"high","low")` |
| Several conditions | `=IFS(A1>90,"A",A1>80,"B",TRUE,"C")` |
| And / or / not | `=AND(A1>0,B1>0)` `=OR(...)` `=NOT(A1)` |
| Catch errors | `=IFERROR(A1/B1,0)` |
| Catch #N/A only | `=IFNA(VLOOKUP(...),"none")` |
| Switch | `=SWITCH(A1,1,"one",2,"two","other")` |
| Sum if | `=SUMIF(A:A,"x",B:B)` |
| Sum with several criteria | `=SUMIFS(C:C,A:A,"x",B:B,">5")` |
| Count if | `=COUNTIF(A:A,">100")` |
| Count with several criteria | `=COUNTIFS(A:A,"x",B:B,"y")` |
| Average if | `=AVERAGEIF(A:A,"x",B:B)` |