IF functions

Error and Uncertainty in Google Sheets

Evan Kramer

Instructor

Grouping functions

  • UNIQUE() function
    • Returns distinct values
  • =UNIQUE(C:C)
    • Returns list of precincts

Data with precinct column selected

Error and Uncertainty in Google Sheets

Counting functions

  • Counts of unique values
    • COUNTIF() function
      • range
      • criterion
  • =COUNTIF(C:C, G2)
  • =COUNTIF(B:B, ">2000")

Data with counts of offenses by precinct

Error and Uncertainty in Google Sheets

Other IF functions

  • AVERAGEIF()
    • Criteria range
    • Criterion
    • Range
  • =AVERAGEIF(C:C,G2,B2:B)
    • C:C: Column containing precincts
    • G2: Name of precinct of interest
  • SUMIF()
    • Criteria range
    • Criterion
    • Range
  • =SUMIF(F2:F7,"WEST",G2:G7)
Error and Uncertainty in Google Sheets

Multiple IF conditions

  • COUNTIFS() function
    • Pairs of ranges and criteria
    • Allows multiple criteria
    • Different criteria in same range
  • Example: Crimes in West precinct after 8:00
    • =COUNTIFS(C:C, G2, B:B, ">2000")

Using the COUNTIFS function with multiple criteria

Error and Uncertainty in Google Sheets

Multiple IF conditions

  • AVERAGEIFS() function
    • Range
    • Pairs of ranges and criteria
    • Allows multiple criteria

COUNTIFS function with multiple criteria

Error and Uncertainty in Google Sheets

Let's practice!

Error and Uncertainty in Google Sheets

Preparing Video For Download...