Which of the following should you say?
a. Give this prize to whomever won the race.
b. Give this prize to whoever won the race.
Did you guess A? Then you're wrong. But why?
We naturally assume, when dealing with who and whom, or whoever and whomever, that whom is what follows a preposition, because a preposition requires an object: To whom were you speaking, young lady?
Normally, that's true. But here's the catch: the preposition to, in the sentences above, introduces a clause. Since a clause has to have both a subject and a predicate, the subject needs to be in the nominative (i.e., subject) case, not the accusative (i.e., direct object) or dative (i.e., indirect object).
So if the boss says something like, "I'll congratulate whomever brings in the most cash for the company," then you know you're dealing with a grammatical idiot. He should have said "whoever."
RULE OF THUMB: ask yourself-- is who(m)ever introducing the clause, or is it the subject of the clause?
We're not done, though. What about a sentence like this:
I'll congratulate whomever the crowd cheers loudest.
Is whomever correct? Yes, it is. Why?
It's because whomever is, in this case, functioning as a relative pronoun introducing a clause. The subject of the clause in question is the crowd, and whomever is actually the object of the verb cheers. (By the way: you see relative pronouns all the time.)
Hope this helps. Here's a quick quiz.
In the following sentences, are the words whoever and whomever being used correctly?
(Highlight the answers inside the parentheses to see them.)
1. "I'll French kiss whoever I want!" Meredith snarled at her husband Jim.
(Incorrect: it should be whomever, which is the object of the verb kiss. Note, too, that whomever is not the subject of a clause.)
2. "Oh, yeah?" replied Jim. "In that case, I'll kiss whoever comes through the door next!"
(Correct. Whoever is the subject of the clause.)
3. An angry German shepherd trotted in, bloodshot eyes rolling wildly in different directions, fangs dripping with blood and mysterious ribbons of flesh. "Ha ha! A kiss to whoever comes in next!" Meredith hissed spitefully.
(Correct. Again, whoever is the subject of the clause.)
4. "Whomever invented marriage ought to be shot," Jim growled as he bent to kiss the rabid dog.
(Incorrect. Because the word is the subject of a clause, it should be Whoever.)
5. Jim kissed the dog, which immediately transformed into the most gorgeous woman on earth. "I'm Delila," the woman said, "and I'm a gift from Zeus to whomever kisses me."
(Incorrect. Delila might be a gift from the Olympians, but she's having trouble with English. Whoever, not Whomever, is the subject of a clause.)
6. "But-- but--" Meredith sputtered as Jim began to walk out the door with Delila. "What about me?" Jim turned. "We'll divorce. You can marry whoever."
(Incorrect! This was a clear-cut case of whoMever as the object of a verb! A "whom" word would have been perfect here.)