How to use the SUMIF and AVERAGEIF formulas. SUMIF formula sums all the cells from one column that fulfils a pre-defined condition. AVERAGEIF formula finds the average among all the cells from one column that fulfils a pre-defined condition.
We also introduce SUMIFS and AVERAGEIFS formulas. These formulas calculate the total or the average (respectively) of all the cells from one column that fulfil multiple pre-defined conditions OR multiple columns that fulfil one pre-defined condition.
1. Excel Tip: SUMIF and SUMIFS
Formula to sum all the cells in a column that meet a given criterion
= COUNTIF(range, criterion, [sum range])
Range is the range of cells to evaluate, Criterion is a number, date or expression
Sum range is the range of cells that are added.
Formula to count multiple columns or multiple conditions
= SUMIFS(sumrange, range1, criterion1, range2, criterion2,..., rangeN, criterionN)
In addition
AVERAGEIF(range, criterion, [average_range]
AVERAGEIFS(sumrange, range1, criterion1, range2, criterion2,..., rangeN, criterionN)
MAXIFS(maxrange, range1, criterion1, range2, criterion2,..., rangeN, criterionN)
MINIFS(minrange, range1, criterion1, range2, criterion2,..., rangeN, criterionN)
2. Excel Tip: SUMIF and SUMIFS
Formulas you can use in SUM
= Sum if lower than N
= SUMIF(range, "<N", [sumrange])
= Sum if Date is later than DateN
= SUMIF(range, ">=DateN", [sumrange])
= Sum if Value equal N
= SUMIF(range, "N", [sumrange])
3. Excel Tip: SUMIF and SUMIFS
Formulas you can use in SUM
= Sum if Value (Number) is lower than N
= SUMIF(range, "<N", [sumrange])
= Sum if Date is after DateN
= SUMIF(range, ">=DateN", [sumrange])
= Sum if String (Text) is not M
= SUMIF(range, "<>M", [sumrange])
4. Excel Tip: AVERAGEIF and AVERAGEIFS
Formulas you can use in AVERAGE
= Average if String (Text) is M
= AVERAGEIF(range, "M", [sumrange])
= Average if String (Text) is M and Value (Number) is N
= AVERAGEIFS(sumrange, range1, "M", range2, "N")
= Average if String (Text) is M and Value (Number) is greater than N
= AVERAGEIFS(sumrange, range1, "M", range2, ">=N")