
I am assuming that you are attempting to calculate Yield to Maturity. If so. please refer to the following YIELD function at the following Microsoft site and see if that helps.
https://support.microsoft.com/en-us/office/yield-function-f5f5ca43-c4bd-434f-8bd2-ed3c9727a4fe