# Count occurrences of string within a cell for entire column

#### mawheele

##### New Member
If I have a a column like:

313111
313112
313111
313144
314256
315876

How would I count occurrences of the string "313" in the beginning of each string, throughout hte column?

For instance, the count on this column would be 4.

Thanks to anyone with suggestions.

### Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

#### Jonmo1

##### MrExcel MVP
Try

=SUMPRODUCT(--(LEFT(A1:A100,3)="313"))

#### Gerald Higgins

##### Well-known Member
One way is to use a helper column.

If your numbers are in Col A, put this formula in Col B
Code:
``=left(A1,3)``

Then this formula will count the number of entries of 313 in Col B
Code:
``=COUNTIF(b1:b1000,"313")``

Works

Works thank you!

Replies
4
Views
506
Replies
9
Views
3K
Replies
1
Views
231
Replies
4
Views
286
Replies
1
Views
364

1,181,420
Messages
5,929,801
Members
436,696
Latest member
Mr Rice

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back