Are you using backticks (`) in the assignment to y? Or are you using single quotes (')?
If you use (`), then the shell will try to execute the command inside those backticks and assign the output to the variable y. While doing this, the 'select' is admitted by the shell as it is a shell builtin, but 'count' isn't so it tries to look for an executable file named count in your path, fails and throws the error.