Excel has been built and tested thoroughly by the experts at Microsoft. Furthermore it is tested everyday by users like yourself and Microsoft gets told about any issues with its tools or functions.
As much as possible try and use Excel’s tools and functions and don’t create your own. If you do, make sure you test them thoroughly!