Вы находитесь на странице: 1из 9

COUNTIF function in excel counts cell meeting a single criterion.

It will Count
the Empty or the Blank Cells present in the Range. You can use COUNTIF
Function to count or Calculate the number of Cells, the cells with dates,
numbers, and text matching a specific criterion. The COUNTIF function
Supports the logical operators (>, <, <>, =) also with wildcards (*,? i.e the
asterisk and the question mark). The Wildcards help in partial matching.

Countif function will help you to know how many records of a certain
type you have in your Excel spreadsheet.
The Excel Countif function returns the number of cells within a supplied range,
that satisfy given criteria.

When to use Countif Function?


COUNTIF function can be used when you want to count the number of cells
that meet specified criteria.

What does it return?


It returns a value(number) that represents the number of cells that meet
specified criteria in the selected range.

Table of Contents
Purpose
To Count the cells matching your criteria

Return the value

A number representing cells counted.

Syntax
COUNTIF(range, criteria)

range – Defines one or several cells to count. You put the range in a formula
like you usually do in Excel, e.g. A1:A20.
criteria – Defines the condition that tells the function which cells to count. It
can be a number, text string, cell reference or expression. For instance, you
can use the criteria like these: “10”, A2, “>=10”, “some text”.
Case Study: Let’s analyze result grade sheet of students in which we want to
find out how many students have got GPA 4. We can find this
using Countif Function.
Steps on how to use Countif Function:-

Step 1: Create a table in Excel

Step 2: In the Cell E2 we will calculate the number of students who have got
GPA 4. type this formula in cell E2:
=COUNTIF(B2:B9,4)
Step 3: Now press ENTER, you will get the value 3 which is a number of
students who got GPA 4.

Tip 1: In the Criteria portion of the formula, You can use also B3 to get the
same result. Because cell B3 contains the value GPA 4. So, in that case
formula would be:
=COUNTIF(B2:B9,B3)
Tip 2: Imagine that you want to find the number students who got GPA more
than 3, then the formula would be:
=COUNTIF(B2:B9, “>3”)
So, we can also give mathematical condition in criteria.

Tip 3: If you want to find those students whose name contains Roy, then use
this formula and see the magic:
=COUNTIF(A2:A9, “*Roy”)
We use * before Roy that means find those values who has Roy at the end.
By giving * means whatever exists before Roy it will count that.
Tip 4: We can also Sum 2 Countif results in another cell. Think you want to
sum these 2 Countif result of =COUNTIF(B2:B9,B3) and 
COUNTIF(B2:B9, “>3”). To do so, you can use this formula given below:
=COUNTIF(B2:B9,B3)+COUNTIF(B2:B9, “>3”)
Excel AVERAGEIF Function
Summary 
The Excel AVERAGEIF function computes the average of the numbers in a range
that meet the supplied criteria. The criteria for AVERAGEIF supports logical
operators (>,<,<>,=) and wildcards (*,?) for partial matching.

Purpose 
Get the average of numbers that meet criteria

Return value 
A number representing the average.

Syntax 
=AVERAGEIF (range, criteria, [average_range])

Arguments 
 range - One or more cells, including numbers or names, arrays, or references.
 criteria - A number, expression, cell reference, or text.
 average_range - [optional] The cells to average. When omitted, range is used.
Usage notes 
AVERAGEIF computes the average of the numbers in a range that meet the
supplied criteria. If average_range is not supplied, the cells in range are averaged.
If average_range is supplied, cells cells in average_range that correspond to cells
in range are averaged.
To determine which cells are averaged, criteria is applied to range. Criteria can be
supplied as numbers, strings, or references. For example, valid criteria could be 10,
"10" ">10", or A1.
Notes:

 Cells in range that contain TRUE or FALSE are ignored.


 Empty cells are ignored in range and average_range when calculating
averages.
 AVERAGEIF returns #DIV/0! if no cells in range meet criteria.
 Average_range does not have to be the same size as range. The top left cell
in average_range is used as the starting point, and cells that correspond to cells
in range are averaged.
 AVERAGEIF allows the wildcard characters question mark (?) and asterisk
(*), in criteria. The ? matches any single character and the * matches any sequence of
characters. To find a literal ? or *, use a tilde (~) before the character, i.e. ~* and ~?.

AVERAGEIF formula examples

Average and ignore errors


To average a list of values, ignoring any errors that might exist in the range, you can
use the AVERAGEIF or AGGREGATE function, as described below. In the example
shown, the formula in E5 is: =AVERAGEIF(values,...

Average numbers ignore zero


To get the average of a set of numbers, excluding or ignoring zero values, use the
AVERAGEIF function. In the example shown, the formula in E6 is:
=AVERAGEIF(B6:D6,"<>0") How this formula works In...

Average numbers ignore zero

Generic formula 
=AVERAGEIF(range,"<>0")

Explanation 
To get the average of a set of numbers, excluding or ignoring zero values, use the
AVERAGEIF function. In the example shown, the formula in E6 is:
=AVERAGEIF(B6:D6,"<>0")
How this formula works
In the example shown, the formula in E5 is based on the AVERAGE function:
=AVERAGE(B5:D5) // returns 60
The result is 60, since (90+90+0)/ 3 = 60.
To filter out the zero from the calculated average, the formula in E6 uses
the AVERAGEIF function like this:
=AVERAGEIF(B6:D6,"<>0") // returns 90
The criteria supplied is "<>0", which means "not equal to zero".

Blank data values


The AVERAGE, AVERAGEIF, and AVERAGEIFS function all automatically
ignore blank cells (and cells that contain text values), so there is no need to provide
criteria to filter out empty cells.

MS Excel: How to use the SUMIF Function (WS)


This Excel tutorial explains how to use the Excel SUMIF function with syntax and
examples.

Description
The SUMIF function is a worksheet function that adds all numbers in a range of cells
based on one criteria (for example, is equal to 2000).
The SUMIF function is a built-in function in Excel that is categorized as a Math/Trig
Function. It can be used as a worksheet function (WS) in Excel. As a worksheet
function, the SUMIF function can be entered as part of a formula in a cell of a
worksheet.
To add numbers in a range based on multiple criteria, try the SUMIFS function.

Syntax
The syntax for the SUMIF function in Microsoft Excel is:

SUMIF( range, criteria, [sum_range] )

Parameters or Arguments
range
The range of cells that you want to apply the criteria against.
criteria
The criteria used to determine which cells to add.
sum_range
Optional. It is the range of cells to sum together. If this parameter is omitted, it
uses range as the sum_range.

Returns
The SUMIF function returns a numeric value.

Type of Function
 Worksheet function (WS)

Example (as Worksheet Function)


Let's explore how to use SUMIF as a worksheet function in Microsoft Excel.

Вам также может понравиться