- MCP server with stdio transport for local use - Search episodes, transcripts, hosts, and series - 4,511 episodes with metadata and transcripts - Data loader with in-memory JSON storage 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
163 lines
13 KiB
Plaintext
163 lines
13 KiB
Plaintext
Episode: 1595
|
|
Title: HPR1595: 37 - LibreOffice Calc - More Financial Functions
|
|
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr1595/hpr1595.mp3
|
|
Transcribed: 2025-10-18 05:36:04
|
|
|
|
---
|
|
|
|
This episode of HBR is brought to you by AnanasThost.com.
|
|
Get 15% discount on all shared hosting with the offer code HBR15.
|
|
That's HBR15.
|
|
Better web hosting that's honest and fair at AnanasThost.com.
|
|
Hello, this is Ahuka, welcoming you to Hacker Public Radio and another
|
|
exciting episode in our ongoing series, Libra Office Calc, and this time I'm going to pick up
|
|
from what I did last time on looking at loan payments and I'm going to do a little more on
|
|
financial functions before we move on to the next group of things.
|
|
So in the previous episode we looked at how to determine loan payments both manually and by using
|
|
the built-in PMT function. Now we want to look at a few more of the financial functions that you
|
|
might want to use. First one is something called present value. This is just a rearrangement
|
|
of the formula we use to calculate the payment and it has all of the same variables involved.
|
|
But instead of solving for the payment we use the payment to solve for how much it is worth.
|
|
The best example of this sort of thing is a winning lottery ticket.
|
|
If you should ever be so fortunate as to win a lottery you may be told that you won, for example,
|
|
$1 million. Sounds good, doesn't it? Then you get to the fine print and discover,
|
|
well this is $50,000 a year for 20 years. Now if you multiply $50,000 by 20 you get a million
|
|
to be sure, but what did you really receive? This function lets you calculate what the
|
|
equivalent is in money you get today as a lump sum. To select this formula,
|
|
go into the financial functions, select PV, click next and the data you need to enter is first rate.
|
|
So here I'd put in the rate of return that you would get if you got the money today in one lump sum
|
|
and invested it. For example, if you have money in a mutual fund, what is the annual rate of return
|
|
on investments there? You can often get this information by doing a little online research,
|
|
such as Yahoo Finance, Link in the Show Notes. Number of periods, the NPE are variable,
|
|
sounds familiar? If you're using an annual rate of return this should be the number of years,
|
|
say 20 in our example. If the payments are monthly over the 20 year period, put in 240,
|
|
they make sure you adjust the rate of return to get a monthly average. PMT, this is the amount
|
|
you receive each period. If it's an annual payment, our example would be $50,000. If you're getting
|
|
monthly checks instead, enter $4,166.67. Now note that all of these fields are in bold,
|
|
which means they are mandatory. You have to enter them for the function to work.
|
|
Any fields not in bold are optional. Now if you run the numbers using annual payments of
|
|
$50,000, the answer is $456,427.28. But if you get monthly payments, the answer is $463,103.98.
|
|
The logic here is that with a check coming in each month, you can invest the money during the year
|
|
and get a slightly better return than with one payment at the end of the year. Remember,
|
|
the default assumption is end of the year. If instead you get it at the beginning of the year,
|
|
put a one in the type field and now your total jumps to $497,505 in 74 cents.
|
|
The other thing to note is that the number comes back as a negative number. In finance,
|
|
there's just a shorthand way of noting the direction of the cash flow. This function is also
|
|
used to calculate the present value of the stream of payments you make. So don't worry about the
|
|
negative. We saw that last time as well. Now there's also a function future value.
|
|
Just another rearrangement of the same formula. If I put aside to some of money each year,
|
|
how much will I have at retirement? Assume a monthly amount of 100 and that you have 40 years
|
|
before you retire. As in the above example, find the average rate of return for your investment.
|
|
In my example, I assume the same 9% annual as in the above example.
|
|
Payment of 100, rate 0.09 divided by 12, which is 0.0075,
|
|
number of periods, 40 times 12, which is 480.
|
|
And the answer, again, it's negative. Don't pay any attention to that. It is 468,132.3.
|
|
So if you wanted to retire with a million dollars, this won't get it done.
|
|
So what would you need to do? Well, the PMT function can do that. Use the same number of periods
|
|
and the same rate of return, plug it into a PMT function with 1 million as my future value
|
|
and solve for the monthly amount. This is a slightly different use of the function,
|
|
but the adjustments you need to make are simple. In the present value field, enter a 0 to assume
|
|
you start with nothing and the future value field enter 1 million. Note that the future value
|
|
field is considered optional by the function, but you need to use it to get this done.
|
|
Enter all of this and you get the answer of $213.61.
|
|
Ah, but suppose you have a head start. Your maiden Aunt Matilda has passed away and you are her
|
|
heir to the tune of $10,000, which you decide to invest entirely and save for retirement.
|
|
Well, just use the same formula, but instead of putting in 0 for present value, put in the 10,000
|
|
you received as a request. Now, note, you need to make this a minus 10,000 for the formula to work.
|
|
Now when you run the formula, you will get $136.48. The logic here is that you are investing
|
|
that 10,000 for 40 years and just letting the returns compound so you don't need to add as much to it.
|
|
Duration is another formula that we another function. This is even simpler.
|
|
This function is for the question of how long you need to leave a quantity of money invested
|
|
to get a given final amount. Let's begin with Aunt Matilda,
|
|
Mayshe Reston piece, and her request of $10,000. How long would it take to get 1 million
|
|
at the same 9% rate of return? Assuming we get our returns compounded monthly, we have rate
|
|
is .0075, that's .09 divided by 12, remember that. Present value is 10,000. Future value is 1 million
|
|
and then we're solving for the number of months. Well, that comes out to be 616.32.
|
|
If we divide that by 12, we get the years, which is 51.36.
|
|
Now, we're going to do something interesting here, create a mortgage payment schedule.
|
|
A problem that many people might find interesting concerns a home mortgage. Generally,
|
|
you borrow a sum of money to purchase a home and you have fixed monthly payments.
|
|
Part of each month's payment goes to interest on the loan and part to principle.
|
|
Because in the early years, so much principle is still owed, most of the monthly payment goes to
|
|
paying interest on the mortgage. But as you pay down the proportion gradually shifts,
|
|
so that in the last years, most of each payment goes to principle.
|
|
Now, in the United States, mortgage interest is a tax deduction, so homeowners have a reason
|
|
to be very interested in the amount of interest they pay. The IPMT function is designed
|
|
to tell you that and it is very simple. The variables are the ones we've all seen.
|
|
Rate is the interest rate on the loan calculated per period, generally monthly. Period.
|
|
Which period are we looking at? This starts at 1 and goes as high as the length of the loan.
|
|
N-P-E-R, number of periods, calculated as months in this case.
|
|
Present value would be the amount you have borrowed.
|
|
Future value, the amount you have left to pay at the end of the loan,
|
|
generally this is going to be zero. Type indicates whether a payment is at the beginning of the month,
|
|
which is a one, or at the end of the month, zero, or left blank, it will assume a zero.
|
|
Now, note that there is a corresponding function that gives you the principle payment,
|
|
and that's called PPMT, and it has all of the same arguments.
|
|
Put these two functions together and you can easily create a mortgage repayment schedule.
|
|
Now, for the arguments, I will use the same principle I used in the simple savings model,
|
|
and I'm going to place these in their own section off to the right.
|
|
You may remember, we talked about how to construct spreadsheets in the proper way.
|
|
Now, in mine, I put in the annual rate, then calculated the monthly rate as an intermediate calculation.
|
|
Now, we talked about the intermediate calculations earlier.
|
|
Then I added number of periods, and assumed a 20-year loan, which means 240 monthly payments.
|
|
For the amount borrowed, I put in 100,000, and for future value, I put in zero.
|
|
Then I set up my schedule as follows.
|
|
In I select cells A1 through D1, then merge and center the cells.
|
|
Give them a nice blue background. Set the font for aerial 12 bold and type mortgage schedule.
|
|
Then I select cells A through A2 through D2, but I don't merge them.
|
|
I set the background to salmon. In cell A2, I type period. In cell B2, I typed interest amount.
|
|
In cell C2, I typed principal amount. In cell D2, I typed total payment.
|
|
Then in cell A3, I enter the number one, and then click and drag through the A column until I have
|
|
240 periods, which I will fill out. Now, in cell B3, I enter the IPMT function.
|
|
Now, when I fill this out, I need to think ahead a little.
|
|
I plan to click and drag to fill this column, and that means I need to be careful to give
|
|
absolute cell references, which is done by using the dollar sign character.
|
|
My loan terms assumptions are all in the H column, so when I fill out this function,
|
|
it's like this. Rate equals dollar sign H, dollar sign 3. Period equals A3.
|
|
Note that this one does not use an absolute cell reference.
|
|
I want this to increment when I click and drag to fill the column. I've got 240 periods to calculate.
|
|
N-P-E-R, number of periods equals dollar sign H, dollar sign 4.
|
|
P-V, or present value, equals dollar sign H, dollar sign 5.
|
|
F-V, or future value, equals dollar sign H, dollar sign 6.
|
|
And then for type, I put in 0, which indicates a payment at the end of each month.
|
|
Since you generally have one month between the time the loan is signed and the time your first
|
|
payment is due, this is really the most realistic way of calculating this.
|
|
Then in cell C3, I enter the PPMT function and fill it out exactly the same.
|
|
Then finally in cell D3, I add them together to get the total monthly payment.
|
|
So I put in equals B3 plus C3. Again, do not use absolute cell references here since you want
|
|
these to increment as you fill the column. Then click and drag all three of these columns.
|
|
And note that you can select B3, C3, and D3 altogether.
|
|
Click on B3, then hold down the shift key and click on D3. You'll have all three of them selected.
|
|
And then you can click and drag to fill all of them at once. That's something we covered earlier.
|
|
So what's the result? Your monthly payment is $836.44.
|
|
In the first month, your interest payment is $666.67.
|
|
But by the end, the interest payment is $5.54.
|
|
So some final notes.
|
|
One of the things you can do is modify the values in your spreadsheet and get new values
|
|
if you set it up correctly. You could theoretically just enter the numbers into your function
|
|
and see what the result is. But if you first put that data on your spreadsheet and use cell references,
|
|
you can easily change the data in the cell and instantly get an updated result.
|
|
This is another good reason to do intermediate calculations. Since you can store the result in a
|
|
cell and when you update the base number, everything recalculates.
|
|
The examples we have used all involve similar variables.
|
|
And that turns out to be true of a lot of these financial functions. Once you've learned one or
|
|
two, it's pretty easy to pick up the others. Start by looking at the function and see what arguments
|
|
it requires and then gather the data. As in so many things in life, preparation is more than 50%
|
|
of the job. Finally, the functions I've used were selected for general interest to a lay audience.
|
|
Many of the other financial functions are of specialized interest to accountants or to investors.
|
|
If you are one of those people, you probably know all of this anyway. But the principles we've
|
|
discussed will keep you in good shape as you use these other functions. Now I've done everything
|
|
we talked about in today's episode on a spreadsheet myself, which I have uploaded to the website.
|
|
Link is in the show notes. You can download it and poke around and take a look at it for yourself.
|
|
So, having said that, this is Ahuka signing off for Hacker Public Radio and reminding you,
|
|
as I always do, to support FreeSoftware. Goodbye.
|
|
You've been listening to Hacker Public Radio at Hacker Public Radio. We are a community podcast
|
|
network that releases shows every weekday Monday through Friday. Today's show, like all our shows,
|
|
was contributed by an HBR listener like yourself. If you ever thought of recording a podcast,
|
|
then click on our contribute link to find out how easy it really is. Hacker Public Radio was
|
|
founded by the digital dog pound and the infonomican computer club, and it's part of the binary
|
|
revolution at binrev.com. If you have comments on today's show, please email the host directly,
|
|
leave a comment on the website or record a follow-up episode yourself. Unless otherwise status,
|
|
today's show is released on the creative comments, attribution, share a light 3.0 license.
|
|
You've been listening to Hacker Public Radio at Hacker Public Radio at Hacker Public Radio.
|