How to Count Numbers that begin with Specific Value  in Excel

This post will guide you how to count numbers that begin with a specific value or number in Excel 2013/2016 or Excel office 365. How do I count the number of values that begin with a given specific value by using the SUMPRODUCT function and LEFT function in Excel. You can also use the COUNTIF function to count cells that begin with certain characters in Excel.

Assuming that you have a data of list in range B2:B6, and you want to get how many cells in your list which begins with a given number. For example, you wish to calculate the count of number in list where the values begin with “2020”.

Method1: COUNT Numbers that Begin with Specific Value


To count numbers in your range of list that begin with specific numbers, and you can use a formula based on the SUMPRODUCT function and LEFT function.

=SUMPRODUCT(–(LEFT(B2:B6,4)=”2020″))

count numbers that begin with1

Let’s See That How This Formula Works:

=LEFT(B2:B6,4)

count numbers that begin with3

This formula will extract the first 4 characters from the given range of cells. And it returns an array result like:

{“2019″;”2020″;”2020″;”2021″;”2023”}

count numbers that begin with2

=LEFT(B2:B6,4)=”2020″

count numbers that begin with4

The above array result will compare each value to “2020” to generate a TRUE or FALSE result. And this formula also returned as an array result of TRUE and FALSE values. Like this:

{FALSE;TRUE;TRUE;FALSE;FALSE}

count numbers that begin with5

=–(LEFT(B2:B6,4)=”2020″)

count numbers that begin with6

Then you need to use a double negative operator to convert TRUE or FALSE values to 1 and 0. It also returned an array result like:

{0;1;1;0;0}

count numbers that begin with7

SUMPRODUCT function sums the numbers in the above array and returns 2.

Method2: COUNT Numbers that Begin with Specific Value Using COUNTIF Function


You can also use the COUNTIF function to count the numbers that begin with a particular value. Like below:

=COUNTIF(B2:B6,”2020*”)

This formula use the asterisk wildcard to match any number of uncertain characters in length in your given range of cells.

#1 select Cell D3

#2 enter the above formula into Cell D3

Then you need to press Enter key to apply this formula.

count numbers that begin with8

Related Functions


  • Excel SUMPRODUCT function
    The Excel SUMPRODUCT function multiplies corresponding components in the given one or more arrays or ranges, and returns the sum of those products. The syntax of the SUMPRODUCT function is as below:= SUMPRODUCT (array1,[array2],…)…
  • Excel COUNTIF function
    The Excel COUNTIF function will count the number of cells in a range that meet a given criteria. This function can be used to count the different kinds of cells with number, date, text values, blank, non-blanks, or containing specific characters.etc.= COUNTIF (range, criteria)…
  • Excel LEFT function
    The Excel LEFT function returns a substring (a specified number of the characters) from a text string, starting from the leftmost character.The LEFT function is a build-in function in Microsoft Excel and it is categorized as a Text Function.The syntax of the LEFT function is as below:= LEFT(text,[num_chars])…t)…
Related Posts

Coefficient Of Variation in Excel/Google Sheet

This article will talk about how to calculate the coefficient of variation by formula in a Microsoft Excel spreadsheet or Google Sheets.  What is the Coefficient of Variation? The coefficient of variation is the ratio of the standard deviation of ...

8+ Best Free Monthly Budget Template

This article will show you some free and printable personal monthly budget templates or family monthly budgets for google sheet and Microsoft Excel spreadsheet applications, and will also explain some of the features or important functions of these templates. This ...

Best Free Wedding Planning Checklist

Everyone will be very much looking forward to their wedding, but actually preparing a wedding is very complicated and trivial, there are many small details to pay attention to, we will list in this article a comprehensive list of each ...

Free House Cleaning Schedule and Checklist (Daily, Weekly, Monthly)

This article will show you some free daily house cleaning schedule, weekly house cleaning schedule and monthly house cleaning schedule templates for google sheet and Microsoft Excel spreadsheet applications and will also explain some of the features or important functions ...

Rand Data by the Number of Occurrences in Google sheets

This article will talk about how to sort the specified data in google sheets according to the number of occurrences? How to use google sheets RANK function to sort a given cell range by the number of repetitions of a ...

Sidebar