Few moviegoers (or TV viewers) familiar with his work will deny that Steve Carrell is a funny man. Carrell has endeared himself to the 18-24 demographic as a regular during the heyday of “The Daily Show,” and as scene-stealer Brick Tamland in the stupidly-funny (though more funny than stupid) “Anchorman.” But what remained to be seen until this August was whether he could carry a major motion picture, an end-of-summer blockbuster no less, as a leading man.

He can.

Sporting both starring and writing credits for “The 40 Year Old Virgin,” Carrell shows off an intelligent brand of slapstick humor with acting skills to boot. He avoids the cheap gimmicks that tend to haunt most late-night television stars’ voyages into Hollywood (Jimmy Fallon, anyone?). Even weirder, he proves to be almost tearjerkingly fragile, all the while twitching and cursing with zeal.

At first glance, a movie about a lonely 40-year-old man (who acts and dresses quite a bit like Mr. Rogers) seems both crass and cruel, almost like the sort of contemporary freak-shows that keep Jerry Springer — and reality television — in business. Ten minutes into the film, it becomes overtly clear that this is not the case. Instead, we find something more like a middle-aged version of the lovable and easily relatable awkwardness of “American Pie,” even “American Graffiti.”

The four sexless decades under his belt might make one wonder about Andy Stitzer’s character. But the straight-laced nerd (nerdier than the average electronics salesman) lacks any particularly horrific characteristics that would condemn him to his unusual fate, let alone turn the viewer off.

Which begs the question: why is Andy unable to fulfill what some would say such a common life goal? A hilarious series of flashbacks (including the always-classic orthodontic hurdle to oral sex) shows that after hauntingly bad early romantic encounters, he just stopped trying; pursued other interests (the tuba, video games, collecting things); tried to forget about the raging hormones responsible for his ponderously hairy chest (as well as other more personal inconveniences).

And now, Andy finds himself a respectful and self-contained middle aged virgin, one who values peace and quiet rather than gratification. It is a smart emotional point of the film that Andy is more self-content than many of the film’s other characters, though of course he’s inevitably a bit insecure and a little off-beat. Who are his sex-obsessed coworkers to fault him for it?

That is, until his big secret slips out at a poker game (a scene that is featured with annoying prominence on the film’s trailer). From then on, three men who had previously just been his coworkers become both his close friends and relationship advisors — despite the dark shadows of dysfunction that haunt their own romantic lives.

Seeming good guy David (Paul Rudd) is perhaps the most understanding; he reassures Andy that he doesn’t have to try to have sex right away. Yet David is himself obsessed with an ex-girlfriend from two years ago, who has been forced to move and change her phone number to avoid his advances. Then there’s Cal (Seth Rogen) who enters the story when recounting his laughable trip to Tijuana. Perhaps the most troublesome, however, is the token black friend, Jay (Romany Malco), who alternates between sexist rants and half-baked seduction advice.

But with the help of his friends, Andy finds himself a “hot grandma”: a 40-year-old mother of three named Trish (Catherine Keener, who leaves behind the toughness of “Being John Malkovich” in favor of a befitting vulnerability). They hit it off in a stereotypical romantic comedy fashion, but the film is too smart and funny to let them go happily. An encounter involving Trish’s children and a small mountain of unrolled (but unused) condoms prompts the pair to swear off sex for at least their first 20 dates.

Despite being a bit lengthy, the movie comes off almost perfectly. The film maintains cheer, tenderness, originality and lewdness on appropriate occasion. The film is charming in its honesty and hilarious in its exaggeration, carefully balancing the crass and the sentimental.

It works well because we all experience (if not on a lesser scale) the moments of agonizing vulnerability and awkwardness that plague Andy’s search for love. “Virgin” and its writer and star speak to the frightened voice that worries we will never be loved (or laid) as often as everyone else.