Sell, Cost, Margin for HP41



#24

ciao a tutti,

I would like to use my HP41C in my everyday work.

One of the things that I have to do more frequently is to evaluate the margin of a sale (yes, I'm a sales guy, sorry for that ...)

I need a program that given any two of these three values :
COST PRICE
SELL PRICE
MARGIN
will return the third value.

Does anyone know where can I find something like this ?

As always, thanks for help, Alberto


#25

I can't make any promises at the moment. But if I can find time I will write the code for this for you.

By the way. I love the HP41C. But I use my HP27S the most when on the job. If you are curious, such a program can be written on it in easily under three minutes.

When I was given my first HP27S by a friend who was an engineer at HP it had not been put on the market yet.

The first program I wrote for it (he laughed when I requested a manual for it, 'you won't need one', at the time this was a preposterous assertion. Or so I thought.) The first program I wrote for it (with no information on the calculators operations of any kind) was: BIG+BIGGER=BIGGEST

This is essentially exactly the same thing you need, ie: SELLPRICE-COST=MARGIN

When this program is entered on the 27S it automatically generates a menu at the bottom of the display with the top row of keys being connected to the menu.

And critical to a app such as you need the formula can always be used in any order nonlinearity.

You may well already be quite familiar with all of that. At the time I was somewhat amazed.

#26

Quote:
ciao a tutti,


Bonjour à tous,
Quote:
I would like to use my HP41C in my everyday work.
That’s a good new,still using a HP-41C today is at you honour.

Quote:
One of the things that I have to do more frequently is to evaluate the margin of a sale

I need a program that given any two of these three values :
COST PRICE
SELL PRICE
MARGIN
will return the third value.


Does anyone know where can I find something like this ?
I have no idea, but as a professional buyer-man for the account of a national institution, I already write a program for buy pricing, cost and estimation of lost. This is a short version of it:
--------------------------------------------------------------
01 LBL "A 09 LBL "B 17 LBL "C 23 LBL 09
02 RCL 00 10 STO 01 18 STO 00 24 "~:
03 + 19 GTO "a 25 ARCL X
04 STO 01 11 LBL "a 26 AVIEW
12 RCL 01 27 END
05 LBL "b 13 RCL 00
06 RCL 01 14 - 20 LBL "c
07 "PRICE 15 "MARGIN 21 RCL 00
08 GTO 09 16 GTO 09 22 "COST
--------------------------------------------------------------
Usage :


In USER mode, enter a value and press the following:

[ A ] key : to set margin. A new PRICE is computed and displayed. COST remain constant.

[shift]+[ A ] : to display MARGIN.


[ B ] key : to set SELL PRICE. A new MARGIN is computed and displayed. COST remain constant.
Note that mnemomic B was initially used as Buy Price.

[shift] + [ B ] : to display SELL/BUY PRICE.


[ C ] key: to set constant COST value. A new MARGIN is computed and displayed. PRICE remain constant.

[shift] + [ C ] : to display COSTs.

Note1: Only two registers are used: R00 = (constant cost ) and (R01 = sell/buy price).

Note2: Displayed results can be use in futher computation since the value is displayed (in alpha register) and a copy left in x register.

Edited: 29 Oct 2012, 12:38 p.m.

#27

This is based on some of the solution book problems such as TVM that use the display as a menu for the top row of keys.

 01 LBL "CSM" 
02 LBL J
03 SF 27
04 CF 22
05 "CP SP M"
06 AVIEW
07 STOP
08 LBL A
09 STO 01
10 FS? 22
11 GTO J
12 RCL 02
13 RCL 03
14 -
15 STO 01
16 VIEW X
17 STOP
18 GTO J
19 LBL B
20 STO 02
21 FS? 22
22 GTO J
23 RCL 01
24 RCL 03
25 +
26 STO 02
27 VIEW X
28 STOP
29 GTO J
30 LBL C
31 STO 03
32 FS? 22
33 GTO J
34 RCL 02
35 RCL 01
36 -
37 STO 03
38 VIEW X
39 STOP
40 GTO J
41 END

#28

Thank you very much to all of you.

Margin is actually given by this formula :

((selling price - purchase price)/selling price)*100

if selling price = 10 and purchase price = 9, margin is 10 per cent

I have been using my HP20S, but since I like vintage calculators I'm now using this Commodore.



I'd love to have a program that will allow me to use my HP41C, although I have a preference for red led (HPs).

Mark, C.Ret, are your programs working this way ?


Thanks again, Alberto


#29

Quote:
Margin is actually given by this formula :

((selling price - purchase price)/selling price)*100


01 LBL A   --- set margin% . Compute new Sell price
02 1
03 x:y
04 %
05 -
06 RCL 00
07 x:y
08 /
09 STO 01

10 LBL b --- diplay SELL PRICE
11 RCL 01
12 "PRICE
13 GTO 08

14 LBL B --- set SELL PRICE
15 STO 01

16 LBL a ---- Display margin %
17 RCL 01
18 RCl 00
19 %CH
20 CHS
21 "MARGE
22 FIX 1
23 SF 09
24 GTO 09

25 LBL C ---- set cost
26 STO 00
27 RCL 01
28 x>y?
29 GTO "a

30 LBL c ---- display cost
31 RCL 00
32 "COST

33 LBL 08 ==== display $ ####.##
34 "~: $
35 FIX 2
36 LBL 09 ==== display ###.# %
37 ARCL X
38 FS?C 09
39 "~ %
40 AVIEW
41 END

Same usage as previous version. Enter margin as purcentage: 21.7 for 21.7%

In USER mode :

 CLRG
20 [ C ] COST: $20.00
75 [ A ] PRICE: $80.00
[shift][ a ] MARGIN 75.0 %

EDITed : wrong 10 into 20 (see later post from aurelio)


Edited: 1 Nov 2012, 1:36 p.m. after one or more responses were posted


#30

Thak-you, Ret

#31

Thank you very much !!

I'll load it on my HP41 and will let you know,

I assume it will work on HP65 or 67 as well, or am I saying something stupid ?

thanks again Alberto


#32

HI,

Nothing stupid, except you have to remove Alpha-numeric display. This can make the use of the program a bit confusing.

For nonb-alphanuméric system, I will preconise a simpler input/output philosophy :

       [ A ]  Input   Margin %   
[shift][ A ] Display Margin % ####.#

[ B ] Input Buy/Sell price $
[shift][ B ] Display Buy/Sell price $ #####.##

[ C ] Input Cost $
[shift][ C ] Display Cost $ ####.####

001 *LBL A 21 11 017 *LBL B 21 12
002 1 01 018 STO1 35 01
003 x:y -41 019 *LBL b 21 16 12
004 % 55 020 RCL1 35 01
005 - -45 021 DSP2 -63 02
006 RCL0 36 00 022 R/S 51
007 x:y -41
008 / -24 023 *LBL C 21 13
009 STO1 35 01 024 STO0 35 00
010 *LBL a 21 16 11 025 *LBL c 21 16 13
011 RCL1 36 01 026 RCL0 35 00
012 RCL0 36 00 027 DSP4 -63 04
013 %CH 16 55 028 R/S 51
014 CHS -22
015 DSP1 -63 01
016 R/S 51


Edited: 31 Oct 2012, 2:24 p.m.

#33

Thanks Rec,
I know lot of people, and I mean LOT of people will laugh out loud but ...

where is the " character ??

by the way, one more silly question ...

when you say at line 03 and 07 x:y do you really mean I have to enter alpha mode and type x:y ?

can't find lower key x and lower key y, does it make a difference ?
I know collecting and restoring calculators does not make me automatically a programmer
please don't laugh too much ... :)))
take care Alberto


#34

Yes, sorry, I have bad typo habits!

In the HP41/42 listing the quote character ( " ) usually indicate ALPHA mode.

I also use the tilt ~ to indicate APPEND character (precede by a quote since it's an ALPHA mode function.

In the both listings, I used x:y as a personal representation of X exchange Y key ( X><Y in HP41/42 convention).

Again, apologize my specific use (and miss-use) of program code convention.
And I am sure nobody will laugh here. We all strike trying to get readable code into in-line post. Not an easy task.


#35

ciao Ret, ciao Everyone,

Ret, I have been able to load "all" the code into the machine :)

However, it behaves differently from what I would have expected, as it happens almost anytime humans beings relates with computers, calcs, spreadsheet etc etc ...

This is a picture of the two animals compared :


In sales, you usually know two factors and need to compute the third.

As an example, you know your buy price, customer sets your selling price (i.e. his buy price) and you are curious to know how rich you didn't get this time, i.e. you want to calculate your margin.
Or, you know that selling price, you want to get rich and set your margin, and you need to know what your buing price will be.
The Commodore F4902 works this way. You enter a digit and press the corresponding key,
say SEL for setting the Selling price and CST for setting you buying price.
Then, you press the F key (uppermost left key) and the MRG key, that will be calculated and shown.

On the HP41C, even if I perform the CLRG - I had to look in the manual to understand how to do it, and I spare you how tough has been to find the correct key sequence for the FS?C step :))) -

any time I enter a value, the program already compute a result.

Even if I look at you example, what do you mean with "10 [ C ] COST: $20.00" ?

If label C is setting the cost price, 10 [C] should'nt say COST 10 $ ??(BTW where the heck is the $ character, or any chance I can have the € ?)

I think you did a great job, but I still miss something, so if anyone still want to have some little fun in transforming a scientific calculator into a financial one :) please, help me understand what I'm doing wrong

Aurelio,did you get it working ?

Take care everyone, and thanks for the help and the fun !


#36

Hi Alberto, not yet, actually I couldn't take even the time to key the program and test.....hope I'll succed in the afternoon, stay tuned.
Ciao.

#37

Quote:
On the HP41C, even if I perform the CLRG - I had to look in the manual to understand how to do it, and I spare you how tough has been to find the correct key sequence for the FS?C step :))) -

any time I enter a value, the program already compute a result.

Even if I look at you example, what do you mean with "10 [ C ] COST: $20.00" ?

If label C is setting the cost price, 10 [C] should'nt say COST 10 $ ??(BTW where the heck is the $ character, or any chance I can have the € ?)

I think you did a great job, but I still miss something, so if anyone still want to have some little fun in transforming a scientific calculator into a financial one :) please, help me understand what I'm doing wrong

Aurelio,did you get it working ?

Take care everyone, and thanks for the help and the fun !

Hi Alberto, hi Ret, hi all!
I tried and all work great, but......only after a little review

@Ret:
I found something wrong in the post...(just error in typing, sure):

In the example

CLRG

10 [ C ] COST: $20.00 >>>> should be 20 [ C ] COST: $20.00

75 [ A ] PRICE: $80.00

[shift][ a ] MARGIN 75.0 %

@all:
here, below program listing with correct typo (program code convention)

MARGINE HP41-42 >>>>>>>>>>(MARGE)

01 LBL A

02 1

03 X<>Y

04 %

05 -

06 RCL 00

07 X<>Y

08 /

09 STO 01

10 LBL b

11 RCL 01

12 "PRICE"

13 GTO 08

14 LBL B

15 STO 01

16 LBL a

17 RCL 01

18 RCL 00

19 %

20 CHS

21 "MARGE"

22 FIX 1

23 SF 09

24 GTO 09

25 LBL C

26 STO 00

27 RCL 01

28 x>y?

29 GTO a

30 LBL c

31 RCL 00

32 "COST"

33 LBL 08

34 >" $"

35 FIX 2

36 LBL 09

37 ARCL X

38 FS? 09

39 >" %"

40 AVIEW

41 END

Thank-you a lot, Ret, for your program!!!

@Alberto: sure you found already how to get CLRG >> XEQ "CLRG", otherwise you can assign the command to a key in the "USER" mode

I got from the listing a raw file suitable for the emulator (thank-you a lot to Ulisse Quadri and Leo Duran!)

then I printed a code bar to avoid the keying on the real calculator.
A lot of fun of course.......:))))

But now the challenge is to run programs on the not alphanumeric calculators!

Hope it helps, cheers
Aurelio


Edited: 1 Nov 2012, 1:17 p.m.


#38

Thank you aurelio for the careful review of my post and to correct the typo of my listing.

Beware that line is 019 %CH (% change instruction) and at line 038 FS?C 09 ( test if flag 9 is set and clear it).


====================================================================


To mimic the behavior of the Commodore Calculator, I produce a new version of the code were %Margin, $Sell/Buy Price and $ Cost are memorized.

Usage :

[ A ] Set new margin percentage.
[ shift ][ A ] Compute and display new margin percentage based on actual Price and COST.


[ B ] Set new Sell/Buy PRICE.
[shift][ B ] Compute and display PRICE based on actual %Margin and Cost.

[ C ] Set new Production/Providing Cost ($)
[shift][ C ] Compute and display COST based on actual %Margin and Price.

The CLRG, no more needed.

Sorry, but there no € caracter on the HP-41, no Euro nor Ecu exist at the time the Hewlett Packard Company produce the HP-41 Advanced Calculator ! Consequently there no € character in the set.


Registers:

R00: Cost in $ R01: Price in $ R02: Margin %

HP-41 version -----------------------------------------------------

01 LBL a 12 LBL b 23 LBL c 32 LBL 08
02 RCL 01 13 RCL 00 24 RCL 01 33 >" $"
03 RCL 00 14 1 25 ENTER^ 34 FIX 2
04 %CH 15 RCL 02 26 RCL 02
05 CHS 16 % 27 % 35 LBL 09
17 – 28 - 36 ARCL X
06 LBL A 18 / 37 FS?C 09
07 STO 02 29 LBL C 38 >" %"
08 "MARGE" 19 LBL B 30 STO 00 39 AVIEW
09 FIX 1 20 STO 01 31 "COST" 40 END
10 SF 09 21 "PRICE"
11 GTO 09 22 GTO 08

HP-97 version -----------------------------------------------------

001 *LBL a 21 16 11 011 *LBL b 21 16 12 023 *LBL c 21 16 13 032 *LBL 9 21 09
002 RCL1 36 01 012 RCL0 36 00 024 RCL1 36 01 033 DSP2 -61 02
003 RCL0 36 00 013 1 01 025 RCL2 36 02 034 RCL1 36 01
004 %CH 16 55 014 RCL2 36 02 026 % 55 035 PRTX -14
005 CHS -22 015 % 55 027 - -45 036 RCL0 36 00
016 - -45 037 PRTX -14
006 *LBL A 21 11 017 ÷ -24 028 *LBL C 21 13 038 DSP1 -61 01
007 STO2 35 02 029 STO0 35 00 039 RCL2 36 02
008 DSP1 -63 01 018 *LBL B 21 12 030 DSP2 -63 02 040 PRTX -14
009 R/S 51 019 STO1 35 01 031 R/S 51 041 DSP4 -61 04
010 GTO9 22 09 020 DSP2 -63 02 042 SPC 16-11
021 R/S 51 043 R/S 51
022 GTO9 22 09


Edited: 2 Nov 2012, 6:22 a.m. after one or more responses were posted


#39

Quote:

Beware that line is 019 %CH (% change instruction) and at line 038 FS?C 09 ( test if flag 9 is set and clear it).


Excuse me, Ret, if I maybe completely misunderstood the code, it means that my review was not so careful!

But If there are no problems to key these lines with the 42's menu, I'm not able to do it with the 41's.
May you help me, please?

Edited: 1 Nov 2012, 2:58 p.m.


#40

Yes of course.

To key in %CH;

[ XEQ ][ALPHA][shift][ % ][ C ][ H ][ALPHA]

To key in FS?C 09 :
[ XEQ ][ALPHA][ F ][ S ][ ? ][ C ][ALPHA] [ 0 ][ 9 ]

The HP41 (as the HP42) have more function and instruction than draw on the keyboard. All function/instruction can be spell using [XEQ][ALPHA].

For exemple keying [XEQ][ALPHA][ S ][ I ][ N ][ALPHA] is equivalent to simply pressing the [ sin ] key.


#41

Thank-you, I just forgot the result of the command [ XEQ ]+[ALPHA]

Edited: 1 Nov 2012, 5:54 p.m.

#42

WORKS !!!

Thank you very much to everyone !

I'll charge my HP67 and HP65 and see how it will works on those :)
thanks again Alberto


#43

Hi Alberto, let me know about the 67 performance.
you can send me a also a PM if you like
Ciao.

#44

Quote:
I spare you how tough has been to find the correct key sequence for the FS?C step

This maybe is a typo error, should be I think FS? 09, like 19 %CH should be simply 19 %

Edited: 1 Nov 2012, 2:56 p.m.

#45

Quote:
(yes, I'm a sales guy, sorry for that

Ciao Alberto, like Telly Savalas, acting in "Capricorn One" movie "I can't help that"....................
smiles apart, thank-you for your question (we'll enjoy both, the answer)

I would like to ask also where can I find [in the existing library for HP41-42, earlier or newer RPN (RPL) machines], programs fitted to calculate also (MON) EBIT (MOL) EBITDA or like in the example below

Statement of Income — Example (from Wikipedia)

Revenue

Sales Revenue $20,438

Operating Expenses

Cost of goods sold $7,943

Selling, general and administrative expenses $8,172

Depreciation and amortization $960

Other expenses $138

Total operating expenses $17,213

Operating income $3,225

Non-operating income $130

Earnings before Interest and Taxes (EBIT) $3,355

Financial income $45

Income before Interest Expense (IBIE) $3,400

Financial expense $190

Earnings before income taxes $3,210

Income taxes $1,027

Net Income $2,183

maybe this can be easyly calculated with excel or similar applications, but like Alberto, I love vintage calculators......;)))

Actually I'm not a sales man but in my job since a lot of years we are brought to talk more about money than technical or scientific matter.

Thanks in advance.


Edited: 1 Nov 2012, 1:15 p.m.

#46

Alberto, I'm glad to see that you got so much help with the program. I apologize for not getting back to you. I have been very busy. I will have to adjust my thinking in regards to making offers to help when I actually have so little time.


Possibly Related Threads…
Thread Author Replies Views Last Post
  How much would making a one-off calculator cost? KoenDV 17 5,154 06-03-2013, 05:35 AM
Last Post: Nick_S
  That is how they should sell the HP 30B :) Harald 11 3,470 04-07-2013, 11:44 AM
Last Post: Juergen Keller
  WP34S - Worth The Time and Cost? Les Wright 13 3,916 03-07-2012, 06:01 PM
Last Post: Richard Wagoner
  Cost Central shipping HP15C LE? M. Joury 8 2,558 09-15-2011, 08:21 PM
Last Post: Namir
  HP 10BII+ available for sell Gerardo Rincon 18 4,799 04-20-2011, 10:28 PM
Last Post: Jim Yohe
  Buy, Sell or Neutral? Michael de Estrada 5 1,684 04-07-2011, 11:10 AM
Last Post: David Ramsey
  I'm thinking to sell my Red-DOT!! Ignazio Cara (Italy) 9 2,682 05-07-2010, 03:01 PM
Last Post: Michael de Estrada
  Is the HP 30B for sell or not? Gerardo Rincon 2 1,161 04-22-2010, 01:01 AM
Last Post: hpnut
  How do you sell your HP calculators? R.J. Soto 82 16,393 10-17-2009, 01:45 AM
Last Post: R.J. Soto
  "Why Rechargeable Batteries Are Rarely Cost Effective" Egan Ford 11 3,008 09-22-2009, 10:15 PM
Last Post: Chan Tran

Forum Jump: