Adding Amortization Schedule of Many Loans-Macro Help

dariushou

Board Regular
Joined
Feb 17, 2008
Messages
126
Hi there,

I'm new to Macros and have been looking around on the board and google for a while to try to do this myself, but haven't succeded and hope someone out there can help me.

Here's what i have and what i want to do:

I have, lets say 1000 individual mortgage loans with each loans characteristics in its own row. For example, the first loan is in row 1 with all of its mortgage characteristics (age, rate, term, balance, etc...) in columns A thru M. So loan two starts on row 2 and so forth.

I then have produced the amortization schedule based on this loans characteristics. The amortization table is on another sheet and takes up columns A-J.

What i want to do is create a macro that goes through and amortizes all 1000 mortgage loans and sums up certain columns in my amortization table and puts this data in its own sheet within the same workbook.

I can do this manually by amortizing each loan separately and adding the columns i want, but as you can imagine, it would take a very long time.

Thanks for your help ahead of time.

Darius
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Any ideas on this one? I've been working on it for hours now and can't figure it out. I'm a newbie when it comes to Macros.

I appreciate your time.
Darius
 
Upvote 0
I think I know what you mean. I am faced with having to do this often. For example, if I want to aggregate the principal balances of all the loans in each period. Here is how I do it (I hope you can understand my explanation).

--------------------

From what you have said you have:

* all of the various loan details (row by row) in a lookup table,
* a set of columns that model the paydown of a given loan, and
* a field somewhere (lets say, for the sake of this discussion, that it is cell B2) which specifies which loan in the lookup table you want to feed into your paydown modelling (1, 2, 3, etc).

I am assuming that one of the columns in your paydown model is your "remaining principal" column (lets say, for the sake of this discussion, it is column M). Lets say we want to aggregate this profile over all of your loans. The way I do it is as follows.

Lets say that columns Y:Z are free and that the first row of your paydown column is row 2 (because you have a heading in row 1). In cell Y2 I put the formula:

=SUM(M2,Z2)

I then copy this formula down as far as your paydown column goes.

What you can then do is write a program to step through each loan (B2 = 1, 2, 3, etc) and at each loan you copy and paste values from column Y to column Z. Column Z will end up with the aggregate of all cashflows over time. A code example is below (obviously you always need to start by clearing the contents of column Z)

Code:
Sub Aggregate_My_Principal_Balances()
    
    numLoans = 100
    
    Columns("Z:Z").ClearContents
    
    For currLoan = 1 To numLoans
        
        Range("B2") = currLoan
        
        Columns("Y:Y").Copy
        Columns("Z:Z").PasteSpecial Paste:=xlPasteValues
        Application.CutCopyMode = False
        
    Next currLoan
    
End Sub

I hope this answers your question.
 
Upvote 0
I tried your solution, but column z just ends up with the last loans info. It doesn't aggregate all previous loans.

I'm basically trying to create a cash flow engine which amortizes all of my loans and aggregates them into totals for each column (Beginning Balance, Interes, Principal, etc...). Of course it would amortize each loan according to its characteristics (coupon, term, balance, etc...).

I have each loans characteristics in a row and have a vlookup which populates the loans characteristics of the loan to be amortized. Your code worked perfect for that, but it just wasn't aggregating (also can your code do more than one column at a time).

Thanks
Darius
 
Upvote 0
nevermind on that it didn't work. It did--i just had the sum formula off. By the way do you know how i can do more than one column at a time. I would like to do this to several columns at the same time. Also, any idea on how instead of summing, i can take the weighted average as i would like the weighted average coupon to be one of my outputs (weighted average coupon of all of the loans based on the beginning balance of the loans that period).

Thanks for all of the help.

darius
 
Upvote 0
ok, i played around with it and figured out how to do multiple columns at the same time, but can't figure out how to take the weighted average per my last post. Any idea how to pull this one off?

Thanks,
darius
 
Upvote 0
Just do this:

Y2 = SUM(M2*weight,Z2)

and then divide the numbers in the Z column by the sum of all of the weights.
 
Upvote 0
Hi cganivet,

I am wondering if you would be able to revisit this topic with me, creating an amortization table that aggregates loan data - yearBegBal, prinComponent, intComponent, yearEndBal - for an "n" number of loans.

I have studied the code that you provided above and I just cannot understand where in that code the amortization calculations take place.

So far, I have in one sheet the headings; opening balance, payment, interest, principal and ending balance.

I also have a table with loan data - remaining term (n), yield, and pv - in a row, that is, each loan (identified by a uique number) has its own row, with each of those peices of data.

My question is, how do I create and run a macro that basically runs a seperate amortization table for each loan, and then aggregates all of this together into a complete "aggregate amortization table."

Any advice would be greatly appreciated.

Thank-you.


<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,215,043
Messages
6,122,822
Members
449,096
Latest member
Erald

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top