The Museum of HP Calculators

HP Forum Archive 15

[ Return to Index | Top of Index ]

VAT calculations with RPN-calculator
Message #1 Posted by Kalevipoeg on 26 Nov 2005, 4:51 a.m.

I like to tell you how I became more familiar with % function of the HP12c.

VAT = Value Added Tax (in the European Union)

NET = GROSS/(1+(VAT RATE/100))
VAT = NET*(VAT RATE/100)

I wanted to write a short program which a) calculates NET amount into Y register and b) calculates VAT into X register. In this case VAT RATE is stored in R0-register. Usage: Key in the GROSS amount and press [R/S].

First I wrote the following program (16 steps)

01  RCL 0
02  1
03  0
04  0
05  /
06  1
07  +
08  /
09  ENTER
10  ENTER
11  RCL  0
12  1
13  0
14  0
15  /
16  *

Then I realized my calculator has a % function and I wrote my program again (now 7 steps)

01  1
02  RCL 0
03  %
04  +
05  /
06  RCL 0
07  %

The % function of the RPN-calculators is more useful function than I believed!

      
% vs. delta-%
Message #2 Posted by Karl Schneider on 27 Nov 2005, 1:55 a.m.,
in response to message #1 by Kalevipoeg

Kalevipoeg --

Good thinking! Of course, "per cent" means "per 100", so those are logical simplifications.

Among Voyagers, only the HP-12C and HP-10C have a "%" key as an unshifted function. I believe that "%" is much more useful in business than in science and engineering, in which "delta-%" is more useful. It makes sense to me that the 12C would have "%" unshifted.

However, the basic scientific 10C omitted "delta-%", while providing "%" unshifted. Not good thinking...

      
Re: VAT calculations with RPN-calculator
Message #3 Posted by tony(nz) on 28 Nov 2005, 1:05 a.m.,
in response to message #1 by Kalevipoeg

Hello Kalevipoeg. Nice to see you again.

Today I learned from Wikipedia that you must be the son of Kalev :-)

Indeed it can be very handy the way % preserves Y. I once had fun using i,PV and FV (with n=1 and PMT=0) to do all shopkeeper markup/markdown calculations, which parallel VAT/normal_tax(eg income tax) calculations. The markdown and income tax percentages need to be entered as negative. It takes a bit of getting used to as PV and FV have opposite signs, but we usually know which is the larger. And then PV+FV gives the amount of the tax for example. Yes, I remember now, last year in Datafile V23N2P14/15, I wrote about this - also showing how to calculate markup given markdown, and vice-versa.

So you could set FV=GROSS, i=VAT RATE. Then solving for PV gives -NET. You can input any two, and solve for the third - not that this is very useful, except if you are a tax consultant or a shopkeeper :-) But it is fun to try and do many calculations, actually seen in daily life, with one equation: PV*(1+i/100)+FV=0.

BTW I have submitted some 12C games to HPCC Datafile and I mention your name in bold when presenting lunar lander, referring folk to your Moon Landing Simulator as published here early last month. I hope you don't mind - I never thought to ask!

Cheers, Tony

            
Re: VAT calculations with RPN-calculator
Message #4 Posted by Kalevipoeg on 28 Nov 2005, 1:45 a.m.,
in response to message #3 by tony(nz)

Thank you Tony. I'm happy you mentioned my name. Thanks.

About VAT calculations

Why did I want to calculate NET amount into Y register and VAT into X register?

Answer: Now I can use Sigma+ to calculate totals if necessary.

Edited: 28 Nov 2005, 7:41 a.m.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall