Pricing calculations

Contributions to this software library are always welcome. Please ensure that you post program listings rather than .raw files. They give a reasonable idea of what your program does without having to load them into a DM42 and you can also include comments in your code. Check out the following link for a decoder/encoder: http://www.swissmicros.com/dm42/decoder/

You can then copy/paste the listing and post it in "code" tags.
svarre69
Posts: 5
Joined: Tue Oct 01, 2019 12:09 pm

Pricing calculations

Post by svarre69 » Mon Nov 04, 2019 11:56 am

Hello everyone :)

I am trying to write a program for calculating Selling Price (PRC) Cost (CST) Margin (MAR) and Markup (MU)

MU is defined as the difference between PRC and CST, divided by CST.

MAR is defined as the difference between PRC and CST, divided by PRC.

That is: Markup is based on Cost and Margin is based on Selling Price.

I have created the menu for the program using MVAR and VARMENU, and I have programmed finding PRC and MU
given CST and MAR.

I would like the program to find the two remaining variables, given two variables.
Eg. if we have PRC and MAR given, the program finds CST and MU.

Below are the formulas listed for finding the remaining two.

I guess I need some kind of test to find out which variables are filled in when I run the program.
Any suggestions on how to do this?

Calculate Selling Price given Cost and Markup:
CST, ENTER, MU, % +.

Calculate Selling Price given Cost and Margin:
CST, ENTER 1 ENTER, MAR, % - /(division).

Calculate Cost given Selling Price and Markup:
PRC, ENTER 1 ENTER, MU % + /.

Calculate Cost given Selling Price and Margin:
PRC ENTER, MAR, % -.

Calculate Markup given Cost and Selling Price:
CST, ENTER, PRC, %CHG.

Calculate Markup given Margin:
MAR, ENTER, ENTER, 1, X exchange Y, % - /.

Calculate Margin given Selling Price and Cost:
PRC, ENTER, CST, %CHG, CHS

Calculate Margin given Markup:
MU, ENTER, ENTER, 1, X exchange Y, % + /.

Below you find the program listing I already have.

The program can also be used for finding out how much an item cost with or without tax. If an item costs $160 without tax,
set the Cost = 160 and set the Margin = 20 then Markup will show the tax (25%) and PRC = $200 which is the Price including tax.
And vice versa.

Code: Select all

01 LBL "SALES"
02 MVAR "PRC"
03 MVAR "CST"
04 MVAR "MAR"
05 MVAR "MU"
06 VARMENU "SALES"
07 STOP
08 EXITALL
09 RCL "CST"
10 1
11 ENTER
12 RCL "MAR"
13 %
14 -
15 /
16 STO "PRC"
17 RCL "MAR"
18 ENTER
19 ENTER
20 1
21 X exchange Y
22 %
23 -
24 /
25 STO "MU"
26 END

Epidiah
Posts: 21
Joined: Mon Jan 29, 2018 2:08 am

Re: Pricing calculations

Post by Epidiah » Mon Nov 04, 2019 2:26 pm

A quick and dirty solution to this is to use two smaller programs in the Solver.

This...

Code: Select all

00 { 37-Byte Prgm }
01▸LBL "*MU"
02 MVAR "PRC"
03 MVAR "CST"
04 MVAR "MU"
05 RCL "CST"
06 RCL "MU"
07 %
08 +
09 RCL- "PRC"
10 END
And this...

Code: Select all

00 { 40-Byte Prgm }
01▸LBL "*MAR"
02 MVAR "PRC"
03 MVAR "CST"
04 MVAR "MAR"
05 RCL "PRC"
06 RCL "MAR"
07 %
08 -
09 RCL- "CST"
10 END
From the Solver menu, choose the program named after the variable you want involved in your calculations (MAR or MU). This is either the variable you're trying to solve for, or the variable you know if you're trying to solve for either PRC or CST.

Once you've solved one of these equations, the values remain in the variables. So you can exit back to the program selection part of the Solver menu and choose a different program to solve for the remaining variable.

Let's say you don't care about PRC or CST, but want to know the MAR given a MU of 25%. Here's how you could do it:
  • Shift 7 to enter the Solver Menu
  • [*MU] to select the MU program
  • 25 [MU] to put 25 in the MU variable
  • 1 [PRC] (the number and choice of variable really doesn't matter here, as long as you put a value in one & solve for the other)
  • [CST] to solve for CST so that both PRC and CST will be available in the next program
  • [Exit] to return to the main Solver Menu where you can...
  • [*MAR] ...select the MAR program
  • [MAR] To choose MAR as the variable you wish to solve for (you'll probably have to select this a couple times because the first time you do the calculator will assume you're entering a guess into the variable)
Hopefully that's helpful.

svarre69
Posts: 5
Joined: Tue Oct 01, 2019 12:09 pm

Re: Pricing calculations

Post by svarre69 » Tue Nov 05, 2019 8:28 am

This is great stuff!! :)

Using the Solver is very efficient - thank you.

Kind regards
Peter. :)

rprosperi
Posts: 502
Joined: Mon Apr 24, 2017 5:48 pm
Location: New York

Re: Pricing calculations

Post by rprosperi » Tue Nov 05, 2019 10:42 pm

svarre69 wrote:
Mon Nov 04, 2019 11:56 am
Hello everyone :)

I am trying to write a program for calculating Selling Price (PRC) Cost (CST) Margin (MAR) and Markup (MU)

[snip]

The program can also be used for finding out how much an item cost with or without tax. If an item costs $160 without tax,
set the Cost = 160 and set the Margin = 20 then Markup will show the tax (25%) and PRC = $200 which is the Price including tax.
And vice versa.
Do you really mean"tax" here? The program works with margins, markups, price, etc, in the standard business methods, but then you suddenly introduce "tax". Are you suggesting to use Margin to calculate tax? If so, your example says to use 20% Margin to get the effective tax increase of 25%, but a typical user likely would not know what Margin to enter to get the effective tax rate they want. Maybe I'm missing something?
--bob p

DM42: β00071 & 00282

svarre69
Posts: 5
Joined: Tue Oct 01, 2019 12:09 pm

Re: Pricing calculations

Post by svarre69 » Wed Nov 06, 2019 8:40 am

Hello Bob

In Denmark the tax is 25% - so using the margin as 20% to calculate tax is ok for this purpose.
Not generally of course - you are absolutely right in that point. :?

Sorry for confusing you.

With kind regards
Peter

rprosperi
Posts: 502
Joined: Mon Apr 24, 2017 5:48 pm
Location: New York

Re: Pricing calculations

Post by rprosperi » Wed Nov 06, 2019 2:49 pm

Thanks for clarifying, I thought I was missing something... lol.

Wow, 25% Tax ?! I thought 8.125% where I live in NY was pretty high, holy smokes!
--bob p

DM42: β00071 & 00282

User avatar
Walter
Posts: 1100
Joined: Tue May 02, 2017 9:13 am
Location: Close to FRA, Germany

Re: Pricing calculations

Post by Walter » Wed Nov 06, 2019 9:01 pm

rprosperi wrote:
Wed Nov 06, 2019 2:49 pm
Wow, 25% Tax ?! I thought 8.125% where I live in NY was pretty high, holy smokes!
FYI, German VAT is 19%.
DM42 SN: 00041 --- Follower of Platon.

HP-35, HP-45, ..., HP-50, WP 34S, WP 31S, DM16L

cdmackay
Posts: 90
Joined: Fri Oct 05, 2018 6:33 pm
Location: Cambridge, UK
Contact:

Re: Pricing calculations

Post by cdmackay » Wed Nov 06, 2019 9:18 pm

20% in the UK (standard rate)
Cambridge, UK
41CL 12/15C/16C DM15/16 71B 17B/BII/bII+ 28S 42S/DM42 48GX 50g 35s 30b/WP34S Prime G2
& Casios, Rockwell 18R :)

DA74254
Posts: 59
Joined: Tue Oct 03, 2017 9:20 pm
Location: Norway/Latvia

Re: Pricing calculations

Post by DA74254 » Thu Nov 07, 2019 7:41 pm

25% in Norway and Sweden.
21% in Latvia

Though, Norway and Denmark is "funny" when it comes to cars. Import tax on a car in Norway is an average of 100%. With a little less, ca 50% on smaller cars and up to 1000 (one thousand)% on cars like Bugatti and such. It's even worse in Denmark with 125 - 200% import tax on cars.
Though Electric cars ar subsidised in Norway; absolutely zero/zilch/none tax or fees on the dildo fuel cars, as the chlorophyll mafia in Norway have the insanely stupid idea that an electric car does not pollute..
Esben
DM42 SN: 00245

keithdalby
Posts: 545
Joined: Mon Apr 24, 2017 6:38 pm

Re: Pricing calculations

Post by keithdalby » Fri Nov 08, 2019 6:50 pm

DA74254 wrote:
Thu Nov 07, 2019 7:41 pm
dildo fuel cars.
Well that's a fuel I've not heard before

Post Reply