Search code examples
excelformulacategoriesincrement

Excel formula to increment within each category


I have a column that defines the category and I am trying to calculate an increment value within each category. Is it possible to calculate it with a formula (not VBA) ?

Here is an example:

enter image description here


Solution

  • Disclaimer: I did this in Google Sheets, but I'm pretty sure Excel has COUNTIF

    So, assuming that the first cat is A1, put this in B1:

    =COUNTIF($A$1:A1, A1)
    

    Then you can pull it down or double click it so it is calculated for every row you have data for.