Formula to find a ranked value and then add values until max value is reached.
I have created a table to the right that uses a rank of the values that shows up on the left. Through a formula or function is there a way to under the columns called par (three total columns labeled Par on the called "Call_2020") to find the first rank of "1" then look up that value and insert it in the par column and then find the second rank "2" and insert that value? This would continue until the value at the top called "funds to call bonds" is reached. This could mean that at some point the remaining balance left to call may not be enough to pay off all of the principal so you would insert the value you can with remaining funds available. I have been racking my brain for over a week and could not come up with something so hoping to leverage this network to see if anyone had any ideas they could throw out there. Any help would be greatly appreciated. DS-Repayment-Analysis.xlsx