LOG function or ln


My last visit here, you guys came up with a perfect and simple solution for me. Thank you.

Question #2:

Finding the Term, n when the Amount is Known.

I am supposed to use the LOG function, which i do and have successfully answered my questions, with other calculators... however!

I am now needing to know how to preform this function on the HP12c.

Quick example:
$200 is deposited at the END of each quarter, how many years will it take to amount to $12,000 if the interest rate is 16%, compounded quarterly?

Answer: n=31.20227 quarters or 7.8 years

If anyone is interested in helping me, simply lay out the key commands as such or a similar manner: 12000 FV > 16 Enter 4 ÷ i > 200 PMT (etc...) this is where i am now unclear.




I'm not a financial guy, but this sequence would seem logical to me:




Thank you Don, (is that like El Patron?)

That is perfect and very logical, however, how do i set it up so i get the exact above answer rather than rounding it to 32 periods exactly, where the actual answer should be 31.20227 or when divided by quarters 7.8 years and not 8 Years from 32 periods?

I render the same result with entering the 16% Compounded Quarterly as well... see below.

CLR FIN g END 200 CHS PMT 12000 FV 16 ENTER 4 ÷ i n


Your help has been more valuable than you can imagine, thank you again.



"Caribbean12C" --

It appears that you're asking how to get the exact mathematical answer using the HP-12C, rather than the answer rounded to the nearest integer that its standard TVM supplies.

I also got 31.20227 using an HP-10B.

You're on the right track with logarithms, but the correct function is the natural logarithm denoted "LN" on the HP-12C. ("LOG" denotes the base-10 common logarithm on HP calculators.)

Solve algebraically the Compound Interest equation in Appendix D (p. 207) of the Owner's Handbook, for a non-integer value of n. You'll need LN to obtain the answer.


-PV - PMT/i = -(PMT/i)*[1+i]-n + FV*[1+i]-n

-PV - PMT/i = [-(PMT/i) + FV]*[1+i]-n

0 - 200/0.04 = [-200/0.04 + (-12000)]*[1+0.04]-n

(-5000) / (-5000 - 12000) = 1.04-n

-5000 / -17000 = 1.04-n

n = -ln(5/17) / ln(1.04)

n = 31.20227

-- KS

Edited: 8 Apr 2008, 11:50 p.m. after one or more responses were posted


I'll read up on the manual, i have purchased the Mac HP12c Emulator for OSX, I am loving the features.

Also i used the HP-67 emulator to arrive at the same answer as you Karl.

I'll post the correct set of functions once i figure it out on the HP12c.

I have a number of PDF help docs, but nothing of the original manual, one goes up to page 210 but page 207 is only the index.

But you've put me on the correct path, so thank you for that.

Again, thank you for all the help on this forum.
Anything i can do in return for the forum?



I don't have my 12C with me at work, but here is a webapp I made for my ipod touch to do those calculations. It's not what was asked for, but may help to check numbers. I also have it as a bookmarklet that can be used offline (good for the ipod touch)

TVM Solver

It's a similar solver as in the TI-84 calculators, but formatted for the iphones:

Set it up as:

N= Click Solve after the values below are entered.

This only does ordinary annuities (end of month). I might annuities due later. I'll look into the HP12 commands when I get home.



Carribean, out of curiousity, are they wanting you to solve the annuity formula by hand, and then evaluate for n on the calculator. If so, it doesn't matter whether you use the ln(x) function or Log(x) function. Here's the ordinary annuity formula

(1+r/n) - 1
FV = pmt -------------

Solving for N I get...

ln(FV r /(n pmt)+1)
N = --------------------

Substituting in FV=12000, n=4, pmt=200 and r=0.16 gives
the desired result.

Still not sure if this is what you wanted.




First off... thanks for the knowledgeable reply. I love that app you built, do you distribute the same thing as in .app for the iTouch... that would be great to have!

So, yes i use the same formula:

                ln{(12000/200).04 +1}
n= ------------------------
ln (1+.04)

n= --------

n= 31.20227

I can arrive at the correct answer, but chuck as you have already illustrated and proved with your great app, i would like to KEY in the same values (as i did in your app) and get the exact answer, not 32 which the HP12c is giving me, with my Entered values that i wrote above in this post. When it comes to the exams and such i don't really want to be messing about with 2 different calculators and and solving annuity formulas by hand.

Plus, i am stuck on the HP12c, as a good friend and CFO of a company i started several years back swears buy it and would brag about it while he was depreciating the value of servers and then on to projecting stock prices. I have no choice but to learn. :)

Thanks again... long post, opps.

Caribbean, or better (Blake, but i live there)


Edited: 8 Apr 2008, 10:22 p.m.


So Blake, you know the formula that gives you what you want, you want to be able to key in the values for i, PV, PMT, and so on, and you want to do it on the 12c. No problem. Keystroke programming will give you exactly what you want. Have you tried it? If not, look at the section in the 12c manual on programming. You will be absolutely amazed with what that capability can do.


I haven't written it as an app, just a bookmarklet (code stored as a bookmark. Crazy) Here's a link to the bookmarklet. After it loads save it as a bookmark, then you can use it whenever. (I don' think this will load in "normal" browser. But I may be mistaken.

TVM Bookmarklet

It'd be nice to make an RPN calculator (11C) as one of these. Maybe next month.


Edited: 9 Apr 2008, 2:17 a.m.


"...I don' think this will load in "normal" browser. But I may be mistaken."

Chuck, so you know that loads up perfectly, i am using OSX 10.4.11 and FF3 beta 5.

It loads in the browser under "data:your link"

I'm also starting to build Cocoa and Carbon apps for Mac... this would be a fun thing to develop as a co-project if you have any interest in that or something else in the future. Feel free to contact me..

Thank you again for you help... i am looking into the final payment, i.e. the one that is the 32nd but less than the original 31 payments.

Who knew math could be so fun.





32 IS the correct answer, as you will have to pay 32 times. The answer 31.something is not a practical answer in real life. What you have to compute instead is how much you'll have to pay the 32nd time - which is described in the downloadable manual.

See on page 41 of
this downloadable pdf manual.

Edited: 9 Apr 2008, 6:03 a.m.


I think 31.something is a very practical answer in real life. In real life I would like to be the one to make the decision of an additional small payment (if T=31.1) or a slightly larger last payment (T=30.9). It's nice to have a calculator do some of the calculating and thinking for us, but I don't want it to make all the decisions, i.e., 32 payments, that's it, done, final.


I think 31.something is a very practical answer in real life. In real life I would like to be the one to make the decision of an additional small payment (if T=31.1) or a slightly larger last payment (T=30.9). It's nice to have a calculator do some of the calculating and thinking for us, but I don't want it to make all the decisions, i.e., 32 payments, that's it, done, final.

Read page 41 of the manual (as I mentioned in my post above), it will tell you exactly how to calculate both ways. The 12c provides you with all necessary data.

Still, in reality n can only be an integer, no matter what you can calculate. You can only make an integer number of payments (31 or 32, not 31.7), as a real woman can only have an integer number of kids - even if a statistical woman bears 1.7 kids each. ;-)

Edited: 9 Apr 2008, 11:43 a.m.


See on page 41 of
this downloadable pdf manual.

Missed this comment and pdf manual link...

Sorry disregard my latest comment on the manual.

Thank you.



Hi Caribbean.

Don is right in that you cannot make 31.something payments. That is in fact the exact value for N that makes the formula work, but in reality you'll either make 30 of these payments and a larger 31st payment, or you'll make 31 of these payments and a slightly smaller 32nd payment.

Still, if you want the exact value for n on a 12c, you'll need to key in the program below. To use it, enter the values for i, PMT and FV as you would normally, but then instead of pressing n (which would give you 32 as the answer), press R/S.

g LN
g LN
GTO 01

This should work. And, yes, I know I could shorten it a bit. :-)


Gene: Can you see my comment at the end of your Program, please.

g LN
g LN
GTO 01 (at this point everything seems to calculate and program but the "GTO 01" i get nothing after that?

And just a quick question... i can't find the manual online... the only link is to buy it from someone's site... but i just paid for the Emulator and have found a plethora of similar manual builds but not the one HP original... Are you aware of a PDF version i can download?

And thank you all for the help, it has been extremely valuable for my advancement in this program. I am doing it all by correspondence and the tutors that are assigned are not quite as articulate as the real pros of the Calculators here.



Blake, the link to the manual is in message #12 above.


Hi Don,

yes i was just rereading the thread and posted my misread.

... i was too busy reading and inserting the methods on the HP12c emulator.

Thank you for the heads up.


The instructions that end the program: R/S and GTO 01 (well, it is actually g GTO 01), are designed to allow you to press R/S each time you wish to solve for a new value of n.

Just enter the values into i, PMT, and FV, then press R/S whenever you want to solve for n. Seems to work on my 12c. :-)



With the above info:

I have concluded that i will make 30 regular payments and one larger 31st payment of a grand total of $340.29.

Thank you for all the help.

Edited: 9 Apr 2008, 3:53 p.m.


Just to bring it to life...

My Calc Desktop Space


Possibly Related Threads...
Thread Author Replies Views Last Post
  HP50g: Writing a function that returns a function Chris de Castro 2 1,149 12-10-2013, 06:49 PM
Last Post: Han
  HP15c continued fraction for Ln(Gamma) Tom Grydeland 0 646 09-30-2013, 05:48 AM
Last Post: Tom Grydeland
  Log Inconsistency Barry Mead 14 2,483 07-23-2013, 04:54 PM
Last Post: Barry Mead
  New empirical fit for ln(x) Namir 0 505 12-11-2012, 12:49 PM
Last Post: Namir
  e^pi - pi + 9/10^4 + 1/(10^4*ln(2) + sqrt(10)/6)^2 Gerson W. Barbosa 47 7,434 08-08-2012, 10:58 PM
Last Post: Les Koller
  Wrong answer when evaluating log(10^-12) Daniel Greenidge 4 1,044 01-26-2012, 05:54 PM
Last Post: Daniel Greenidge
  HP35 exp(ln(x)) bug, a new number found. Kiwi Geoff 4 978 08-27-2010, 08:45 AM
Last Post: Dieter
  HP20b Log error Jeffrey Herrington 8 1,405 03-19-2009, 02:26 PM
Last Post: Gene Wright
  HP-41C LOG PAC Muhammad Ahmad 10 1,634 09-04-2008, 11:27 PM
Last Post: Muhammad Ahmad
  HP 35 ROM V2 "exp(ln(2.02) = 2", explanation found Jacques Laporte 10 1,706 03-24-2006, 11:57 AM
Last Post: bill platt

Forum Jump: