HP Forums

Full Version: VAT calculations with RPN-calculator
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

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!

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...

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

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.