Formula for a sale price which has circular references

liam1983

New Member
Joined
Sep 27, 2016
Messages
11
Hi all, hope you are well.

Have a problem that I need a solution for, we have one at the moment which uses a macro but with the data volume it takes a long time and a lot of resources to run.

The basic explanation of the problem is that we receive a purchase price for a product, we need to get to a selling price which has a commission fee and a VAT liability which changes based on the gross selling price. Working from selling price backwards is obviously easy, the issue is working forward from buy price, variable costs which are a percentage based on sale price and a target margin make it.

I will give a layout of the problem and columns as an example, figures used for round numbers where possible (hope the alignment used at time of writing post stays this way)

[Cost] [margin] [commission @12%] [VAT] [net sale price] [gross sale price]
[6.06] [2.50] 1.44 - 2 - 10 - 12

We need to be able to change target margin to suit cost of goods, at the moment the macro we have cycles through selling prices until margin matches that in the target column, that is fine when you have a handful of data to crunch, when there are thousands of rows it takes hours and seriously effects the performance of a high powered PC, the formulas we write which in theory work do contain two circular referneces.

One is the commission percentage of the gross sale price, the other is the VAT amount at 20% of the gross sale price. As they adjust the gross selling price needs to go up to cover these two values to still keep the target margin.

We use a goal seeker macro that we set a target profit and it changes the selling price until the target profit is matched.

Thanks for your help all
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
@felixstraube, using your Cost & Margin figures the formula I provided produces the same Selling price. There are merits in having a template such as you have produced but I don't believe this solvable without tackling the margin issue.
Thanks for this, we do not work on a margin percentage we have a fixed value which runs in bands
Your template assumes a % which the above indicates doesn't apply.
 
Upvote 0
He never replied to when I asked how he gets those (margins)...
Anyway this actually is pretty simple either way. High school math I would say.

Lets say again that we have:

c: cost
m: margin
k: commission
s: gross sale price, our unknown

And the equation to get s is this:

s = (c + m + k) * 1,20 (1)

1,20 because of the VAT 20%.


Case 1: Margin is a fixed value, and commission is a percentage of the gross price. Then we have

m (just a fixed value)
k = kp * s where kp is the percentage (from our example 12%)

Now we replace that in equation (1). we get:

s = (c + m + kp * s) * 1,20

We solve for s and get

s = (c + m) / (1/1,2 - kp)


Case 2: Margin and commission are percentages of the gross price. When we have

m = mp * s where mp is the margin percentage (from the example 20,833333% obtained from dividing 2,5 in 12)
k = kp * s where kp is the percentage (from our example 12%)

Now we replace that in equation (1). we get:

s = (c + mp * s + kp * s) * 1,20

We solve for s and get

s = c / (1/1,2 - mp - kp)


In this moment i only have a web version of excel so i will just show this image and the formulas:

1704937628093.png


Formula in F4 is:
Excel Formula:
=(A4+B4)/(1/1,2-$C$2)

Formula in F10 is:
Excel Formula:
=(A10)/(1/1,2-$C$8-$B$8)

No need for recursive calculations or solver...
 
Upvote 0
I should have taken more notice of @felixstraube's comment that your statement that VAT was "20% of your gross price" was incorrect.
By correcting the VAT % to be based on the VAT inclusive price, the VAT % becomes 0.2/1.20 = 0.166666667

And the equation becomes:
(Cost 6.06 + Margin 2.50) / 0.713333333 = £12.0000000056
1-0.166666667-0.12=0.713333333

Which still puts us back to the unanswered question of how is the Margin "Fixed" amount determined ?
Morning Alex, Gross Price is inclusive of 20% VAT that is correct.

Regarding the margin it is a fixed amount we determine at our discression, our decision is influenced by many things including buy price, market value and required return it is not a percentage of anything, it is a target we choose I could not give a definitive answer on this as it is very varied. We cannot use a percentage multiplier per your example as when the fixed costs increase (purchase price or margin) the percentage will vary and thus will not remain a usable calculation (we've tried in the past).

I do feel a bit like the enemy here, sorry if I am frustrating you but the fixed costs are not the factor in my question, the issue is that of calculating the percentages on the end result and the fact they are variable based on that end result (price) so they go round in a circle.

I have attached the basis of the calculation on an image, Cells D & E are circular based on the value in F but F requires the values in D&E to calculate the value.

Hope this makes some sense?

Thanks

Liam
 

Attachments

  • grab.png
    grab.png
    18.7 KB · Views: 13
Upvote 0
Where do you get the value for the margin from? Is it fixed at 2.5 for every product?
You never answered that question.

If it is a fixed value then would this be what you are looking for?:

Book1
ABCDEF
112%
2CostMarginCommissionNet priceVAT (20%)Gross sale price
36.062.501.4410.002.0012.00
410.002.502.1014.602.9217.52
515.002.502.9420.444.0924.53
620.002.503.7926.295.2631.54
730.002.505.4737.977.5945.56
840.002.507.1549.659.9359.58
950.002.508.8361.3312.2773.60
1060.002.5010.5173.0114.6087.62
Sheet1
Cell Formulas
RangeFormula
C3:C10C3=(A3+B3)/(1/1.2-$C$1)*0.12
D3:D10D3=SUM(A3:C3)
E3:E10E3=D3*0.2
F3:F10F3=(A3+B3)/(1/1.2-$C$1)


If not, can you show us the data you are working with?
And the expected results.
 
Upvote 0
This is obviously going to be the same underlying calculation but trying to tailor the layout according to the information you provided.

If you copy this in, then go to B3 and in the Name box where it says B3 Copy in VAT_Rate (this is using that named range)

20240110 Reverse Engineer Selling Price liam1983.xlsx
ABCDEF
1Calculation Template
2
3VAT Rate20%
4
5
6
7ProductCost InputMargin InputResellerCommission %Gross Selling Price
8Item16.062.5Johnny12%12.00
9Item273.2830.23Johnny12%145.11
10Item396.4239.78Orange Co14%196.44
11
12
13
14
15ResellerCommission
16Johnny12%
17Orange Co14%
Without Table
Cell Formulas
RangeFormula
E8:E10E8=VLOOKUP($D8,$A$16:$B$17,2,FALSE)
F8:F10F8=($B8+$C8) / (1- (VAT_Rate/(1+VAT_Rate)) - $E8)
Named Ranges
NameRefers ToCells
'Without Table'!VAT_Rate='Without Table'!$B$3F8:F10


Table names don't translate well via XL2BB but when I used tables the calculation looked like this:
Excel Formula:
=([@[Cost Input]]+[@[Margin Input]]) / (1- (VAT_Rate/(1+VAT_Rate)) - [@[Commission %]])
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,181
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top