MS Excel - Date Analysis - excel

I am using MS Excel to do my data analysis. I have two dates. One date is my forecast date. For example, i am forecasting the stock to arrive - 06/09/2009. Another date is the actual stock arrival date - 06/10/2009.
I know that the date difference is 1 day. What I would like to calculate is the accuracy of my forecasting. If forecast date is same as actual arrival date then it should be 100%.
I am trying to find the function in excel to do this calculation. Is there any?
Thanks.

If you are just working with dates and the accuracy is days then you can just subtract one day from the other.
For example if you had one column with expected date(in A1), one with actual date (in B1) then the next column could be difference (in C1).
=SUM(b1 - a1)
at the bottom of the C column, supposing you had 4 rows you would just do an average of the days
=AVERAGE(C1:C4)
that would give you the accuracy of your preditions.
Hope that helps

Generally
% accuracy = 100% - %abs(error) = 100% * [1 - abs(forecast - actual) / actual ]
Since the values of dates are not well-defined, you could normalize them by subtracting some initial date. For the above formula, this initial date will cancel out in the numerator, so you could just use:
100% * [1 - abs(forecast - actual) / (actual - initial)].
In Excel, the formula formatted for % would be: =1-ABS(C2-B2)/(B2-A2)
Using your example:
initial actual arrival forecast arrival % accuracy
01/01/09 06/10/09 06/09/09 99.38%

Related

Calculate working days and working time in Power BI

I'm trying to calculate working time, excluding weekends and holidays.
This formula works in Excel:
=(NETWORKDAYS(B2,C2,S$2:S$12)-1)*(10/24)+
IF(NETWORKDAYS(C2,C2,S$2:S$12),MEDIAN(MOD(C2,1),"18:00","08:00"),"18:00")
-MEDIAN(NETWORKDAYS(B2,B2,S$2:S$12)*MOD(B2,1),"18:00","08:00")
This is what I have in PowerBI so far:
Time =
(
NETWORKDAYS('Data'[CreatedTime],'Data'[CommentTime],1,Holidays)-1)*(10/24)
+
IF(NETWORKDAYS('Data'[CommentTime],'Data'[CommentTime],1,Holidays),
MEDIAN(MOD('Data'[CommentTime],1),"18:00","08:00"),"18:00")
-
MEDIAN(NETWORKDAYS('Data'[CreatedTime],'Data'[CreatedTime],1,Holidays)
*
MOD('Data'[CreatedTime],1),"18:00","08:00"
)
The CreatedTime and CommentTime are as follows:
The only time that should be counted is between 08:00am and 18:00pm on a weekday and not including any holidays.
The holidays table contains a list of dates to be exlcuded.
So for the example above, the 1st and 2nd of January should be excluded (1st was a Sunday, 2nd was in the holidays table). Meaning the time elapsed should be counted from 03/01/2023 08:00 - 18:00 and 04/01/2023 08:00 - 17:40.
So the total hours should be 19hrs 40mins. I can calculate this in Excel however the MOD and MEDIAN functions are not the same in PowerBI.
The error in PowerBI is:
Too many arguments were passed to the MEDIAN function. The maximum
argument count for the function is 1.
Is there any way to update my formula in PowerBI to work?
Thanks for any help,
Mark

Is there an excel function calculate future value of constant payments at variable interest rate

Known that:
FV function: future value of constant payments at constant interest rate
FVschedule function: future value of no payments at variable compound interest
My task is to calculate the future value of constant payments at variable interest rate.
Say the principal is 10,000. Annual rate is 5%. Tenor with 2 monthly period starting at Jan. The periodic payment in arrear is 1,300.
Interest for Jan is calculated as (10,000 * 5% * 31 / 360 = 43) The principal repaid is (1,300 - 43) = 1,257.
Interest for Feb is calculated as ((10,000-1,257) * 5% * 28 / 360 = 34) The principal repaid is (1,300 - 34) = 1,266.
The future value (aka balloon payment) would be 10,000 - 1,257 - 1,266 = 7,477.
So I would like to know if there is a formula could calculate 7,477 by inputting the above data, rather than calculate the whole repayment schedule each time.
Thank you for your help.
I do not think there is such a function. There is however a way how to approach this in an excel-like manner. As you correctly anticipated, excel is just the right tool for that, as it can re-calculate the whole repayment schedule each time, many times a second.
First, collect the parameters like that to the columns K & L
Second, create a table with the schedule. First column label Date and it will be the date of the last days of the months. Lets assume that you start with the first day of the current month, so the first row will be
=EOMONTH($L$6;[#Period])
where $L$6 is the cell with start date. The next column [#Period] has just the count of the schedule periods, i.e. 1,2,3,4... as many as you like. You can use formula
=ROW()-1
for that.
Next column label Days with formula
=DAY([#Date])
That is for calculating the effective interest rate.
Next column label Aliquote with formula
=[#Days]/$L$2
with the effective interest rate for the current period (month).
Now it gets interesting. The next columns label B/O for the beggining of month outstanding amount
=$L$4-SUM(G$1:G1)
and copy/past for the next rows. It calculates the outstanding amount based on the principal parameter stored in L4 by subtracting the sum of Amortizations in the column G we create next.
Next column is then labeled interest
=$L$3*[#Aliquote]*[#[B/O]]
where L3 refers the parameter with the nominal interest rate.
and the next column is labeled Amortization
=$L$5-[#Interest]
calculated from the periodic arrears stored in L5.
The last column is labeled C/O for the close of the month outstanding amount.
=[#[B/O]]-[#Amortization]
If you have done it correctly, it shows you the C/O values running towards zero and then of course negative in the 8th period onward. You can change the parameters to get adjust it for the scenario you need.

How to find a trend/forecast result 14 days from today

I have looked into the Forcast & Trend formula but I cannot figure it out for the life of me.
I want to work out the trend 14 days from now.
I have a set of data:
A1 - A30 with dates
B1 - B30 with daily ticket count for the business.
I would like to make a result in another cell that would predict what the estimated total ticket count would be 14 days from now. I do not need all 14 days, just the 14th day.
If I was to try show you what the formula looks like in my head it would be:
=trend/forecast(B1:B30,14)
or
=Predict(B1:B30)*14
Unfortunately it is not as easy as that. How can I do this?
I think you want to use the Forecast function. The inputs you have do not match the correct format though.
FORECAST( x, known y's, known x's) where...
x = the series (or date) you want to forecast
known y's = historical tickets per day
known x's = historical dates (or series)
The below example allows you to forecast tickets for any date (Forecasted Date) given the historical information (table on left). If your table is not formatted with actual dates, just create a series (first day = 1, second day = 2, etc.) and forecast that way.
Given the historical data, the forecasted tickets for Aug 28th (14 days after last known value) are 16.7

Find a growth rate that creates values adding to a determined total

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.

calculate cost from hours worked

I have two columns in my spreadsheet.
A B
Total Hours Worked Total Cost
A is formatted as a duration/time, i.e. 01:34:20 and is the total elapsed time it's taken to complete a task
B should be a formula of some sort that calculates the cost. Right now I have the function A2*25 but this results in B2 being too little.
What do I need to do to correct the formula so the total cost is correct?
You can use this as B2 -
=(HOUR(A2) + MINUTE(A2) / 60 + SECOND(A2) / 3600)*25
Excel stores durations as fractions of days.
You just need to multiply the duration by 24 to have the number of hours worked and you get the correct result.
=A2*25*24

Resources