I have the following sales data:
I would like to calculate the "Total" rowbut in my actual spreadsheet I do not have access to "LY". It is also not possible to add this column in. Is there a way to calculate the total YoY value of-33% just by knowing the -50% and +50% YoY values for each product?
Many thanks, Alan.
You can calculate LY given the Amt and YoY.
LY = Amt/(1+YoY)
So, in your example, you can calculate your result with :
C6: =(SUMPRODUCT(B4:B5,1/(1+C4:C5))-B6)/SUMPRODUCT(B4:B5,1/(1+C4:C5))
Related
I have a summary dataset below with 3 variables:
Rating
Frequency
Total Value
A
2
$10000
B
15
$24003
C
5
$56789
...
There are 18 different rating categories each with varying frequencies and values. I need to workout the average group which the data falls into so which of the rating groups is the average in both frequency and total value, so in short the data is rating group B for example.
I'm sure there must be a proper way to do this but haven't been able to easily find the answer online.
I've tried calculating some kind of weighted average but struggling as each category would be equally weighted?
In Office 365 you could use:
=LET(range,A2:C4,
rating,INDEX(range,,1),
freq,INDEX(range,,2),
total,INDEX(range,,3),
w_avg,SUMPRODUCT(freq,total)/SUM(freq),
delta,BYROW(total,LAMBDA(t,
MAX(t,w_avg)-MIN(t,w_avg))),
INDEX(rating,XMATCH(MIN(delta),delta)))
It requires the three columns as an input and names the columns. Than it calculates the weighted average as in my comment.
Then it checks the difference between the total and the weighted average per row. Than it indexes the rating and matches the one with the smallest difference (closest match to weighted average).
Note: in case of ties this would result in the first listed as a result. Otherwise we need to use FILTER.
For older Excel I have a solution including a helper cell & column:
In cell E2 use: =SUMPRODUCT(B2:B4,C2:C4)/SUM(B2:B4) to calculate the weighted average.
In cell D2 use: =MAX(C2,$E$2)-MIN(C2,$E$2) and drag this down to the last used row in your range to calculate the difference between the total of the rating and the weighted average.
In cell F2 use: =INDEX(A2:A4,MATCH(MIN(D2:D4),D2:D4),0)
To match the rating of the smallest difference.
Or this one line monster:
=INDEX(A2:A4,
MATCH(
MIN(
IF(C2:C4>=SUMPRODUCT(B2:B4,C2:C4)/SUM(B2:B4),
C2:C4,
SUMPRODUCT(B2:B4,C2:C4)/SUM(B2:B4))-
IF(C2:C4<=SUMPRODUCT(B2:B4,C2:C4)/SUM(B2:B4),
C2:C4,
SUMPRODUCT(B2:B4,C2:C4)/SUM(B2:B4))),
IF(C2:C4>=SUMPRODUCT(B2:B4,C2:C4)/SUM(B2:B4),
C2:C4,
SUMPRODUCT(B2:B4,C2:C4)/SUM(B2:B4))-
IF(C2:C4<=SUMPRODUCT(B2:B4,C2:C4)/SUM(B2:B4),
C2:C4,
SUMPRODUCT(B2:B4,C2:C4)/SUM(B2:B4)),
0))
I am trying to find a formula that will generate the total profit for a number of cohorts that generate a different periodic profit per unit, without having to create a line item for each cohort.
In this example, the profit contributed by each widget over time is shown in row 3, and the number of widgets issued in each cohort is shown vertically in column B. Each unit will contribute $25 in the first period, $60 in the second period, and so on. So year 1 total profit would be 100 x $25 = $2,500. Then in year 2, the Y1 cohort would generate 100 x $60 and the Y2 cohort would generate 200 x $25 for a total year 2 profit of $11,000.
Does someone know of a method in Excel that would work to consolidate the total profit calculation each year into a single formula? I am trying to model multiple line items over many periods, so looking for a more efficient solution.
Edit: In case this helps clarify the question, below is an image showing an example of another inefficient way to solve the problem in one line for year 4 total profits, but this is still not scalable. Also shown in text below.
`Year 4 total profit =
Y1 units issued x P4 profit per unit +
Y2 units issued x P3 profit per unit +
Y3 units issued x P2 profit per unit +
Y4 units issued x P1 profit per unit`
inefficient solution
Office 365, in C17:
=SUM(INDEX($B7:$B15,SEQUENCE(COUNT($C3:C3)))*INDEX($C3:C3,SEQUENCE(COUNT($C3:C3),,COUNT($C3:C3),-1)))
and copied right.
Ah well, I've just written an answer compatible with lower versions of Excel:
=MMULT(TRANSPOSE(B7:B15)^0,IF(ROW(B7:B15)-ROW(B7)<=COLUMN(C3:K3)-COLUMN(C3),INDEX(C3:K3,COLUMN(C3:K3)-COLUMN(C3)-(ROW(B7:B15)-ROW(B7))+1)*B7:B15,0))
It could be done a bit more easily in Excel 365 using Sequence() instead of row() and column(), but the same principle - generate a 2D matrix by comparing row and column numbers, then obtain its column totals using a standard method with Mmult.
I've filled in the intermediate results in C7:K15, but you only need the formula in C17.
Good afternoon, I have a table of trials that I am trying to average. There are three trials being conducted (trial one = column B, trial 2 = column C, and trial 3 = column D). Each of these trials displays a number, which can be below or above 180. I need to average these three trials, but if the number is greater than 180, then I need the average to be calculated using 180 rather than the original number.
Example:
Trial 1 = 159; Trial 2 = 189; Trial 3 = 73
What I would like to do: (159 + 180 + 73)/3= 137.33
Thank you!
Here's one option (array formula, so use Ctrl+Shift+Enter):
=AVERAGE(IF(B2:B4>180,180,B2:B4))
After a bit of advice on doing a calculator with a sliding scale.
I am building a matrix where we have set price points at intervals based on qty of items. The code I use works fine apart from the first 2 ranges.
Because for 1 qty the unit cost is so high my maths won't work.
Example
Qty 1 = £23.25 (Price per unit is then £23.25)
Qty 10 = £51.59 (Price per unit is then £5.159)
I then have further quantity's that work out correctly.
What I need to be able to do is some sort of weighted value, for 2 off the unit price needs to be near the £20 a unit mark, then 3 off less etc until I get to 10 off # £5.159 a unit.
(It costs more for lesser quantity's, we want to encourage more qty)
Has anyone implemented something like this? From 10 qty onwards the calculation is fine as the unit cost changes are not much at all.
Thanks
Assuming you have quantities form 1 to 10, in column A, put 23.25 in B1 and 51.59 in B10, then the following formula in B2:
=B1+(B$10-B$1)/9
And populate down to B9
in C1 use the following formula:
=B1/A1
and populate down. Final result should look like this:
You could use vlookup with a table as so:
I am trying to create a forecast tool that shows a smooth growth rate over a determined number of steps while adding up to a determined value. We have variables tied to certain sales values and want to illustrate different growth patterns. I am looking for a formula that would help us to determine the values of each individual step.
as an example: say we wanted to illustrate 100 units sold, starting with sales of 19 units, over 4 months with an even growth rate we would need to have individual month sales of 19, 23, 27 and 31. We can find these values with a lot of trial and error, but I am hoping that there is a formula that I could use to automatically calculate the values.
We will have a starting value (current or last month sales), a total amount of sales that we want to illustrate, and a period of time that we want to evaluate -- so all I am missing is a way to determine the change needed between individual values.
This basically is a problem in sequences and series. If the starting sales number is a, the difference in sales numbers between consecutive months is d, and the number of months is n, then the total sales is
S = n/2 * [2*a + (n-1) * d]
In your example, a=19, n=4, and S=100, with d unknown. That equation is easy to solve for d, and we get
d = 2 * (S - a * n) / (n * (n - 1))
There are other ways to write that, of course. If you substitute your example values into that expression, you get d=4, so the sales values increase by 4 each month.
For excel you can use this formula:
=IF(D1<>"",(D1-1)*($B$1-$B$2*$B$3)/SUMPRODUCT(ROW($A$1:INDEX(A:A,$B$3-1)))+$B$2,"")
I would recommend using Excel.
This is simply a Y=mX+b equation.
Assuming you want a steady growth rate over a time with x periods you can use this formula to determine the slope of your line (growth rate - designated as 'm'). As long as you have your two data points (starting sales value & ending sales value) you can find 'm' using
m = (y2-y1) / (x2-x1)
That will calculate the slope. Y2 represents your final sales goal. Y1 represents your current sales level. X2 is your number of periods in the period of performance (so how many months are you giving to achieve the goal). X1 = 0 since it represents today which is time period 0.
Once you solve for 'm' this will plug into the formula y=mX+b. Your 'b' in this scenario will always be equal to your current sales level (this represents the y intercept).
Then all you have to do to calculate the new 'Y' which represents the sales level at any period by plugging in any X value you choose. So if you are in the first month, then x=1. If you are in the second month X=2. The 'm' & 'b' stay the same.
See the Excel template below which serves as a rudimentary model. The yellow boxes can be filled in by the user and the white boxes should be left as formulas.