=COUNTIF(D1:D400,A1)

That will count all the instances of cell A1 in the range D1:D400