I am trying to write a macro that can solve for a value that is the closest to a pre-dertermined value. I am unable to solve for the exact amount because I am dealing with a specific number of payments to achieve a desired yield. I am only able to have whole payments (not partial). Is there anything I can incorporate into the macro to solve for the whole value that is the closest to the value I am solving for? Also, is there any way to make sure the whole value that is closest to this value is greater than the value?
Specifically - I have a 12 month payment stream. The yield I need to achieve is X. Certain variables can change the payment structure for the 12 months, and I need to be able to hit a button that will solve the number of payments it will take for the yield to be greater than or equal to X. Obviously, I want the value that is closest to X as well.
Specifically - I have a 12 month payment stream. The yield I need to achieve is X. Certain variables can change the payment structure for the 12 months, and I need to be able to hit a button that will solve the number of payments it will take for the yield to be greater than or equal to X. Obviously, I want the value that is closest to X as well.