How do I calculate the number of years to target in Microsoft Excel - excel

If I have an average YOY growth of say 2.5%, current year sales of $500,000, and target sales of $1,000,000. Is there a way to calculate the number of years until I hit my target (assuming a continued YOY growth rate of 2.5%), without calculating each additional years's sales on a different row?

You can use the NPER function for this:
=NPER(Growth,0,currentSales,-targetSales)
Note that this gives the same result as #Dominique, but is using a built-in Excel function.
Also, by virtue of the nature of Excel financial functions, the signs for the current and future Sales need to be different.

There's a simple formula for this:
Money_end = (1+r/100)^Y*Money_begin
Where:
Money_begin = the starting amount of money, in this case 500000.
Money_end = the finishing amount of money, in this case 1000000.
r = the percent ratio, in this case 2.5.
Y = the amount of years, which you are looking for.
So, your question comes down to solving this equation:
1000000 = (1+2.5/100)^Y * 500000
2 = 1.025^Y
Y = log(2)/log(1.025)
If you want this to be solved by Excel, you might use the formula and use the Solver basic Excel feature for coming up with the same (but numerical instead of analytical) result.

Related

How to define an array of numbers with a formula

I have a project where I need to break people into 3 buckets with task lists that rotate quarterly (Phase A = task list 1, B = task list 2, C = task list 3). The goal here is to sort people into the buckets based on a departure date, with the ideal being that they would depart when they're in the C phase. I have a formula already set up that will tell me the number of quarters between the project start date and the person's departure date, so now I'm trying to figure out how to get Excel to tell me if a person's departure date falls within their bucket's C Phase.
I have this formula in a column called DEROSQtr:=ROUNDDOWN(DAYS360("1-Oct-2020",[#DEROS],FALSE)/90,0)
Now the easy way to approach this would be to build a static array and just see if that formula results in a value in the right array, where the numbers in the array define which quarter from Oct 2020 that the bucket's C Phase is going to be in:
ArrayA = {1;4;7;10;13;16} ArrayB = {2;5;8;11;14;17} ArrayC = {0;3;6;9;12;15}
The formula that pulls this all together is then:
=IF([#EFP]="A",IF(IFNA(MATCH([#DEROSQtr],ArrayA,0),-1)<>-1,TRUE,FALSE),IF([#EFP]="B",IF(IFNA(MATCH([#DEROSQtr],ArrayB,0),-1)<>-1,TRUE,FALSE),IF([#EFP]="C",IF(IFNA(MATCH([#DEROSQtr],ArrayC,0),-1)<>-1,TRUE,FALSE),"-")))
Now while this will work for as long as I build out the static array, I'm trying to figure out how to define each of these buckets with a formula that Excel can work with, i.e. bucket A hits phase C in 3n + 1 quarters where n is the number of cycles through all 3 phases, so ArrayA = 3n+1, ArrayB = 3n+2 and ArrayC = 3n. What I'm hunting for here is the best way to define each of the arrays as a formula.
After some additional digging and looking back at how to define each array, I came across the MOD() function in Excel. I was then able to rewrite the formula that does the checking as =IF([#EFP]="A",IF(MOD([#DEROSQtr]-1,3)=0,TRUE,FALSE),IF([#EFP]="B",IF(MOD([#DEROSQtr]-2,3)=0,TRUE,FALSE),IF([#EFP]="C",IF(MOD([#DEROSQtr],3)=0,TRUE,FALSE),"-"))), replacing ArrayA(3n+1) with MOD([#DEROSQtr]-1,3), ArrayB(3n+2) with MOD([#DEROSQtr]-2,3), and ArrayC(3n) with MOD([#DEROSQtr],3).
Since I do not have the data you are calculating your quarter, its difficult to give you exact answer. However, as I understand your have a column which has the formula to calculate the quarter say "Formula_Col"
Solution will be to add a new column and flag it based on the values in "Formula_Col".
If you can give some sample data I can provide exact answer.

Calculate the average % of a compounded increase with Excel formulas

I'm trying to calculate the average % of a compounded increase.
For example, if $100 increases by 5% over three years, the average % increase over the whole period is 10.34%.
100.00 + 5% = 105.00, 105.00 + 5% = 110.25, 110.25 + 5% = 115.76, AVERAGE(105,110.25,115.76) = 110.34, (110.34 - 100) / 100 = 10.34%
I'm currently calculating this with lots of IF statements because duration, percent, and starting values are variable…
=((100*1.05+IF(3>=2,100*(5/100+1)^2)+IF(3>=3,100*(5/100+1)^3))/3-100)/100
my actual formula contains many, many more lines to catch durations up to 25 years which is why I'm looking to scale it down with some intelligent calculations
The results will be shared with other teams who don't use VBA, so needs to utilize in-built formulas.
Thank you,
Your basic formula would be:
=(AVERAGE(FV(0.05,{1,2,3},0,-100))-100)/100
This is an array formula and must be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode.
Now if one wants the inputs to be dynamic(pointed at input cells) then we need to change the formula a little:
=(AVERAGE(FV(B2,ROW($ZZ$1:INDEX($ZZ:$ZZ,B1)),0,B3))+B3)/(-B3)
Still an array formula
NOTE: If one has the dynamic array formula SEQUENCE it can be done without the need of CSE with:
=(AVERAGE(FV(B2,SEQUENCE(B1),0,B3))+B3)/(-B3)
The math solution is
=((1+R)^N-1)*(1+R)/(R*N)-1
where R is the rate and N is the number of periods.

sum two values of dimension but show the result only in one of them in PowerPivot / DAX

It might be a easy one but I cannot solve it so please advice.
I would like to add up two months in a measure (like the current and the previous one) but when I represent the figure in a pivot table I want to show the result only in a current month.
Here is the formula I tried:
CALCULATE([Revenue],FILTER(Tbl_Period,Tbl_Period[Month_nr] = 3)) +CALCULATE([Revenue],FILTER(Tbl_Period,Tbl_Period[Month_nr] = 4))
But logically when I represent it in pivot table the revenue is appear under the two months:
See the picture of the result of the below formula:
What I want to achieve instead is the following:
See the picture of the aimed situation:
I already managed to solve with the ALL function to show the value in all the months but not only for July as I wanted. Here is the formula for that one:
Revenue:
=CALCULATE([Revenue],FILTER(ALL(Tbl_Period[Month_nr],Tbl_Period[Period_id]),Tbl_Period[Month_nr] = 3)) +CALCULATE([Revenue],FILTER(ALL(Tbl_Period[Month_nr],Tbl_Period[Period_id]),Tbl_Period[Month_nr] = 4))
Thanks in advance for the help!
I'm a little bit blind, since you haven't mentioned the structure of your Tbl_Period table.
There are many helpful functions built into dax that can save you a lot of work if you have a date table. One that would be relevant here is PREVIOUSMONTH().
Working with just the information you have provided, you can get a measure to show the previous month's revenue like this:
LastMonthRevenue: = CALCULATE([Revenue], FILTER(ALL(Tbl_Period), Tbl_Period[Month_Nr] = MAX(Tbl_Period[Month_Nr]) - 1))
and then
TwoMonthsRevenue: = [Revenue] + [LastMonthRevenue]

Any simple way to do VLOOKUP combine "linear interpolation" in excel?

I'm making an excel sheet for calculating z-score for infant weight/age (Input: "Baby Month Age", and "Baby weight"). To do that, I need get LMS parameters first for a specific month, from below table.
http://www.who.int/childgrowth/standards/tab_wfa_boys_p_0_5.txt
(For Integer Month number, this can be done by vlookup Method without issue.) For Non-Integer Month number, I need use some kind of "linear interpolation" approach to get an approximate LMS data.
The question is, both Trend method and Vlookup method are not working for me. For Trend method, it is not working as the raw data, like L parameters is not linear data, if I use Trend method, for the several top month, return data will far from existing data. As for Vlookup method, it just finds the closest month data.
I had to use multiple "Match" and "Index" Method to do the "linear interpolation" for myself. However, I wonder whether there is any existing function for that?
My current formula for L parameters is below:
=MOD([Month Age],1)*(INDEX('WHO BOY AGE WEIGHT'!A:D,MATCH([Month Age],'WHO BOY AGE WEIGHT'!A:A)+1,2)-INDEX('WHO BOY AGE WEIGHT'!A:D,MATCH([Month Age],'WHO BOY AGE WEIGHT'!A:A),2))+INDEX('WHO BOY AGE WEIGHT'!A:D,MATCH([Month Age],'WHO BOY AGE WEIGHT'!A:A),2)
If we assume that months increment always by 1 (no gap in month data), you can use something like this formula to interpolate between the two values surrounding the give non-integer value:
=(1-MOD(2.3, 1))*VLOOKUP(2.3,A:S,2)+MOD(2.3, 1)*VLOOKUP(2.3+1,A:S, 2)
Which interpolates L(2.3) from data of L(2) = .197 and L(3) = .1738, resulting in .19004.
You can replace 2.3 by any cell reference. You can also change the lookup column 2 for L into 3 for M, 4 for S etc.
To answer the question whether there is some direct "interpolate" function in Excel, not that I know about, although there is good artillery for statistical estimation.

excel formula for working handling two different tax brackets

I'm making a spreadsheet in excel to help me understand how starting a part-time business on top of my full time job might affect my tax. I need to do this because I'm very close to my next UK tax bracket and I want to know exactly how it might affect my finances.
As part of this I'm trying to write an excel formula that will add two numbers then check if this new number is greater than a third number. I will refer to the two numbers added together as A and the third number as B. If A is not greater than B then I will multiply by 20% to find out how much of it is owed in tax. If A is greater than B I will subtract B from A to create number C and multiply B by 20% and C by 40% and add the two together to produce the final number I need. Can someone please xplain to me how to script this in Excel? I've looked for online examples but I'm not finding the language very penetrable. If I was using a scripting language I was more familiar with the code would look like this:
float taxThreshold = 42011.00;
int income = foo;
if(taxThreshold < income)
{
float higherRate = income-taxThreshold;
float standardTaxOwed = taxThreshold * 20%;
float higherRateOwed = higherRate * 40%;
float finalTaxOwed = standardTaxOwed+higherTaxOwed;
}
else
{
float finalTaxOwed = income * 20%;
}
I'm sure this is very simple to do, I just don't get the excel syntax. Can someone show me how this should be done? You'd not only be solving this problem but also giving me a means of translating from my current scripting knowledge into excel.
The easiest way is to store your 4 input parameters in some cells - and then name them. To do so, select the cell and type a meaningful name into the field that shows the address (i.e. left of the formula bar).
Once you have done this, you can simply use this formula:
=IF(Income>Threshold,Threshold*StandardTaxRate+(Income-Threshold)*HighTaxRate,Income*StandardTaxRate)
Without the naming, the formula would be something like this:
=IF(B2>B1,B1*B7+(B2-B1)*B8,B2*B7)
Both formulas will calculate you the tax you'd need to pay. If you want it more explicit, I'd recommend a layout such as this:
The formulas would read:
C7: =IF(B2>B1,B1,B2)
C8: =IF(B2>B1,B2-B1,0)
D7: =B7*C7
D8: =B8*C8
HTH!

Resources