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: https://technical.swissmicros.com/decoders/dm42/

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

Pricing calculations

Post by svarre69 »

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 3:08 am

Re: Pricing calculations

Post by Epidiah »

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: 15
Joined: Tue Oct 01, 2019 2:09 pm

Re: Pricing calculations

Post by svarre69 »

This is great stuff!! :)

Using the Solver is very efficient - thank you.

Kind regards
Peter. :)
rprosperi
Posts: 1703
Joined: Mon Apr 24, 2017 7:48 pm
Location: New York

Re: Pricing calculations

Post by rprosperi »

svarre69 wrote:
Mon Nov 04, 2019 12:56 pm
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, DM41X: β00071 & 00656, DM10L: 071/100
svarre69
Posts: 15
Joined: Tue Oct 01, 2019 2:09 pm

Re: Pricing calculations

Post by svarre69 »

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: 1703
Joined: Mon Apr 24, 2017 7:48 pm
Location: New York

Re: Pricing calculations

Post by rprosperi »

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, DM41X: β00071 & 00656, DM10L: 071/100
User avatar
Walter
Posts: 3070
Joined: Tue May 02, 2017 11:13 am
Location: On a mission close to DRS, Germany

Re: Pricing calculations

Post by Walter »

rprosperi wrote:
Wed Nov 06, 2019 3:49 pm
Wow, 25% Tax ?! I thought 8.125% where I live in NY was pretty high, holy smokes!
FYI, German VAT is 19%.
WP43 SN00000, 34S, and 31S for obvious reasons; HP-35, 45, ..., 35S, 15CE, DM16L S/N# 00093, DM42β SN:00041
cdmackay
Posts: 281
Joined: Fri Oct 05, 2018 8:33 pm
Location: Cambridge, UK
Contact:

Re: Pricing calculations

Post by cdmackay »

20% in the UK (standard rate)
Cambridge, UK
41CL/DM41X 12/15C/16C DM15/16 17B/II/II+ 28S 42S/DM42 32SII 48GX 50g 35s WP34S PrimeG2 WP43S/pilot
Casio, Rockwell 18R
DA74254
Posts: 193
Joined: Tue Oct 03, 2017 11:20 pm
Location: Norway/Latvia

Re: Pricing calculations

Post by DA74254 »

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, WP43 Pilot SN:00002, DM32 SN: 00045 (Listed in obtained order).
keithdalby
Posts: 564
Joined: Mon Apr 24, 2017 8:38 pm

Re: Pricing calculations

Post by keithdalby »

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