Very confused about what you are trying to do. Maybe this:
Formula: copy to clipboard
=COUNTIF($D$4:$D$7,$D4)