Andy Samberg believes it is possible to stay friends with your ex, if you really want to.

The Saturday Night Live funnyman - whose rumoured ex-girlfriends include Natalie Portman, Kirsten Dunst and Ellen Page - stars with Rashida Jones in new movie Celeste And Jesse Forever, a "romantic dramedy" about a divorcing couple trying to stay friends while moving on with their lives.

Andy said of befriending an ex: "I do [think you can]. I don't think everyone can. But I think there's certain instances where if it's what both people really want and they communicate properly.

"Frankly I think time probably has to pass, but everyone has their own specific scenario for that."

The actor and comedian admitted the film was a change of direction for him, but said the comedy element had helped ease him into drama.

He said: "It was challenging and I knew going into it, it would be a different experience for sure.

"I kind of waited it out and thought if I was ever going to try doing something that had a little more of a serious edge to it this would be a perfect start for that, because it has comedy and it's with people I know and trust and I really like the material."

Rashida co-wrote the film with friend and co-star Will McCormack and asked Andy to get involved.

He said: "Rashida sent me the script to check out as a writer and the thought of acting with her sounded fun, 'cause we were already friends."