Running Count
To apply running count firstly sort the data on the basis of which you want to apply the countif formula eg. Like below data is firstly sorted on basis of city and after that apply countif formula. A1 City Formula Ans A2 Delhi =countif($a2$:a2,a2) 1 A3 Delhi =countif($a2$:a3,a3) 2 A4 Delhi =countif($a2$:a4,a4) 3 A5 Mumbai=countif($a2$:a5,a5) 4 A6 Mumbai=countif($a2$:a6,a6) 5