Post Reply 
(11C) Pricing Calculation
08-11-2018, 06:33 AM (This post was last modified: Yesterday 11:37 AM by Gamo.)
Post: #1
(11C) Pricing Calculation
Program to calculate pricing method.

Input two known variables from four variables to get answer for the two unknown variables.

This program calculate solutions based on Markup for Cost and Price.
For unknown Margin this program calculate Margin and Markup vise versa and independently using labels [D] or [E] : Markup <--> Margin

[A] Cost
[B] Price
[C] Markup
[D] Margin // for when Markup is unknown
[E] Markup // for when Margin is unknown

Example: Set to f [USER] mode

1. Known Cost and Price look for Markup and Margin

Cost 66.46
Price 105

66.46 [A] display 0
105 [B] display 0
[C] display 57.99 // Answer for Markup
[C] display 0 // Store Markup
[D] display 36.70 // Answer for Margin

---------------------------------------------------------------------------------

2. Known Price and Markup look for Cost and Margin

Price 150
Markup 150

150 [B] display 0
150 [C] display 0
[A] display 60 // Answer for Cost
[D] display 0 ---> [D] display 60 // Answer for Margin

-----------------------------------------------------------------------------

3. Known Cost and Margin look for Price and Markup

Cost 33.75
Margin 55

33.75 [A] display 0
55 [D] display 0 ---> [E] display 122.22 // known margin for markup
[C] display 0 // Markup displayed and Store Markup
[B] display 75 // Answer for Price

-----------------------------------------------------------------------------------

4. Known Markup and like to know the Margin

Markup 54

54 [E] display 0
[D] display 35.06 // Answer for Margin

------------------------------------------------------------------------------------

Program: Pricing Calculation
Code:

LBL A [Cost]
STO 1
0
X≠Y
RTN
RCL 2
1
RCL 3
%
+
÷
RTN
LBL B [Price]
STO 2
0
X≠Y
RTN
RCL 1
RCL 3
%
+
RTN
LBL C [Markup]
STO 3
0
X≠Y
RTN
RCL 1
RCL 2
∆%
RTN
LBL D [Margin]
STO 4
0
X≠Y
RTN
RCL 3
1/x
EEX
CHS
2
+
1/x
RTN
LBL E [Markup]
STO 3
0
X≠Y
RTN
RCL 4
1/x
EEX
CHS
2
-
1/x
RTN

Gamo
Find all posts by this user
Quote this message in a reply
08-11-2018, 12:28 PM (This post was last modified: 08-11-2018 05:35 PM by Dieter.)
Post: #2
RE: (11C) Pricing Calculation
(08-11-2018 06:33 AM)Gamo Wrote:  Program to calculate pricing method.

It looks like you really like such programs. ;-)
There have been several discussions on programs for various calculators, including a version for the 11C.

Just a few remarks regarding your program:
  • All ENTERs can be removed. They are simply not required.
  • There are two GSB 1 calls that call a subroutine with merely 4 steps. This does not make sense: It requires the same eight steps in total as directly coding these four steps twice, without subroutines. The latter runs even faster. So it's better to insert "1/x ,01" twice directly than calling it via a subroutine.
  • The method for converting between margin and markup at LBL D and E does not work if one of these values is zero. That's why I suggest doing the conversion via 100·m / (100±m):

    Code:
    LBL D [Margin]
    STO 4
    0
    X≠Y
    RTN
    RCL 3
    EEX
    2
    x
    LstX
    RCL 3
    +
    ÷
    RTN
    LBL E [Markup]
    STO 3
    0
    X≠Y
    RTN
    RCL 4
    EEX
    2
    x
    LstX
    RCL 4
    -
    ÷
    RTN

    Edit: I just realized that margin and markup cannot be 0 as a zero entry does not store them. #-) So you can stick to the 1/x method. But I'd do it without the subroutine calls.

Your program uses a clear and unambiguous method for input and output. But this does not become clear from your examples, and it also is never explained. This leads to some strange key sequences in your examples:

(08-11-2018 06:33 AM)Gamo Wrote:  2. Known Price and Markup look for Cost and Margin

Price 150
Markup 150

150 [B] display 0
150 [C] display 0
[A] display 60 // Answer for Cost
[D] display 0 ---> [R/S] display 60 // Answer for Margin

This looks very unintuitive. Why should the user press [R/S] here? He doesn't have to do so anywhere else. But this cumbersome way of calculating the margin is not required at all:

There is a simple basic idea which makes using the program easy and consistent:
  • Use the A, B and C keys to enter or calculate cost, price and markup. Enter two of these, calculate the third one by entering 0.
  • Use D and E for converting between margin and markup. Again, enter the known value and calculate the other one by entering 0.

This way example 1 can be solved as follows:

150 [B] => 0,00
150 [C] => 0,00
[A] => 60,00

150 [E] => 0,00    // Enter 150% markup...
[D] => 60,00    // ...and convert it into a margin of 60%

No [R/S] required, no exceptions to remember.
Note: since the 150% markup has already been entered before, the 150 [E] step may even be omitted and 0 [D] directly returns the margin.

Or take a look at example 2. It can be solved with the same logic:

Cost 66,46
Price 105

66,46 [A] => 0,00
105 [B]    => 0,00
[C] => 57,99    // Markup is 57,99%

[E] =>   0,00    // Enter this markup...
[D] => 36,70    // ...and convert it into a margin of 36,70%

Your program works better than your examples show it. ;-)

Dieter
Find all posts by this user
Quote this message in a reply
08-11-2018, 01:38 PM
Post: #3
RE: (11C) Pricing Calculation
Thank You Dieter

Thanks so much for the corrections I have make changed from your suggestions and now work flawlessly.

The program that I try to master the most is this Pricing Calculation. I was kind of disappointed that the HP-12C didn't include this function and even the HP-12C Platinum the update version still don't have this function. In my opinion financial calculator should have Pricing Calculation.

On the HP 10bii+ with this it can calculate pricing method but cannot do calculations between only the Margin and Markup.

I like to see if that possible to program so that it work just like the TVM function on the HP-12C by using one key stroke for each variable then one key stroke for answer.

example:
12 [n] display 12,00
7 [I] display 7,00
-1000 [PV] display -1000,00

[FV] display 2252,19


Gamo
Find all posts by this user
Quote this message in a reply
08-11-2018, 04:49 PM (This post was last modified: 08-11-2018 05:57 PM by Dieter.)
Post: #4
RE: (11C) Pricing Calculation
(08-11-2018 01:38 PM)Gamo Wrote:  I like to see if that possible to program so that it work just like the TVM function on the HP-12C by using one key stroke for each variable then one key stroke for answer.

example:
12 [n] display 12,00
7 [I] display 7,00
-1000 [PV] display -1000,00

[FV] display 2252,19

This is only possible if there is a way to detect data input. The HP67/97 can do this with flag 3, on the HP41/42 it's flag 22/23 that can be checked. The WP34s also has some means to detect input.

But otherwise there is no way to check if the user has entered data or not. So the program in an 11C, 12C or 15C cannot know if the value in X is a user input or the result of a previous calculation. If a key like [A] or [B] has been pressed the calculator doesn't know if the user has entered data (store it) or not (calculate it).

So you have to do it differently. For instance by defining that a zero input means "calculate" and a positive (or negative) input means "store this as data input". This also means that none of the data must be zero. This method has been used in the 11C program in this earlier thread on pricing programs (cf. post #12). BTW the HP67 version in that thread uses flag 3 instead.

I think the method in the program you posted is as close as you can get to a "single key" solution in an 11C: The user enters some data, presses [A], [B] or [C] and the program stores the input. A zero is returned (which also confirms the inputs has been processed). Since now a zero already is X you may simply press [A], [B] or [C] again to have the respective value calculated.

Another method could be a "calculate" key that sets a flag which indicates that the next key press means "calulate this value" instead of "store this". For instance the [E] key could be used for this:

[A] means "store cost"
[E] [A] means "calculate cost"

[C] means "store markup"
[E] [C] means "calculate markup"

But again: as long as the calculator hardware doesn't support it there is no way to have the program determine if the user has entered data or not, so there is no "single key solution" that behaves exactly like the 12C TVM solver.

Dieter
Find all posts by this user
Quote this message in a reply
08-12-2018, 08:20 AM (This post was last modified: 08-12-2018 08:37 AM by Gamo.)
Post: #5
RE: (11C) Pricing Calculation
Cool...so this program is closer to the one key input and one key output procedure.

This program is now perfect for use on 11C or 15C I'm very satisfy now.

Gamo
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)