# Excel VBA | count() functions

**Visual Basic for Applications (VBA)** is the programming language of Excel and other offices. It is an event-driven programming language from Microsoft.

With Excel VBA one can automate many tasks in excel and all other office software. It helps in generating reports, preparing various charts, graphs and moreover, it performs calculation using its various functions.

Let’s see **Count()** functions in Excel.

**COUNT:**It allows to count the number of cells that contain numbers in a range. One can use the COUNT function to calculate the total number of entries in an array of numbers.**Syntax:**

=COUNT(value1, value2…)

**value1:**The very first item required to count numbers.

**value2:**It can be specified upto 255 other entries which you want to count.**Note:**

**->**Only those arguments are counted that are numbers or text enclosed between quotation marks, as, “2”.

**->**Arguments like logical values and text representation of numbers that are typed directly are counted.

**->**Any values that cannot be translated to numbers are ignored.**Example:**

**Output:**

**COUNTA:**This counts only those range of cells which are not empty.**Syntax:**

=COUNTA(value1, value2…)

**value1:**It is the first argument to be counted.

**value2:**All additional arguments can be represented that has to becounted. This can be specified upto 255 arguments.**Note:**This will count cells that contain any kind of information that includes error values or empty text also, but not empty cells.**Example:**

**Output:**

**COUNTIF:**This will allow user to count the number of cells which meet a certain criteria.**Syntax:**=COUNTIF(where to look, what to look criteria)

**Example:**

**Output:**

**COUNTIFS:**It will map criteria to cells in multiple ranges and the number of times all criteria met are counted.**Syntax:**=COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2]…)

**criteria_range1:**First range to evaluate criteria.

**criteria1:**Criteria in any form that defines which all cells to be counted.

**criteria_range2, criteria2, … :**Additional range with their criteria. Specified upto 127 range/criteria.**Remarks:****->**Wildcard characters can be used.

**->**If criteria meets an empty cell, it will be treated as 0 value.

**->**Count increases by 1 as the first cells meet their criteria, then the second cell meet and count again increases by 1 and so on.**Example:**

**Output:**

## Recommended Posts:

- Must use JavaScript Array Functions – Part 2
- Must use JavaScript Array Functions – Part 3
- Reading and Writing data to excel file using Apache POI
- Activation functions in Neural Networks
- Higher Order Functions and Currying
- Creating a Cell at specific position in Excel file using Java
- Excel VBA | sum() functions
- Excel VBA | Average() Functions
- Creating Sheets in Excel File in Java using Apache POI
- Difference between Cyber Security and Information Security
- What’s the connection between Java and Blockchain?
- Introduction to Smalltalk
- E-commerce and Security Threats to E-commerce
- Experimental Section in GRE General

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.