I'm trying to use a command that will testfor @p but exclude a specific player. This is the command I tried but it does not function:
/testfor @p[r=3,!name=name here]
The commands need to function with version 1.12.2
name=!Horst for a player "Horst".
You got close. The exclamation point goes after the equals sign in the target selector. The fixed command is:
I imagine the reason you got a down vote is because this question has an easy to obtain answer. Here is the wiki on the subject. The page is actually the wiki on all Minecraft commands and can be very useful when working with commands.