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
02-09-2018, 08:14 AM (This post was last modified: 02-09-2018 08:15 AM by Gamo.)
Post: #9
RE: (HP67 app) Pricing Calculation with known Markup for new Price comparison.
Hello Dieter
I try to adapt this program for HP-11C and still not working.
Can you provide this program for 11C ?

Thank You

Gamo
Find all posts by this user
Quote this message in a reply
02-09-2018, 08:35 AM (This post was last modified: 02-09-2018 09:06 AM by Dieter.)
Post: #10
RE: (HP67 app) Pricing Calculation with known Markup for new Price comparison.
(02-09-2018 08:14 AM)Gamo Wrote:  Hello Dieter
I try to adapt this program for HP-11C and still not working.
Can you provide this program for 11C ?

Of course it will not work on any calculator other than the 67 or 97.
With a minor change (replace flag 3 with flag 22) it probably also runs on the HP41. But on no other device.

This program uses a special feature of the 67/97: if you enter a number this automatically sets flag 3. So the program can check whether you want to enter a value or have it calculated. Also the flag test F?3 automatically clears this flags after testing.

Since the 11C does not provide a number entry flag there is no way to adapt this program for that calculator. The program may be changed so that it assumes data entry if x is not equal to zero, which should be no problem as the program assumes "no data given" if a value is 0. If this is OK the program version in post #7 can be changed for use with the 11C:

- Delete the CF 3 in line 010.
- Replace all F3? tests with x≠0?.

Then try again if it works.
Remember: if you now want to calculate a value, enter 0 and press the respective label key [A]...[D].
So in the first example you would press 0 [C] and 0 [D] to get markup and margin.

Dieter
Find all posts by this user
Quote this message in a reply
02-09-2018, 02:20 PM
Post: #11
RE: (HP67 app) Pricing Calculation with known Markup for new Price comparison.
I make change as recommended for
- Delete the CF 3 in line 010.
- Replace all F3? tests with x≠0?.

That still not work as expected.

Gamo
Find all posts by this user
Quote this message in a reply
02-09-2018, 06:51 PM (This post was last modified: 02-09-2018 07:38 PM by Dieter.)
Post: #12
RE: (HP67 app) Pricing Calculation with known Markup for new Price comparison.
(02-09-2018 02:20 PM)Gamo Wrote:  I make change as recommended for
- Delete the CF 3 in line 010.
- Replace all F3? tests with x≠0?.

That still not work as expected.

Come on, Gamo – what exactly does not work as expected?
Where exactly is the problem?

I tried the modified program on my HP67 emulator and it works fine.
Edit: also tried in on HP's 15C emulator, and the program worked correctly again.
Be sure to always enter 0 when you want to calculate or recall a result.

And now
1. Post your 11C program here.
2. Give an example for input and output, including the exact key sequence.

Just to be sure: since there is no LBL e on the Pioneers you have to replace it with a numeric one of course, e.g. LBL 0 or LBL 9.
And %CH is labelled Δ%.

Edit 2: Ok-ok, here is the complete program. Compare it with your version.

Code:
001  LBL E
002  FIX 2
003  CLX
004  STO 1
005  STO 2
006  STO 3
007  STO 4
008  CF 0
009  RTN
010  LBL A
011  x≠0?
012  GTO 1
013  RCL 2
014  F0?
015  x=0?
016  GTO 0
017  RCL 4
018  %
019  -
020  STO 1
021  RTN
022  LBL 1
023  STO 1
024  CF 0
025  RTN
026  LBL B
027  x≠0?
028  GTO 2
029  RCL 1
030  F0?
031  x=0?
032  GTO 0
033  RCL 3
034  %
035  +
036  STO 2
037  RTN
038  LBL 2
039  STO 2
040  CF 0
041  RTN
042  LBL C
043  x≠0?
044  GTO 3
045  RCL 3
046  F0?
047  RTN
048  RCL 1
049  RCL 2
050  x=0?
051  1/x
052  Δ%
053  LBL 3
054  STO 3
055  EEX
056  2
057  *
058  LastX
059  RCL 3
060  +
061  /
062  STO 4
063  RCL 3
064  SF 0
065  RTN
066  LBL D
067  x≠0?
068  GTO 4
069  RCL 4
070  F0?
071  RTN
072  RCL 2
073  RCL 1
074  x=0?
075  1/x
076  Δ%
077  CHS
078  LBL 4
079  STO 4
080  EEX
081  2
082  *
083  LastX
084  RCL 4
085  -
086  /
087  STO 3
088  RCL 4
089  SF 0
090  RTN
091  LBL 0
092  0
093  1/x
094  RTN

And here is an example:

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

New markup     75 f[C]    75,00
Get new price   0 f[B]   192,50
Get new margin  0 f[D]    42,86

Dieter
Find all posts by this user
Quote this message in a reply
02-10-2018, 03:04 AM
Post: #13
RE: (HP67 app) Pricing Calculation with known Markup for new Price comparison.
Oops sorry my bad forgot to put 0 then A-D for answer.

Gamo Smile
Find all posts by this user
Quote this message in a reply
02-10-2018, 02:05 PM
Post: #14
RE: (HP67 app) Pricing Calculation with known Markup for new Price comparison.
Never worry, Gamo.

I think Dieter's basic point is a good one for all of us.

Whenever something does not seem to work as expected, always, I mean always, given as much information about what did not work, how it did not seem to work, what your inputs were when it did not seem to work, what the outputs showed, and what you were doing just before the part that did not work, etc. etc.

Give as much information as possible and it will help others help you... or perhaps... :-) ... help you see where something went wrong on your own!
Find all posts by this user
Quote this message in a reply
06-18-2019, 01:12 PM (This post was last modified: 06-18-2019 01:17 PM by Gamo.)
Post: #15
RE: (HP67 app) Pricing Calculation with known Markup for new Price comparison.
Special Thanks to Dieter
Who help make me successfully
Create "Profit on Pricing" program
For HP-11C or 15C

Based on his idea this same program
Also can be adapted to work on
HP-12C

https://www.hpmuseum.org/forum/thread-13043.html

https://www.hpmuseum.org/forum/thread-12947.html

I'm sad that he didn't see this program and
Help improve further.

RIP

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




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