1) The formula is working, what you should know, is that you must avoid empty fields... You can have empty cells in that column, but not in the first cells in column. For example, if the formula finds 3 unique records, first 3+1 cells must not be empty,
even if they have the same value; if there are 5 unique records in list, first 5+1 cells in that column must not be empty... Try typing something in cell B4, you will see that the formula works. Then, try deleting one of the first 2 cells: B2 or B3, the formula will not work again

2) This is definetely not possible with excel formulas, only VBA can help.