Excel LINEST function in Apex Salesforce

As a developer we sometime need to implement excel function in code for meeting client’s requirement. Here I will share code for Excel LINEST function in apex. You can check LINEST function/method of excel here.

See below code method, you can use it in your apex class.

It will save your time if you need to write it from scratch in apex. I am open for your valuable feedback.

Happy Coding 🙂