Post Reply 
(HP67 app) Pricing Calculation with known Markup for new Price comparison.
10-16-2017, 01:38 PM (This post was last modified: 10-18-2017 10:34 AM by Gamo.)
Post: #1
(HP67 app) Pricing Calculation with known Markup for new Price comparison.
Here is the Pricing Calculation program for HP67 app for Android that also work on HP-67 or other HP calculator that have Labels. This program came with option for change in Markup to get new update Price answer comparison.

Code:

LBL A (Cost)
STO 1
RTN
LBL B (Price)
STO 2
RTN
LBL C (Answer for Markup)
RCL 1
RCL 2
%CH
RTN
LBL D (Answer for Margin)
RCL 2
RCL 1
%CH
CHS
RTN
LBL E (Answer for the Change of Markup to get update Price)
ENTER
1
%
1
+
RCL 1
x
RTN

Example:

(A) Cost = $110
(B) Price = $165
(C) Markup = ?
(D) Margin = ?

110 A > 165 B > C result 50 > D result 33.33

To see the different for Price result when change the Markup to 75%

75 E result $192.50


Gamo

I still can't find the way to do this pricing calculation method just by press the two known variables and get the answer for the other two variables.
For example: when you know Cost and Margin you get answer for Price and Markup. Just by input A and D then press B and C for instant answer.
Find all posts by this user
Quote this message in a reply
10-19-2017, 08:03 PM (This post was last modified: 10-19-2017 08:42 PM by Dieter.)
Post: #2
RE: (HP67 app) Pricing Calculation with known Markup for new Price comparison.
(10-16-2017 01:38 PM)Gamo Wrote:  I still can't find the way to do this pricing calculation method just by press the two known variables and get the answer for the other two variables.
For example: when you know Cost and Margin you get answer for Price and Markup. Just by input A and D then press B and C for instant answer.

That's not trivial, for several reasons. For instance there are multiple ways to calculate each of the four variables, depending on which ones are known are which are not. Then there are cases where no unique solution exists (e.g. if only markup and margin are given).

Here is a program that does what you want. Enter any two of the four variables, and the other two are calculated. The program uses a method that I already implemented more than 30 years ago for a triangle solver (enter any three... you get the picture). If a variable is entered, a constant of 1 (cost), 2 (price), 4 (markup) or 8 (margin) is added to R0. This way each of the six possible cases produces a unique sum:

cost & price => 3
cost & markup => 5
price & markup => 6
cost & margin => 9
price & margin => 10
markup & margin => 12

The last case can be neglected since no unique solution for cost and price exists if only markup and margin are given.

Now the program can simply jump to the label with that number to start the calculation. Actually it jumps to a label with that number minus 3 because this way all results are between 0 and 9 and the labels above (LBL A = #10) can be used without interfering with the calculation routines.

Pressing [E] initializes the program. After two values have been entered (counted by a DSZ command) the calculation routine at LBL e starts. LBL a and b hold some calculations that appear several times. Afterwards pressing one of the keys [A]...[D] shows the respective result.

Here is the listing:

Code:
001  LBL E
002  FIX
003  DSP 2
004  2
005  STO I
006  CLX
007  STO 0
008  STO 1
009  STO 2
010  STO 3
011  STO 4
012  CF 3
013  RTN
014  LBL A
015  F3?
016  F3?
017  GTO c
018  1
019  STO+0
020  R↓
021  STO 1
022  DSZ
023  RTN
024  GSB e
025  LBL c
026  RCL 1
027  RTN
028  LBL B
029  F3?
030  F3?
031  GTO c
032  2
033  STO+0
034  R↓
035  STO 2
036  DSZ
037  RTN
038  GSB e
039  LBL c
040  RCL 2
041  RTN
042  LBL C
043  F3?
044  F3?
045  GTO c
046  4
047  STO+0
048  R↓
049  STO 3
050  DSZ
051  RTN
052  GSB e
053  LBL c
054  RCL 3
055  RTN
056  LBL D
057  F3?
058  F3?
059  GTO c
060  8
061  STO+0
062  R↓
063  STO 4
064  DSZ
065  RTN
066  GSB e
067  LBL c
068  RCL 4
069  RTN
070  LBL e
071  RCL 0
072  3
073  -
074  STO I
075  GTO(i)
076  LBL 0
077  GSB a
078  GTO b
079  LBL 2
080  RCL 1
081  RCL 3
082  %
083  +
084  STO 2
085  GTO b
086  LBL 3
087  RCL 2
088  1
089  RCL 3
090  %
091  +
092  /
093  STO 1
094  GTO b
095  LBL 6
096  RCL 1
097  1
098  RCL 4
099  %
100  -
101  /
102  STO 2
103  GTO a
104  LBL 7
105  RCL 2
106  RCL 4
107  %
108  -
109  STO 1
110  LBL a
111  RCL 1
112  RCL 2
113  %CH
114  STO 3
115  RTN
116  LBL b
117  RCL 2
118  RCL 1
119  %CH
120  CHS
121  STO 4
122  RTN

Here is an example:

Code:
Initialize        [E]     0,00
Enter cost   110  [A]   110,00
Enter price  165  [B]   165,00
Get markup        [C]    50,00
Get margin        [D]    33,33

All data can now be recalled by pressing the [A] to [D] keys.
Be sure to press none of the number entry keys because else this will be considered a new data input.

Code:
Get cost          [A]    110,00
Get price         [B]    165,00
Get markup        [C]     50,00
Get margin        [D]     33,33

Another example:

Code:
Initialize        [E]     0,00
Enter cost   110  [A]   110,00
Enter markup  50  [C]    50,00
Get price         [B]   165,00
Get margin        [D]    33,33

You can also try any other combination. Including markup & margin. Try it: it will result in an "Error" message.

Note: data entry is detected by flag 3 which, on the '67 and '97, is set if you enter data with the number entry keys. It is not set if you recall a value from a register. So if you want to do so press any number key before. If you want you can change this to another method, e.g. consider only non-zero values as data entry. In this case simply replace the double F3? tests (which behaves like a FC?C 03) by an "X=0?" test.

Dieter
Find all posts by this user
Quote this message in a reply
10-20-2017, 05:47 AM (This post was last modified: 10-20-2017 05:58 AM by Gamo.)
Post: #3
RE: (HP67 app) Pricing Calculation with known Markup for new Price comparison.
Hello Dieter

I try the program but not success maybe I didn't input program the right way.

How to input LBL c the small c and STO (i) is it key ST I

Initialize LBL E Ok and Input LBL A ok when input B return Error

Thank You

Gamo
Find all posts by this user
Quote this message in a reply
10-20-2017, 06:50 AM
Post: #4
RE: (HP67 app) Pricing Calculation with known Markup for new Price comparison.
(10-20-2017 05:47 AM)Gamo Wrote:  How to input LBL c the small c and STO (i) is it key ST I

Just type g SST C for LBL c
and the buttons STO (i) for STO (i)

h ST I is something different.

Bernhard

That's one small step for a man - one giant leap for mankind.
Find all posts by this user
Quote this message in a reply
10-20-2017, 07:52 AM
Post: #5
RE: (HP67 app) Pricing Calculation with known Markup for new Price comparison.
(10-20-2017 05:47 AM)Gamo Wrote:  I try the program but not success maybe I didn't input program the right way.

How to input LBL c the small c and STO (i) is it key ST I

Since the lower case c is an f-shifted function (look at the keyboard), LBL c is entered as [LBL f] [C]. That's [g] [SST] [C]. The same is true for LBL a, LBL b etc.

ST I is not STO(i) ! Again, look at the keyboard: there is a big "(i)" key, so simply press [STO] [(i)]. Likewise, RCL(i) is [RCL] [(i)].

For the record, here is an even shorter version that fits on a sigle card track. It also detects input errors if you enter the same variable twice (e.g. 2x cost).

Code:
001  LBL E
002  FIX
003  DSP 2
004  CLX
005  STO 0
006  STO 1
007  STO 2
008  STO 3
009  STO 4
010  SF 2
011  CF 3
012  RTN
013  LBL A
014  0
015  ENTER
016  1
017  GTO c
018  LBL B
019  1
020  ENTER
021  2
022  GTO c
023  LBL C
024  3
025  ENTER
026  3
027  GTO c
028  LBL D
029  7
030  ENTER
031  4
032  LBL c
033  STO I
034  R↓
035  F3?
036  F3?
037  GTO d
038  STO+0
039  R↓
040  STO(i)
041  F2?
042  RTN
043  8
044  RCL 0
045  X>Y?
046  CLX
047  X<>I
048  STO 0
049  GSB(i)
050  RCL 0
051  STO I
052  LBL d
053  RCL(i)
054  RTN
055  LBL 1
056  GSB a
057  GTO b
058  LBL 3
059  RCL 1
060  RCL 3
061  %
062  +
063  STO 2
064  GTO b
065  LBL 4
066  RCL 2
067  1
068  RCL 3
069  %
070  +
071  /
072  STO 1
073  GTO b
074  LBL 7
075  RCL 1
076  1
077  RCL 4
078  %
079  -
080  /
081  STO 2
082  GTO a
083  LBL 8
084  RCL 2
085  RCL 4
086  %
087  -
088  STO 1
089  LBL a
090  RCL 1
091  RCL 2
092  %CH
093  STO 3
094  RTN
095  LBL b
096  RCL 2
097  RCL 1
098  %CH
099  CHS
100  STO 4
101  RTN

This version uses flag 2 instead of a counter and DSZ, and the steps at LBL A...D are now done in a common routine with indirect addressing.

Dieter
Find all posts by this user
Quote this message in a reply
10-20-2017, 09:07 AM
Post: #6
RE: (HP67 app) Pricing Calculation with known Markup for new Price comparison.
Thank You Bernhard

The keystroke in question now resolve.

Thank You Dieter

Pricing Program work very good and very accurate answer. Only you in this forum that try out on this complete Pricing Program that can input combination of two variables.
HP 10BII+ have this features that user can input any two combination of variables except this pair the Margin and Markup. This calculator user input pair of variables and each individual variable can be change with update result that have to re-enter new data again.

Gamo
Find all posts by this user
Quote this message in a reply
10-20-2017, 04:58 PM (This post was last modified: 10-21-2017 08:52 PM by Dieter.)
Post: #7
RE: (HP67 app) Pricing Calculation with known Markup for new Price comparison.
(10-20-2017 09:07 AM)Gamo Wrote:  Pricing Program work very good and very accurate answer. Only you in this forum that try out on this complete Pricing Program that can input combination of two variables.

Wait until you try the latest version. ;-)
This one is more capable, more flexible and even shorter than the previous ones:

Edit: corrected an error that caused markup/margin not to be recalculated after cost or price had been changed.

Code:
001  LBL E  INIT
002  FIX
003  DSP 2
004  CLX
005  STO 1
006  STO 2
007  STO 3
008  STO 4
009  CF 0   clear markup/margin flag
010  CF 3
011  RTN
012  LBL A  COST
013  F3?
014  GTO 1
015  RCL 2
016  F0?    no markup/margin
017  x=0?   OR no price given?
018  GTO e  then exit with error
019  RCL 4
020  %
021  -
022  STO 1
023  RTN
024  LBL 1
025  RCL 1
026  x≠0?
027  CF 0   if new cost entered, reset markup/margin flag
028  R↓
029  STO 1
030  RTN
031  LBL B  PRICE
032  F3?
033  GTO 2
034  RCL 1
035  F0?    no markup/margin
036  x=0?   OR no cost given?
037  GTO e  then exit with error
038  RCL 3
039  %
040  +
041  STO 2
042  RTN
043  LBL 2
044  RCL 2
045  x≠0?
046  CF 0   if new price entered, reset markup/margin flag
047  R↓
048  STO 2
049  RTN
050  LBL C  MARKUP
051  F3?
052  GTO 3
053  RCL 3
054  F0?    if markup/margin is known
055  RTN    display previously computed markup and stop
056  RCL 1
057  RCL 2
058  x=0?   no price given?
059  GTO e  then generate error
060  %CH    this will generate an error if price is not given (=0)
061  LBL 3
062  STO 3  store markup
063  EEX
064  2
065  *      calculate margin from markup
066  LastX
067  RCL 3
068  +
069  /
070  STO 4  and store margin as well
071  RCL 3
072  SF 0   set markup/margin flag
074  RTN
074  LBL D  MARGIN
075  F3?
076  GTO 4
077  RCL 4
078  F0?    if markup/margin is known
079  RTN    display previously computed margin and stop
080  RCL 2
081  RCL 1
082  x=0?   no cost given?
083  GTO e  then exit with error
084  %CH    this will generate an error if price is not given (=0)
085  CHS
086  LBL 4
087  STO 4  store margin
088  EEX
089  2
090  *      calculate markup from margin
091  LastX
092  RCL 4
093  -
094  /
095  STO 3  and store markup as well
096  RCL 4
097  SF 0   set markup/margin flag
098  RTN
099  LBL e  Error routine:
100  0      generate a
101  1/x    division by zero error
102  RTN    and quit

Again, [E] initializes the program. You can then enter two of the four values (as usual, except the combination markup & margin, these are mutually convertible), and the program calculates the remaining two if you press the respective key. And now you can even change data and recalculate without starting over:

Code:
Initialize        [E]     0,00
Enter cost    110 [A]   110,00
Enter price   165 [B]   165,00
Get markup        [C]    50,00
Get margin        [D]    33,33

Now change the markup to 75%:

Code:
Enter markup   75 [C]    75,00
New price         [B]   192,50
New margin        [D]    42,86

Note that cost and price must be > 0.

BTW, you can also directly convert between markup and margin without entering anything else:

Code:
Enter markup   30 [C]    30,00
=> margin is      [D]    23,08

Enter margin   20 [D]    20,00
=> markup is      [C]    25,00

Dieter
Find all posts by this user
Quote this message in a reply
10-23-2017, 01:52 AM
Post: #8
RE: (HP67 app) Pricing Calculation with known Markup for new Price comparison.
Thank You Dieter

Now this is the perfect routine to calculate Pricing.

Even the HP 10bII+ can not do between Markup and Margin calculation.

Thanks again

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




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