Andy, Bryan Callen, is a 41-year-old virgin who shares a cramped apartment with his "high school age" friends Seth, Sanjay, Jonah, and Michael, while toiling part-time at a club as a failed stand-up comedian alongside his friend Blaqguy, who suffers from Benjamin Button's Disease. He seems largely oblivious to any romantic advances from women, and remains a virgin, much to Blaqguy's frustration.
One night at the club, he meets Kim, Noureen DeWulf, and there appears to be chemistry, but she receives a promotion and leaves abruptly, leaving behind her false leg. Later, during a poker game, his friends learn of Andy's lifelong virginity and scramble to help him lose it through a series of comedic, ill-fated schemes.
Andy then crosses paths with Sarah Marshall, Mircea Monroe, who instantly takes a liking to his awkward charm. After he vomits in his car, she tries to sleep with him, but his nerves get the better of him and he bolts. Reassured by Seth, Stephen Kramer Glickman, Andy regains his confidence and returns to Sarah, only to discover Blaqguy, now in a pubescent phase, sleeping with Sarah. A chaotic fight erupts, ending with Andy covered in feces.
The next day, Sarah arrives at Andy's apartment fully pregnant (she notes she is half Mexican) and claims the child is his. He denies it, and she leaves. In search of a escape from his woes, Andy goes on vacation to Hawaii, where he reconnects with Kim, who is now a hotel manager. Andy soon learns that Sarah and her new boyfriend, Aldus Snow, are staying in the room next to his. Once again denying paternity, Sarah and Aldus have a loud, provocative night in a bid to provoke jealousy in Andy.
That night, Andy goes on a date with Kim and, when they attempt to have sex, Sarah interrupts and a fight breaks out. Both Sarah and Kim eventually leave Andy. After a surreal encounter with Mace Windu and Yoda, Andy contemplates that virginity may extend his life and grant some measure of force control, but he ultimately rejects the idea after learning his scrotum would inflate in size.
Andy eventually reconciles with Kim, who is struck by a car and they marry soon after. On their wedding night, they finally consummate, but Andy's semen is so forceful that it blasts Kim through a window, subsequently triggering a chain of far-reaching events: wildfires in California, floods in Louisiana, and a thwarted missile attack by Kim Jong il.
A subplot unfolds around Jonah, Michael, and their friend McAnalovin' as they drift through parallel misadventures. After being pulled over by officers Beat and Yo' Ass for using a false ID to buy alcohol, McAnalovin' embarks on a Grand Theft Auto IV–style escapade that unintentionally unleashes an army of Mexicans upon himself and the officers. Jonah becomes separated and is briefly accused of pedophilia following an encounter with Chris Hansen. The two eventually regroup and make their way to Hawaii in the car that strikes Andy, only to be slain by the Mexican force. Meanwhile, Michael has fallen in with a cohort of lactose-intolerant vampires led by Edward Cullen.