Agree that one should use a decent wine for cooking. If you can drink it, it is probably OK.
But there are both sweet and dry sherries and both can be used in cooking. But not interchangeably. Sweet sherries, like cream sherries, are very pleasant as an after dinner drink and can be used in a number of recipes. But don't substitute it for dry sherry, that is often used as a before dinner drink, and can give a nice flavor to a number of sauces and dishes, including soups.
When in doubt, take a wee taste (or more) of the wine/sherry you are adding to the pot. If it doesn't seem right, don't add it.