How to fill a series like an algorithmic chart

Harryf

Board Regular
Joined
Aug 31, 2013
Messages
52
Hi everybody!

I need to fill a series starting at 0.02% and ending at 10% (discounts) in a specific range which may be changed, but not in fixed increments (step values) nor in a straight line (linear) nor as a series showing a gradual growth in the values.

Discounts are granted to a product based on the cost of the product and I need to come up with discounts for these products based on the product price. The requirement is that the discount must start at a low base of 0.02% for a product costing $950 (starting price) and grow to a maximum of 10% for a product costing $5,500 (maximum price).

I'd entered these values in range A2 to A912, starting at 950 and increasing each next value by 5 up to 5500. I entered 0.02% in B2 and 10% in B912 and used Excel's Edit/FILL/Series functionality to fill the series between the two values, but it does not provide what I need with its linear and growth (starting slow and increasing in the end) options, with or without ticking the "trend" box.

Excel's help menu shows a logarithmic trendline to display the characteristics of the way my data should display in a chart - growing quickly in the beginning and flattening out later.

I used the LN (Natural logarithm) function to get the natural logarithms of column B, but the negative numbers do vreate a nice "inverse curve" graph, but the logarithmic values do nothing to help me with the discount percentages!

I need something (formula copied down, VBA, or whatever) which will create a series of discount percentages that exhibits the properties shown in a logarithmic line.

I hope I made myself understood - and that someone has a brilliant solution!

With kind and hopeful regards

Harry
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
I've fit a logarithmic curve to your data for you. Not so much a feat of excel prowess as it was of mathematics but... enjoy !

Code:
=0.0998/LOG10(5500/950)*(LOG10(A2/950))+0.0002
 
Last edited:
Upvote 0
Gee whiz, Juglaz, am I happy that you noticed my thread!!! :biggrin:

Your solution works PERFECTLY!! Exactly what I wanted. I have no idea what the formula does and why it works and am not even going to try to understand.

Many, many, many thanks from a very, very happy Harry!!

What makes you know a solution like that, or figure one out, if I may ask? Mathematician? Actuary? What else... Economist? Or are you just clever? hehe ;)

Cheers!

h
 
Upvote 0
Hey Juglaz! Hope you're still reading replies to thie thread, otherwise I may have to PM you! I need your help, again!:confused:

Is it possible to increase the "bulge" of the discounts in a way that, if the current formula that you'd given me is shown in a graph next to a second one with an increased "bulge" in the middle, it would look like an inverted "smile"? What I mean with that is that the outer edges of the plotted values both start and end in the same points relative to each other (both start at 0.02% and both end at 10%), but with the "new" data simply having a steeper "bump" in the middle.

The maximum "divergence" in this new set of values should be 5%, but I'd like to change this percentage to something else if it seems too low or too high.

ANY values are as good as any other as I'd just like to see if you can help me with something to increase and decrease discount percentages across a specific range of prices at will without having to do a lot of manual calculations over such a lot of data, yet still retaining the starting and ending points' values of 0.02% and 10% respectively.

Thanks, Juglaz!

Hope you can help!

Harry
 
Upvote 0
It sounds like you're not so much interested in the log function as you are in achieving a particular shape. If you want to have more flexibility in your shape I would recommend a different approach. Pick points that you would like your curve to include (end points, and several shape-setting points). Plot these points on a scatter plot and in the layout tab, add a polynomial (probably 2nd order) or logarithmic trendline. Also be sure to check the 'Display Equation on Chart' checkbox at the bottom of that dialogue. Then apply the displayed equation to your data. Let me know if that works out for you.

- Juglaz
 
Upvote 0
Hey Juglaz!

You have me absolutely stumped, but if you give me some time I'' see what I can learn from the answer. I've already glanced through this web page (Creating a Scatter Plot in Excel) and decided I need I day or two! hehe

I'll report back!

Thanks again!

h
 
Upvote 0
Juglaz, sincerely hope you don't mind a further inquiry on this one. I have the same challenge as HarryF and have taken your suggested approach of "Plot these points on a scatter plot", 2nd order poly, etc. I have 10 discount "steps", gradually taking the discount from 10% to 48.8%, and have the formula visible on the chart. The formula shows "y = 4.1012x + 14.973". Apologizing in advance for my engineering mathematical ignorance :), how would I transpose this snippet into a discounting formula that Excel would understand? Many thanks!!!!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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