Mr. Holmes premiered in New York on Monday; it hits theaters Friday

Credit: Neilson Barnard/Getty

Ian McKellen sees a bit of himself in every character he plays – but that goes double for his latest role as the enigmatic Sherlock Holmes.

“If I didn’t relate, then I wouldn’t be a good actor,” the two-time Oscar nominee told PEOPLE at the New York premiere of Mr. Holmes on Monday. “I relate to Sherlock’s optimism that it’s never too late to solve a puzzle and to find yourself. Even though he’s 93 years old in the movie, he solves a mystery, and discovers that he has a heart and not just a brain.”

Mr. Holmes, in theaters Friday, tells the bittersweet story of an elderly Sherlock who is struggling to remember the details of his final case as he loses his memory with old age. Laura Linney costars in the film as Holmes’s housekeeper.

It’s no surprise that McKellen, 76, took on the role of the legendary detective – in his career, the star has brought to life some of the most prominent and diverse literary characters in history, from Tolkien’s wise wizard Gandalf to Shakespeare’s brooding, grief-stricken Hamlet.

According to his costars, Sir Ian McKellen is the epitome of Sherlock Holmes, both in his latest flick and in real life.

“On set he is so in-character, so focused, just like Sherlock!” Hiroyuki Sanada, Holmes’s whimsical guide in the movie, tells PEOPLE. “My character sees Sherlock as a hero. For me, Sir Ian is my hero. I used my actual admiration for him to channel my character.”

When asked what other protagonists he might like to portray, McKellen smiles.

“I never want to play certain characters,” he says. “I judge everything based on the script. If I see myself as the character in the script, that’s the starting point.”