Getting the values from a curve

nickdf

New Member
Joined
Jun 14, 2022
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hi

I'd like to put together some pricing for products, with lower prices for volume.

If plotted with volume on an X axis and price on Y, this would give me a curve a bit like the bottom left quarter of a flattened oval.

I don't have the maths skills to work out a formula that gives me the curve I want, where I can specify how steep it is, how quickly it bottoms out as we get near cost price etc. So my idea was to plot a curve in Excel using certain data points, and then extract the price from the curve by seeing if Excel could give me the values along its length.

I found some VBA code to extract data from a chart, but if only gives the values I've put in to my source data - it doesn't allow me to get the values in between, i.e. along the entire length of the curve.

Any suggestions please?

Thanks in advance
 

Attachments

  • Capture.PNG
    Capture.PNG
    10.6 KB · Views: 22

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
You are not asking an Excel question, you are actually asking a math question. So you are going to need to do some math.

The first thing is to decide what type of curve you want. Then you can take your sample data points and use Excel to do a curve-fitting regression that would fit your points. However, be aware that you probably won't get a perfect fit. Once you have that, you can get the equation for the regression curve, then plug in volume and get price out.

I have attached a sample using your data. In your case the best fit is a logarithmic curve. I have shown your data points, the curve, and the equation for the curve, and your prices based on that equation.

Here's the other way you could do this. It would be a lot simpler, but given what your curve looks like it would be far less accurate. You would get a volume, then use linear interpolation to get the price. This assumes that the curve between each pair of your original data points is a straight line segment. This might be acceptable if you have lots of initial data points, but you don't. I have shown that too.

Last of all, I could provide a parameterized curve where you can plug in a couple of key values that will change the shape of the curve. You can see that the equation for the given curve is
Excel Formula:
=-0.117*ln(B2)+2.1876
and is of the general form
Rich (BB code):
=-a*LN(x)+b

You could set up a bunch of data points where you specify a and b as parameters. I've done that in this file, too.




Capture.JPG
 
Upvote 0
I can offer another approach too. Your data have a characteristic exponential decay, but the decay rate is not constant. Because of that general exponential relationship, I plotted the Benchmark Unit Prices against the log of the Quantity to visually examine the decay rates, which can be described as a series of linear segments (shown below). Since there aren't very many of them, it is convenient to simply determine the slope and intercept of those linear segments and then use those slopes and intercepts in a reverse process to estimate an interpolated value for any input quantity of interest. So when a Quantity is input in the blue cells, a lookup is done to extract the slope and intercept from the appropriate section of the benchmark price-log volume curve and then apply that slope/intercept to derive an interpolated value. A plot of the benchmark prices (blue circles) against a smoothed curve consisting of 12 estimated (interpolated) values is also shown.
MrExcel_20220614.xlsx
ABCDE
1
2Interpolated Unit Price
3QtyUnit Price
412.10
5101.97
6201.93
71001.84
85001.57
910001.40
1015001.31
1130001.18
1250001.10
1380001.09
14100001.09
15170001.08
16
17
18Source Data
19Qtyln(Qty)Benchmark Unit Pricesslopeintercept
20102.1-0.056622.1
212005.2983171.8-0.248533.116812
2210006.9077551.4-0.21642.894868
2320007.6009021.25-0.16372.494294
2450008.5171931.1-0.014431.222877
25100009.210341.09
Sheet1
Cell Formulas
RangeFormula
B4:B15B4=XLOOKUP($A4,$A$20:$A$24,D$20:D$24,,-1)*LN($A4)+XLOOKUP($A4,$A$20:$A$24,E$20:E$24,,-1)
D20:D24D20=SLOPE($C20:$C21,$B20:$B21)
E20:E24E20=INTERCEPT($C20:$C21,$B20:$B21)
B20:B25B20=LN(A20)

1655219503241.png
1655219520321.png
 
Upvote 0
Your data have a characteristic exponential decay
That was my first impression but when I created trendlines using exponential and logarithmic, the logarithmic gave a better R2.
 
Upvote 0
Can't believe how thorough and helpful these answers are guys. I haven't had a chance to digest them and try and make sense of them yet but thank you sincerely for the responses.

Nick
 
Upvote 0
Your point is well taken, Jeff. I was careless with my wording and should have said "generally logarithmic decay", thinking of something like y = a log x, which is the same model you chose without any y offset. But before attempting any regression, I was curious about the relationship between log V and P, because if a single decay rate were underlying the data, then a plot of Unit Price against ln(V) should be linear (shown in my post). When I saw that the points did not lie along a single line, I abandoned the idea of regression and a whole-curve single rate model, since I wasn't confident that a good fit could be obtained. Instead, I opted to treat this curve as a piecewise curve whose individual segments can be characterized with two parameters---somewhat resembling an interpolating polynomial spline approach where a curve is treated piecewise as one moves along the curve and derives fitting parameters from more localized points---except in this case, it is a local single rate logarithmic model that is applied rather than a polynomial. And since the interpolation is between nodes, the single rate assumption is easier to justify. Unlike some approaches involving interpolation (e.g., cubic spline) where specific requirements are established for first and second derivatives at nodes and/or endpoints, I did not make any effort to consider those constraints. I went back and investigated the behavior around the nodes because I was curious whether the lack of continuity constraints would be a problem. But with Volume being in integer units and Unit Price being rounded to two decimal places, there is no discernible issue around the nodes.

Nick, please post back if you have any questions about these offerings.
 
Upvote 0
I opted to treat this curve as a piecewise curve....
Quite a comprehensive analysis. :)

In the end, I'm wondering if we should be applying these methods to a pricing model that was developed intuitively begin with. We don't have enough information to develop an optimal pricing model based on the economics of whatever @nickdf is selling. We have answered the question as asked, but these methods are more appropriate for modeling physical processes, IMHO.
 
Upvote 0
Good point. That seems to be a common issue when data are presented and there is some desire to fit it to something. I normally look into whether there is some theory or guiding principle that would inform model selection/development, but in this case, I don't know what that would be (I'm guessing some type of logarithmic model with another parameter or two to adjust the decay rate as a function of V).
 
Upvote 0
Normally you would do this with a sh!tload of marketing data, and price to elasticity nearest zero. In this case we are kind of flying by the seat of our pants.
 
Upvote 0
This is some great information and it is precisely the thing I am looking for!
I have a similar situation where I am trying to work out the lifting capacity of a crane based on the radius of the lift. I have a set of data from a manufacturers duty chart, but the values are not necessarily customer friendly. Any help would be greatly received...

The information I have currently is this...

Radius (m)Lift (kg)
182000
2.922000
4.3516400
611760
7.758900
9.657000
1.755660
13.94730
16.153970

Which produces this curve.

1661357301696.png

Ideally I would like to be able to calculate the potential lifting capacity at 5m for example...

Hope this makes sense. Thank you in advance.
 
Upvote 0

Forum statistics

Threads
1,215,635
Messages
6,125,946
Members
449,275
Latest member
jacob_mcbride

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