However "by" is used to denote the manner or reason something was done. So "in doing so" actually means "while doing so", but "by doing so" means "because I did so".
Which is correct by doing so or by so doing?
Senior Member. You're right, "by/in so doing" is a set expression and slightly archaic, but still common in elevated writing.
What does by doing so mean?
By doing so means 'as a result of that action'. He tied his shoelaces. In doing so, he hurt his back. He tied his shoelaces. By doing so, he was able to run without tripping.