appzasGamesToolsDevLearnCheat sheetsQuick calcsConvertersReferenceNetworkTimeCalculatorsCompareLLM prices

IF, SUMIF and COUNTIF

Lesson 2 of 410 minBeginner

Make decisions and total only the rows that match.

=IF(B2>=50, "Pass", "Fail")
=IF(AND(B2>=50, C2="yes"), "OK", "Check")
=IF(OR(A2="x", A2="y"), 1, 0)
=IFERROR(B2/C2, 0)         # show 0 instead of an error

Conditional totals

=COUNTIF(A2:A100, "Paid")                 # rows equal to Paid
=SUMIF(A2:A100, "Paid", C2:C100)          # add C where A is Paid
=SUMIFS(C2:C100, A2:A100, "Paid", B2:B100, ">=2026-01-01")
=AVERAGEIF(A2:A100, "Paid", C2:C100)

In SUMIF the order is range to test, condition, range to add. In SUMIFS the range to add comes first, then pairs of range and condition.

Criteria tricks

  • ">100", "<=50" and "<>0" compare numbers.
  • "North*" uses a wildcard for text starting with North.
  • Join a cell into a criterion: ">"&E1.

CarefulIFERROR hides every error, including real mistakes. Use it on purpose, not as a blanket fix.

Test yourself

Answer all the questions, then check them. Finish with every answer right to mark the lesson as done.

Hint=IF(test, if true, if false)
HintCOUNTIF(range, criteria)
3. In SUMIFS, which argument comes first?
4. What does IFERROR(B2/C2, 0) show when C2 is 0?

Key terms