I have a table where data is entered on the next empty row. In one column, 'D', is a numeric value (an ID number). I need a static count, running total of how many times that number appears as data is added. So the first time "123" appears, for example in D2, the formula in E2 will return and stay at '1'. The next time it appears, whether that's on the next row or several rows down, say in E6, the forumla in E6 would say '2' but the formula in E2 will remain at '1.'
I have a header row, so in my first row of data, in E2, I have =COUNTIF($D$2:D2, D2).
If all me data was already entered, I could copy this down and it would work fine... but when I go to add the next row, row 3, Excel automatically changed the formula in E2 to =COUNTIF($D$2:D3,D2) and my count was incorrect.
My current formula also seem susceptible to being incorrect if a row of data in the middle of the table needs deleted. Can't use VBA for this - has to be a formula.
Bookmarks