Lệnh Counta Trong Excel / Top 9 # Xem Nhiều Nhất & Mới Nhất 4/2023 # Top View | Hoisinhvienqnam.edu.vn

How To Use The Excel Counta Function

Random list of names

At the core, this formula uses the INDEX function to retrieve 10 random names from a named range called “names” which contains 100 names. For example, to retrieve the fifth name from the list, we use INDEX like this…

Add row numbers and skip blanks

In the example shown, the goal is to add row numbers in column B only when there is a value in column C. The formula in B5 is:

=IF(ISBLANK(C5),””,COUNTA($C$5:C5))

The IF function first checks if cell C5 has…

Cell contains all of many things

The key is this snippet:

ISNUMBER(SEARCH(things,B5)

This is based on another formula (explained in detail here) that simply checks a cell for a single substring. If the cell contains the substring, the formula…

Count cells that are blank

The COUNTBLANK function counts the number of cells in the range that don’t contain any value and returns this number as the result. Cells that contain text, numbers, dates, errors, etc. are not counted. COUNTBLANK is…

Last row in mixed data with no blanks

This formula uses the COUNTA function to count values in a range. COUNTA counts both numbers and text to so works well with mixed data.

The range B4:B8 contains 5 values, so COUNTA returns 5. The number 5 corresponds…

Count unique values

This example uses the UNIQUE function to extract unique values. When UNIQUE is provided with the range B5:B16, which contains 12 values, it returns the 7 unique values seen in D5:D11. These are returned directly to the…

Dynamic named range with OFFSET

This formula uses the OFFSET function to generate a range that expands and contracts by adjusting height and width based on a count of non-empty cells.

The first argument in OFFSET represents the first cell in the…

Running count group by n size

The core of this formula is the COUNTA function, configured with an expanding range like this:

COUNTA($B$5:B5)

As the formula is copied down the column, the range starting with B5 expands to include each new row, and…

Count cells not equal to many things

First, a little context. Normally, if you have just a couple things you don’t want to count, you can use COUNTIFS like this:

But this doesn…

Project complete percentage

In this example if a task is marked “Done”, then it is considered complete. The goal is to calculate the percent complete for the project by showing the ratio of complete tasks to total tasks, expressed as a percentage…

Count sold and remaining

The COUNTA function counts non-blank cells that contain numbers or text. The first COUNTA counts non-blank cells in the range B5:B11 and returns the number 7:

COUNTA(B5:B11)

The second COUNTA function…

Generate random text strings

The new dynamic array formulas in Excel 365 make it much easier to solve certain tricky problems with formulas.

In this example, the goal is to generate a list of random 6-character codes. The randomness is handled by…

Sort by random

The SORTBY function allows sorting based on one or more “sort by” arrays, as long long as they have dimensions that are compatible with the data being sorted. In this example, there are 10 values being sorted, the…

Score quiz answers with key

This formula uses the named range “key” (C4:G4) for convenience only. Without the named range, you’ll want to use an absolute reference so the formula can be copied.

In cell I7, we have this formula:

=SUM(–(C7:G7=…

Reverse a list or range

The heart of this formula is the INDEX function, which is given the list as the array argument:

=INDEX(list

The second part of the formula is an expression that works out the correct row number as the formula is…

Excel Count And Counta Functions With Formula Examples

This short tutorial explains the basics of the Excel COUNT and COUNTA functions and shows a few examples of using a count formula in Excel. You will also learn how to use the COUNTIF and COUNTIFS functions to count cells that meet one or more criteria.

As everyone knows, Excel is all about storing and crunching numbers. However, apart from calculating values, you may also need to count cells with values – with any value, or with specific value types. For example, you may want a quick count of all items in a list, or the total of inventory numbers in a selected range.

Microsoft Excel provides a couple of special functions for counting cells: COUNT and COUNTA. Both all very straightforward and easy-to-use. So let’s take a quick look at these essential functions first, and then I will show you a few Excel formulas to count cells that meet certain condition(s), and clue you in on the quirks in counting some value types.

Excel COUNT function – count cells with numbers

You use the COUNT function in Excel to count the number of cells that contain numerical values.

The syntax of the Excel COUNT function is as follows:

COUNT(value1, [value2], …)

Where value1, value2, etc. are cell references or ranges within which you want to count cells with numbers.

In the modern versions of Excel 2016, Excel 2013, Excel 2010, and Excel 2007, the COUNT function accepts up to 255 arguments. In earlier Excel versions, you can supply up to 30 ‘values’.

For example, the following formula returns the total number of numeric cells in range A1:A100:

=COUNT(A1:A100)

Note. In the internal Excel system, dates are stored as serial numbers and therefore the Excel COUNT function counts dates and times as well.

Using COUNT function in Excel – things to remember

Below are the two simple rules by which the Excel COUNT function works.

If an argument(s) of an Excel Count formula is a cell reference or range, only numbers, dates and times are counted. Blanks cells and cells containing anything but a numeric value are ignored.

If you type values directly into the Excel COUNT arguments, the following values are counted: numbers, dates, times, Boolean values of TRUE and FALSE, and text representation of numbers (i.e. a number enclosed in quotation marks like “5”).

For example, the following COUNT formula returns 4, because the following values are counted: 1, “2”, 1/1/2016, and TRUE.

=COUNT(1, "apples", "2", 1/1/2016, TRUE)

Excel COUNT formula examples

And here are a few more examples of using the COUNT function in Excel on different values.

To count cells with numeric values in one range, use a simple count formula like

=COUNT(A2:A10)

The following screenshot demonstrates which types of data are counted and which are ignored:

To count several non-contiguous ranges, supply all of them to your Excel COUNT formula. For example, to count cells with numbers in columns B and D, you can use formula similar to this:

=COUNT(B2:B7, D2:D7)

Tips:

If you want to count numbers that meet certain criteria, use either the COUNTIF or COUNTIFS function.

Excel COUNTA function – count cells with values (non-blank cells)

The COUNTA function in Excel counts the number of cells in a range that are not empty.

The syntax of the Excel COUNTA function is akin to that of COUNT:

COUNTA(value1, [value2], …)

Where value1, value2, etc. are cell references or ranges where you want to count non-blank cells.

For example, to count cells with value in range A1:A100, use the following formula:

=COUNTA(A1:A100)

To count non-empty cells in several non-adjacent ranges, use a COUNTA formula similar to this:

=COUNTA(B2:B10, D2:D20, E2:F10)

As you can see, the ranges supplied to an Excel COUNTA formula do not necessarily need to be of the same size, i.e. each range may contain a different number of rows and columns.

Please keep in mind that Excel’s COUNTA function counts cells containing any type of data, including:

Numbers

Dates / times

Text values

Boolean values of TRUE and FALSE

Error values like #VALUE or #N/A

Empty text strings (“”)

In some cases, you may be perplexed by the COUNTA function’s result because it differs from what you see with your own eyes. The point is that an Excel COUNTA formula may count cells that visually look empty, but technically they are not. For example, if you accidentally type a space in a cell, that cell will be counted. Or, if a cell contains some formula that returns an empty string, that cell will be counted as well.

In other words, the only cells that the COUNTA function does not count are absolutely empty cells.

The following screenshot demonstrates the difference between Excel COUNT and COUNTA functions:

Tip. If you just want a quick count of non-blank cells in a selected range, simply have a look at Status Bar at the bottom right corner of your Excel window:

If you just want a quick count of, simply have a look at Status Bar at the bottom right corner of your Excel window:

Excel COUNTIF function – count cells that meet one condition

The COUNTIF function is purposed for counting cells that meet a certain criterion. Its syntax requires 2 arguments, which are self-explanatory:

COUNTIF(range, criteria)

In the first argument, you define a range where you want to count cells. And in the second parameter, you specify a condition that should be met.

For example, to count how many cells in range A2:A15 are “Apples”, you use the following COUNTIF formula:

=COUNTIF(A2:A15, "apples")

Instead if typing a criterion directly in the formula, you can input a cell reference as demonstrated in the following screenshot:

For more information about using the COUNTIF function in Excel, check out the following tutorial: COUNTIF in Excel – count if not blank, greater than, duplicate or unique

Excel COUNTIFS function – count cells that match several criteria

The COUNTIFS function is similar to COUNTIF, but it allows specifying multiple ranges and multiple criteria. Its syntax is as follows:

COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2]…)

The COUNTIFS function was introduced in Excel 2007 and is available in all later versions of Excel 2010, 2013, and 2016.

For example, to count how many “Apples” (column A) have made $200 and more sales (column B), you use the following COUNTIFS formula:

And again, to make your COUNTIFS formula more versatile, you can supply cell references as the criteria:

You will find plenty more formula examples here: How to use Excel COUNTIFS function with multiple criteria.

Count the number of cells in a range (ROWS and COLUMNS functions)

If you need to find out the total number of cells in a rectangular range, utilize the ROWS and COLUMNS functions, which return the number of rows and columns in an array, respectively:

=ROWS(range)*COLUMNS(range)

For example, to find out how many cells there are in a given range, say A1:D7, use the following formula:

=ROWS(A1:D7)*COLUMNS(A1:D7)

You may also be interested in

Cách Sử Dụng Hàm Đếm Trong Excel (Count, Counta, Countif,…)

Cách sử dụng các hàm đếm trong Excel – Count, Counta, Countif, Countifs

Các loại hàm đếm và ý nghĩa

COUNT: Hàm đếm các ô có chứa số

COUNTA: Hàm đếm các ô không rỗng

COUNTBLANK: Hàm đếm các ô trống

COUNTIF: Hàm đếm theo một điều kiện

COUNTIFS: Hàm đếm theo nhiều điều kiện

Lên đầu trang ↑

Cách sử dụng hàm COUNT, COUNTA

Cú pháp:

=COUNT(value1, value2, ...) =COUNTA(value1, value2, ...)=COUNTBLANK(range)

Trong đó:

value1, value2, … : với Excel 2007+, có thể có tối đa 255 đối số, còn với Excel 2003 về trước, con số này là 30.

Lưu ý:

– Hàm COUNT sẽ đếm những đối số là số, ngày tháng, hay các chữ thể hiện số. Với những đối số là giá trị lỗi hay các chữ không thể dịch thành số sẽ không được đếm.

– Nếu cần đếm các giá trị logic, text, hay các giá trị lỗi, bạn sử dụng hàm COUNTA, với cùng cú pháp.

– Các ô có chứa công thức trả về là một chuỗi rỗng (“”) cũng được hàm COUNTBLANK đếm như các ô rỗng bình thường. Nhưng với các ô có chứa giá trị =0 sẽ không được đếm.

– Công dụng: Đếm số lượng các ô trong vùng thỏa một điều kiện cho trước

– Cú pháp:

=COUNTIF(range, criteria)

Trong đó:

– Có thể dùng các ký tự đại diện trong điều kiện: dấu ? đại diện cho một ký tự, dấu * đại diện cho nhiều ký tự. Để tìm điều kiện là những dấu ? hoặc * thì gõ thêm dấu ~ ở trước dấu ? hay *

– Hàm COUNTIF không phân biệt điều kiện chữ hoa hay chữ thường.

– Công dụng: Đếm số lượng các ô trong một vùng thỏa mãn nhiều điều kiện cho trước

– Cú pháp:

Trong đó

=COUNTIFS(range1, criteria1, range2, criteria2, …)

range1, range2… : Có thể có tối đa 127 dãy các ô để đếm. Chúng có thể là ô chứa số, text, tên, mảng, hay tham chiếu đến các ô chứa số, ô rỗng sẽ được bỏ qua.

criteria1, criteria2… : Có thể có tối đa 127 điều kiện để đếm.

Lưu ý: Mỗi ô trong vùng dữ liệu để đếm chỉ được đếm nếu tất cả các điều kiên tương ứng với ô đó đều đúng.

=COUNTIFS(B3:B9;"Bút";C3:C9;"<50")→ 0

Lên đầu trang ↑

Lời kết

Như vậy chúng tôi đã hướng dẫn các bạn cách sử dụng họ hàm COUNT trong Excel để các bạn có thể áp dụng vào việc tính toán và thống kê dữ liệu. Các hàm COUNT này cũng thường được kết hợp với các hàm khác để xử lý công việc nhẹ nhàng và hiệu quả hơn.

Các Sử Dụng Các Hàm Đếm Trong Excel (Count, Counta, Countif,…)

Một trong những họ hàm cơ bản nhất trong Excel là các hàm đếm (Count, Counta, Countif, Countifs) để đếm dữ liệu, các đối tượng trong chuỗi trong một bảng tính nhất định.

Nếu như bạn đăng băn khoăn chưa biết cách sử dụng hàm này thì trong bài viết này, chúng tôi sẽ giới thiệu với các các hàm trong họ này để các bạn có thể áp dụng trong công việc.

Cách sử dụng các hàm đếm trong Excel – Count, Counta, Countif, Countifs

1. Các loại hàm đếm và ý nghĩa

COUNT: Hàm đếm các ô có chứa số

COUNTA: Hàm đếm các ô không rỗng

COUNTBLANK: Hàm đếm các ô trống

COUNTIF: Hàm đếm theo một điều kiện

COUNTIFS: Hàm đếm theo nhiều điều kiện

2. Cách sử dụng hàm COUNT, COUNTA

Cú pháp:

=COUNT(value1, value2, ...) =COUNTA(value1, value2, ...) =COUNTBLANK(range)

Trong đó:

value1, value2, … : với Excel 2007+, có thể có tối đa 255 đối số, còn với Excel 2003 về trước, con số này là 30.

Lưu ý:

– Hàm COUNT sẽ đếm những đối số là số, ngày tháng, hay các chữ thể hiện số. Với những đối số là giá trị lỗi hay các chữ không thể dịch thành số sẽ không được đếm.

– Nếu cần đếm các giá trị logic, text, hay các giá trị lỗi, bạn sử dụng hàm COUNTA, với cùng cú pháp.

– Các ô có chứa công thức trả về là một chuỗi rỗng (“”) cũng được hàm COUNTBLANK đếm như các ô rỗng bình thường. Nhưng với các ô có chứa giá trị =0 sẽ không được đếm.

– Công dụng: Đếm số lượng các ô trong vùng thỏa một điều kiện cho trước

– Cú pháp:

=COUNTIF(range, criteria)

Trong đó:

– Có thể dùng các ký tự đại diện trong điều kiện: dấu ? đại diện cho một ký tự, dấu * đại diện cho nhiều ký tự. Để tìm điều kiện là những dấu ? hoặc * thì gõ thêm dấu ~ ở trước dấu ? hay *

– Hàm COUNTIF không phân biệt điều kiện chữ hoa hay chữ thường.

– Công dụng: Đếm số lượng các ô trong một vùng thỏa mãn nhiều điều kiện cho trước

– Cú pháp:

=COUNTIFS(range1, criteria1, range2, criteria2, …)

Trong đó

range1, range2… : Có thể có tối đa 127 dãy các ô để đếm. Chúng có thể là ô chứa số, text, tên, mảng, hay tham chiếu đến các ô chứa số, ô rỗng sẽ được bỏ qua.

criteria1, criteria2… : Có thể có tối đa 127 điều kiện để đếm.

Lưu ý: Mỗi ô trong vùng dữ liệu để đếm chỉ được đếm nếu tất cả các điều kiên tương ứng với ô đó đều đúng.

=COUNTIFS(B3:B9;"Bút";C3:C9;"<50")→ 0

Nguồn: https://topthuthuat.com/cach-su-dung-cac-ham-dem-trong-excel/