VAT calculations with RPN-calculator



#3

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!


#4

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

#5

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


#6

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.


Possibly Related Threads…
Thread Author Replies Views Last Post
  [PRIME] RPN: another attempt at returning more than one value to the RPN stack Marcus von Cube, Germany 5 2,542 11-05-2013, 02:44 AM
Last Post: Marcus von Cube, Germany
  Another non-HP RPN vintage calculator joins the collection Michael de Estrada 2 1,898 07-23-2013, 04:10 PM
Last Post: Walter B
  OT: RPN calculator/dmm by ESI Kees van der Sanden 2 1,572 05-25-2013, 01:38 PM
Last Post: Kees van der Sanden
  "HP RPN Calculator Users" group on LinkedIn Philippe Lasnier 6 2,708 04-27-2013, 03:27 AM
Last Post: BruceH
  [wp34s] Alternative MIO (allows calculations when entering element values) David Maier 1 1,095 02-03-2013, 02:51 PM
Last Post: Marcus von Cube, Germany
  Financial Calculations for the HP41: another enhanced version Luiz C. Vieira (Brazil) 0 855 04-16-2012, 09:16 AM
Last Post: Luiz C. Vieira (Brazil)
  [WP 34S] Complex calculations (poll) Walter B 41 9,080 04-08-2012, 01:44 AM
Last Post: Paul Dale
  OT: RPN calculator for Garmin GPS hpnut 3 1,428 03-22-2012, 08:44 AM
Last Post: Andrés C. Rodríguez (Argentina)
  The smallest ever LED RPN calculator Michael de Estrada 11 3,273 02-16-2012, 10:24 PM
Last Post: Bill Wiese
  Wang 360 RPN calculator aj04062 8 2,649 11-07-2011, 08:20 PM
Last Post: aj04062

Forum Jump: