# Excel Formulas - Count number of cells begins with string

## Count number of cells begins with string

Syntax of used function(s)

```COUNTIF(criteria_range, criteria)
```

The COUNTIF function is used to count the number of cells that meet a certain criteria.

Explanation

To count number of cells from a range of cells that begins with a specific text, the COUNTIF function can be used.

Formula

``````
=COUNTIF(B5:B11,"DS*")

``````

How the formula works

In the above example the COUNTIF function counsts the number of cells which begins with the text "DS". The wildcard "*" have been used to match any other characters after the text "DS".

## Count number of cells begins with string using range name and criteria range

Explanation

To count number of cells from a range of cells that begins with a specific text, the COUNTIF function can be used. The range B5:B11 named as Invoice_No.

Formula

``````
=COUNTIF(Invoice_No,D8)

``````

How the formula works

In the above formula the range have assigned by a name and D8 is the criteria variable. The COUNTIF counts the value of D8 within the range "Invoice_no" and return the result.

﻿