Jack Lemmon plays C.C. “Bud” Baxter, a lonely office pion who wishes to climb the corporate ladder in a national insurance company. As the film begins, we find out that C.C. has been allowing four midlevel managers to “borrow” his apartment for secret rendezvous with their respective mistresses. In return, the managers write glowing reports about C.C. to help with Baxter’s goal of getting out of the office pool.
However, C.C. finds that he often has to sleep in the park at night or hang out drinking in bars to late hours to accommodate the managers’ requests. Additionally, C.C. has to deal with the disapproving stares and comments from his neighbors over his apparent playboy lifestyle.
Eventually, the glowing reports of the managers reach the desk of the personnel director, Jeff Sheldrake. Sheldrake sees through the rouse, but instead of busting C.C. or the midlevel managers, he requests the key to C.C.’s apartment for his own extra-marital affair with the company’s elevator operator, Fran Kubelik, played by Shirley MacLaine. C.C. agrees, unaware that he and Sheldrake share the same taste in women.
Fran’s relationship with Sheldrake is unfulfilling and she plans on ending it. She makes plans to meet with C.C. at a show, but stands him up when Sheldrake convinces her, once again, that his marriage is coming to an end.
A few weeks later, at the company’s Christmas party, Fran learns that she is just latest addition to the list of women that Sheldrake has been involved with from Miss Olsen, Sheldrake’s secretary and former fling.
Additionally at the party, C.C. learns that Fran is Sheldrake’s mistress, crushing his hopes for a relationship with her. Despite the fact that it is Christmas Eve, Sheldrake asks for the apartment key, where he can have an evening of merriment with Fran. Unable to go to his own apartment to spend Christmas Eve alone, C.C. goes to drink his sorrows away and gets picked up by a married woman at the bar.
At the apartment, Fran confronts Sheldrake about what Miss Olsen told her. Sheldrake lies to her and tells her that he genuinely loves her, but then leaves to return to his family for Christmas. Before he leaves, Sheldrake leaves money for Fran for a Christmas present. Disgusted with herself and Sheldrake, Fran attempts to take her own life via pills. Fortunately, C.C. and his bar pick up arrive in time to save her. C.C. ditches the festive floozy and gets the doctor from next door to help save Fran.
The duo feed her coffee and slap her repeatedly to keep her awake and out of danger. However, C.C. keeps the authorities out of it, to help protect Sheldrake. Additionally, he plays off the misimpression of his neighbors that he is playboy, and allows them to think that he is cad that drove Fran to try to take her own life.
Fran spends the next two days, including Christmas, at the apartment recuperating. The two talk about their lives and loves. Eventually, Fran’s brother in law tracks her down at the apartment. Believing the worst of C.C., the brother in law punches him out. Fran thanks C.C. for protecting her, and kisses him goodbye.
The next day at the office, Sheldrake thanks C.C. for protecting him, and rewards him with another promotion to his assistant. Additionally, Sheldrake fires Miss Olsen for telling Fran about his past. Miss Olsen retaliates by telling Sheldrake’s wife about his affairs, who then responds by kicking him out of the family home. Now free from his marriage, Sheldrake believes he can follow through with his relationship with Fran in the open.
Despite being unattached, Sheldrake has no place to take Fran for a romantic interlude. So, he asks C.C. for the key to the apartment. C.C. refuses, and further states especially not with Fran. Sheldrake insists, and C.C. resigns rather than give into his boss’ demands. He returns home to start packing his apartment. That night at the New Year’s Eve party, Sheldrake informs Fran of what happened with C.C.
Realizing that C.C. is the one she is in love with, she leaves Sheldrake in the middle of the party and runs to C.C.’s apartment. Once there, she hears a loud noise coming from the apartment. Believing C.C. has shot himself, she pounds on the door of the apartment to find that C.C. has just opened a bottle of champagne for himself. C.C. is surprised to see her, and she is insists on finishing their gin rummy game that they started during their “lost weekend” over Christmas. When C.C. tells her that he loves her, she jokingly replies “Shut up and deal.”