Yes, they got it right (pretty much) on last week's episode of "The Office" when the team at Dunder Mifflin found themselves in a debate on the difference between "whoever" and "whomever."
Pam and Toby were among the workers who knew that "whoever" is a subject and "whomever" is an object. (Kevin claimed to know, too, but that's kind of hard to believe from a thirtysomething guy in a Police cover band and who once told Ryan he's "so money.")
Of course, that doesn't help you enough in situations such as my oft-quoted real example from NPR: "The United States will work with whomever wins the election."
Yes, "whomever" is an object in this sentence -- an object of the preposition "with." But it's also a subject -- the subject of its own clause "whoever wins." And the rule is, whenever you need a pronoun that's both a subject and an object, the subject form wins.
So it's "We'll work with whoever wins the election." NPR got it wrong. Just like Michael Scott.