Quick, clean, and to the point

Count numbers that begin with

Excel formula: Count numbers that begin with
Generic formula 

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

In the example shown, the formula in E6 is:


Inside SUMPRODUCT, we use the LEFT function on the range of numbers like this:


This creates an array of results like this:


We then compare each value to "25" to force a TRUE or FALSE result. Note that LEFT automatically converts the numbers to text, so we use the text value "25" for the comparison. The result is an array of TRUE and FALSE values:


Next, we use a double negative co coerce TRUE FALSE values to 1 and zero, which creates a numeric array:


The SUMPRODUCT function then simply sums the elements in the array and returns 4.

Dave Bruns

Excel Formula Training

Formulas are the key to getting things done in Excel. In this accelerated training, you'll learn how to use formulas to manipulate text, work with dates and times, lookup values with VLOOKUP and INDEX & MATCH, count and sum with criteria, dynamically rank values, and create dynamic ranges. You'll also learn how to troubleshoot, trace errors, and fix problems. Instant access. See details here.

Download 100+ Important Excel Functions

Get over 100 Excel Functions you should know in one handy PDF.