You might find yourself trying to decide whether you need to use the word whoever or whomever in a sentence. You might be someone who always uses whomever because it sounds more formal and therefor correct. Or you might be someone who always uses whoever because it sounds more casual and the way everyone talks. There is a difference between the two, and I'm going to teach you how you can decide which one is correct. So in order to decide, you need to figure out if you need a subject or an object in your sentence.
Whoever functions as a subject, and whomever functions as an object. Let's say I'm throwing a dance party, and I let my guests know, "Whoever arrives first gets to choose the music." Well in this case, I've chosen the word whoever, because I need a subject in this sentence. Let me show you why. Our verb is arrives. So to find the subject, we figure out who is performing the actin of the verb. In this case, it's whoever. Whoever arrives first gets to choose the music. So that's why I've chosen the subject version. There are instances when you need the word whomever. I'll give you an example. Let's say I love to dance. And so at my party, I will dance with whomever. Now why have I chosen the word whomever, with an M, in this sentence? Well let me show you. Our verb is dance. That's the action. Who's performing the action? It's I, which means I is the subject.
Who is the action falling on? Who am I dancing with? Well in this case, I'm dancing with whomever. Whomever is the object, which is why I need the word whomever instead of whoever in this instance. I use something I like to call the M trick just to verify that I'm making the right choice. And with the M trick, the word him can be substituted for the word whomever, because they both have an M.
And the word he can be substituted for the word whoever, because neither of them have an M. So let's see if the M trick works. I'll erase the word whomever and write the word him and see if my sentence still makes sense. I will dance with him. Makes perfect sense. So that's how you decide whether you need the word whomever or whoever in your sentence.