D5:D5 indicates how much money is available for any required financing. D7:D16 indicates debts that qualify under the financing - that require financing. D18:D27 indicates how the above loan was allocated going from top to bottom in range. For example D18 would be 18 because there is 140 available, Then D19 would be 140 - 37 used, and on for this column. There are many columns, so a good formula would be great.