COUNTIF function - Function that counts the number of cells in a data table that meet certain conditions in Excel

COUNTIF function: The function performs counting the number of cells in the data table that meet certain conditions. Syntax: COUNTIF (range, criteria)

The following article introduces you to the COUNTIF function - one of the functions in the statistical function group is very popular in Excel.

COUNTIF function - Function that counts the number of cells in a data table that meet certain conditions in Excel Picture 1COUNTIF function - Function that counts the number of cells in a data table that meet certain conditions in Excel Picture 1

Description: The function does a count of cells in a data table that meet certain conditions.

Syntax: COUNTIF (range, criteria)

Inside:

- range: Range you want to count, is a required parameter.

- criteria: The condition that identifies a cell or reference to be counted, which is a required parameter.

Attention:

- For conditional strings longer than 255 characters -> the function returns the wrong value.

- When the function refers to a closed cell or sheet -> the function returns the #VALUE! Error value

- For data that is text, enter a value without leading spaces.

For example:

Calculate the total number of items described in the table below:

COUNTIF function - Function that counts the number of cells in a data table that meet certain conditions in Excel Picture 2COUNTIF function - Function that counts the number of cells in a data table that meet certain conditions in Excel Picture 2

1. Calculating the total number of items with unit price of 25000.

- In the cell to calculate, enter the formula : = COUNTIF (D6: D10, "= 25000")

COUNTIF function - Function that counts the number of cells in a data table that meet certain conditions in Excel Picture 3COUNTIF function - Function that counts the number of cells in a data table that meet certain conditions in Excel Picture 3

- Press Enter -> item number with unit price of 25000 is:

COUNTIF function - Function that counts the number of cells in a data table that meet certain conditions in Excel Picture 4COUNTIF function - Function that counts the number of cells in a data table that meet certain conditions in Excel Picture 4

2. Calculate the total number of items as apples.

- In the cell to calculate enter the formula: = COUNTIF (C6: C10, "= Apple *")

COUNTIF function - Function that counts the number of cells in a data table that meet certain conditions in Excel Picture 5COUNTIF function - Function that counts the number of cells in a data table that meet certain conditions in Excel Picture 5

- Press Enter -> total number of apple items in the data table is:

COUNTIF function - Function that counts the number of cells in a data table that meet certain conditions in Excel Picture 6COUNTIF function - Function that counts the number of cells in a data table that meet certain conditions in Excel Picture 6

3. Calculate the total number of fruit products except apples.

- In the cell to calculate, enter the formula: = COUNTIF (C6: C10, "<> Apple *")

COUNTIF function - Function that counts the number of cells in a data table that meet certain conditions in Excel Picture 7COUNTIF function - Function that counts the number of cells in a data table that meet certain conditions in Excel Picture 7

- Press Enter -> total number of fruit items except apples is:

COUNTIF function - Function that counts the number of cells in a data table that meet certain conditions in Excel Picture 8COUNTIF function - Function that counts the number of cells in a data table that meet certain conditions in Excel Picture 8

Above are instructions and some specific examples when using the COUNTIF function in Excel.

Good luck!

4 ★ | 2 Vote