Count cells in the column that have the same first five characters in Excel

=SUM(IF(LEFT(A2,5)=LEFT(A3,5),1,0))

A2 = data cell 1; A3 = data cell 2

Check below for a detailed explanation with pictures and how to use formulas in Excel and Google Sheets.

Count cells in the column that have the same first five characters in Excel

How to count cells in the column that have the same first five characters in Excel?
Count cells in the column that have the same first five characters in Excel

COUNT CELLS IN COLUMN THAT HAVE SAME FIRST FIVE CHARACTERS — EXCEL FORMULA AND EXAMPLE

=SUM(IF(LEFT(A2,5)=LEFT(A3,5),1,0))

Count cells in the column that have the same first five characters in Google Sheets

How to count cells in the column that have the same first five characters in Google Sheets?
Count cells in the column that have the same first five characters in Google Sheets

COUNT CELLS IN COLUMN THAT HAVE SAME FIRST FIVE CHARACTERS — GOOGLE SHEETS FORMULA AND EXAMPLE

=SUM(IF(LEFT(A2,5)=LEFT(B2,5),1,0))

Other useful "COUNT FUNCTIONS: TEXT BASED CRITERIA" formulas in Excel and Google SheetsOthers FormulasDate and time functionsExtract functions