Functions 8: SUMIF, COUNTIF & AVERAGEIF
Time to learn: 30 minutes
Need a detailed report fast?Β Β Need to get the breakdown ofΒ sums, averages or a count of your data?Β Need to get them by SEPARATE CATEGORIES?Β Needed it yesterday?
This series of formulas has so many uses, itβs amazing. Youβll be able to get the sums, counts and averages of items by specifying criteria of your design!
Letβs start with some data.Β Here we have a list of students, with the following columns β Name, Age, School, Grade and Fee.Β Now, letβs see what we can do.
SUMIF/SUMIFS
This function adds values together if they fulfil certain conditions that YOU specify!
SUMIF will only add values based on 1 specified condition
SUMIFS will add values based on more than 1 specified condition
Hereβs an example. Letβs try to find out how much in fees students from school X pay:
=SUMIF(C:C,”X”,E:E)
Like all formulas, begin with β=β and then the function SUMIF, with the contents framed by β(β and β)β.
How about the contents?
C:C refers to the data that contains the condition or criteria that would decide how the data is added together. In this case, this is the school the students go to.
βXβ, is the criteria that we have specified. Hence, we are looking at column C:C and specifying βXβ as the criteria.Β As it is a letter, remember to frame X with β and β.Β If it was a number, there is no need of β and β.Β So, we are looking only at students that go to school βXβ.
E:E refers to the data we want added together, in this case, the fees that each student pays.
Hence, we want to add all the school fees together of all students that go to school βXβ. So, we are adding the values contained in E:E that have the condition βXβ in column C:C.Β In this case, the answer is $150.
SUMIFS
How about SUMIFS?
This function is very similar to SUMIF. Letβs see if we can find out how much fees students in school X that have B grades pay:
=SUMIFS(E:E,C:C,”X”, D:D,”B”)
Note how this is slightly different from SUMIF.
Like all formulas, begin with β=β and then the function SUMIF, with the contents framed by β(β and β)β.
E:E refers to the data we want added together, in this case, the fees that each student pays.
C:C refers to the schools that the students have gone to. By specifying βXβ, we are stating that we want only students from school βXβ.
D:D refers to the grades that the students obtained and by specifying βBβ, we are stating that we only want students with βBβ grades.
Hence, we will get from the formula, the fees that all students from school βXβ with βBβ grades pay. In this case, $100.
Tip:
Remember that for SUMIFS, like COUNTIFS and AVERAGEIFS, you can add AS MANY CRITERIA AS YOU WANT!
COUNTIF/COUNTIFS
Like SUMIF and SUMIFS, COUNTIF counts values with 1 specified condition, while COUNTIFS counts values with more than 1 specified condition.
COUNTIF
Letβs see if we can find the number of students who attend school βYβ.
Hereβs how it works:
=COUNTIF(C:C,”Y”)
C:C refers to the list where we want items counted. In this case, C:C refers to the schools that students go to.
βYβ refers to the item we want counted. This means that we want the number of students who attend school βYβ, the answer being 3.
COUNTIFS
Letβs see if we can find the number of students that attend school βXβ and have gotten βBβ grades:
=COUNTIFS(C:C,”X”,D:D,”B”)
Now, C:C and D:D refer to the lists where we want items counted, with βXβ being the school attended and βBβ being the attained grades.
Hence, we will get the number of students who have attended school βXβ and attained the βBβ grade, which is 2.
AVERAGEIF/AVERAGEIFS
Much the like the previous 2 functions, AVERAGEIF determines the average of items with 1 specified condition, while AVERAGEIFS, like its counterparts, determines the average of items with more than 1 specified conditions. They work in the same way too.
AVERAGEIF
Letβs find out the average of fees paid by students from school βZβ:
=AVERAGEIF(C:C,”Z”,E:E)
C:C refers to the list of schools, with βZβ being the condition specified. So we are looking at school βZβ specifically.
E:E refers to the items we want averaged, in this instance the fees paid. So we will get the average of fees paid by all students from school βZβ.Β The average being $58.33.
AVERAGEIFS
The final function we will look at today is the plural version of AVERAGEIF. AVERAGEIFS determines the average of items with more than 1 specified condition.
Letβs try to find out the average of fees paid by students from school βYβ, who have gotten βDβ grades:
=AVERAGEIFS(E:E,C:C,”Y”,D:D,”D”)
E:E refers to the items we want averaged, in this instance the fees paid.
C:C refers to the list of schools, with βYβ being the condition specified. So we are looking at school βYβ specifically.
D:D refers to the grades that the students obtained and by specifying βDβ, we are stating that we only want students with βDβ grades.
With all that, we get the average of fees paid by all students from school βYβ who have attained a βDβ grade.Β The result of that is $25.
Feeling mighty, yet?






Leave a comment