put down to

put (something) down to (something else)

1. To regard a situation, action, or outcome as being the result of some specific aspect, condition, or event. The runner put her leg pain down to simple muscle fatigue, but she was shocked to learn that it was due to deep vein thrombosis. I put most of my success down to the excellent education I received in college.
2. To regard a situation, action, or outcome, especially a negative one, as a means of gaining something positive. I know you're upset about failing your exam, but just put it down to experience and study harder next time. I doubt I'll get my money back for this broken computer. I guess I'll just put it down to learning the hard way to be more careful when I buy used products.
See also: down, put
Farlex Dictionary of Idioms.

put something down to something

 and set something down to something
to explain something as being caused by something else. I put his bad humor down to his illness. We set your failure down to your emotional upset.
See also: down, put
McGraw-Hill Dictionary of American Idioms and Phrasal Verbs.
See also:
  • put (something) down to (something else)
  • down to (someone or something)
  • down to somebody/something
  • hand over the baton
  • pass on the baton
  • pass the baton
  • baton
  • hand on the baton
  • front runner
  • front-runner
References in classic literature
A poem of the satirical kind cannot indeed be put down to any author earlier than Homer; though many such writers probably there were.
Due to the severe injuries the creamy brown-coloured animal sustained, the RSPCA said it was put down to end its "unbearable suffering".
Our house is now much admired by our friends, a fact that my wife puts down to its stylishness, and that I put down to their politeness - Harry Enfield.I practised 26 hours a week and ultimately achieved the status of a decent seven-year-old - Actor Russell Crowe who had to learn the violin for a new film part.
Two horses weren't killed, they were put down to save them from further suffering.