Trouble with formula not working any more with new entries
I'm having some trouble with counting duplicates excluding the first occurrence. It's all fine if I don't touch the table any more (add new entries), but as soon as I add something new and then re-order a column, some cells loose the reference.
So here's what I used:
=IF(COUNTIF($A$2:A2,A2)>1,"Yes","") in the first cell of a column (let's say column B) and then dragged formula down the column, to display YES next to an entry of column A if it is a duplicate, excluding the first occurrence.
The above worked well for my existing entries, but as soon as I add a new entry to the end of my table and then re-order the table alphabetically and the new entry happens to be at the very top now because of its name, the cell where it's supposed to show YES (or nothing) for that new entry gives me an error and where the $A$2:A2 part used to be, it's now #REF! in the formula.
How can I make sure the formula get's passed along to new lines added ABOVE the initial first line? It's all fine "down", so if a new line is added to the end of the table, the formula gets passed down it works fine.
I'm sure I'm missing something here. Any ideas are highly appreciated!
MacBook Pro (2020 and later)