“It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth.”
Arthur Conan Doyle, The Adventures of Sherlock Holmes
Arthur Conan Doyle wrote this in The Adventures of Sherlock Holmes. It appears in The Adventure of the Beryl Coronet.
Where it appears
“ It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. Now, I knew that it was not you who had brought it down, so there only remained your niece and the maids. But if it were the maids, why should your son allow himself to be accused in their place? There could be no possible reason. As he loved his cousin, however, there was an excellent explanation why he should retain her secret—the more so as the secret was a disgraceful one.
From the public-domain edition, read it free.