I'm trying to find a trend projection that compares between same week of 2 consecutive years and also from previous weeks of a particular year. What is the excel formula that helps me to do this?
I need to find the projected values for week 15 all the way to week 53 for This year, based on
The previous weeks of This year (Week 1- Week 14) as well as
The same week Last year (Week 15)
You could use the Trend function, setting Known X's to Last Year weeks 1 to 14 and Known Y's to This Year weeks 1 to 14.
Then set the New X's to the same week for last year and the function will use the Least Squares method to extrapolate for this year.
If you use absolute references (e.g. $A$1:$A$10) for the Known X's and Y's, and a relative reference for the New X's, then you can just copy/paste the formula from This Year week 15 down.
Keep in mind though that the further you get from the Known values, the less accurate the forecast becomes...
Are you familiar with the add-in solver or Data Analysis? Sometimes you have to unhide it by going to options>add-in>"Data Analysis" to use it but it does simple analyses. You will find several helpful tools for doing stats in "Data Analysis."
Related
I made a worksheet covering meal expenses for a set period of time (01-08-2020 until 31-08-2020.)
The company will pay up to 75kr, Monday-Friday.
The list covers expenses 7 days a week, If the amount is greater than 75 on Monday-Friday, I have to pay the extra expenses. (This I have figured out correctly). Saturday and Sunday I have to pay fully.
So my question is, how can I sum this and exclude Saturday and Sunday?
Attempt 1:
I tried this formula (Norwegian excel. Summerhvis = SUMIF. Lørdag = Saturday):
=SUMMERHVIS(B2:B32,"<>lørdag", G2:G32)
It seems to be partly correct however, I miss Sunday, how can I add Sunday to this equation?
Attempt 2:
I used this formula:
=SUMMERHVIS(B2:B32,B2:B6,G2:G32)
It gave the correct answer but the answer was layered in 5 rows. I then summed this in P8.
Where I want the answer is in G32. So in G32 I wrote =p8.
It must be an easier way of doing this?
You can use SUMPRODUCT and the WEEKDAY function:
=SUMPRODUCT((WEEKDAY(A2:A32,3)<5)*G2:G32)
According to the Microsoft function translator, this might be, in Norwegian:
=SUMMERPRODUKT((UKEDAG(A2:A32;3)<5)*G2:G32)
If you really want to use SUMIF and your text days, one way would be (in English):
=SUM(SUMIF(B2:B32,{"Monday";"Tuesday";"Wednesday";"Thursday";"Friday"},G2:G32)),
or, if your weekday days are in b4:b8:
=SUM(SUMIF(B2:B32,$B$4:$B$8,G2:G32))
but I'd advise against it as it would only work in the language of the text days of the week. Also, I note your days of the week don't seem to match up with what the days of the week were in the US. For example, here 1 Aug 2020 was a Saturday, so another possible cause for error (unless I am not understanding the dates correctly).
The above is the same as summing five separate SUMIF equations, each for a desired day of the week.
I am trying create a data set and finding it difficult to do it manually. I just wanted to know if there is way we can do it automatically in Excel.
I am trying to calculate the week difference with reference current year & calendar week.
Below is the formula used to calculate current year & calendar week
=YEAR(TODAY())&WEEKNUM(NOW()) Result would be 201840
I am expecting the weekdiff calculation as shown below. Any help in this regard would be deeply appreciated.
Thanks,
Ganesh
I would try to convert Year/Week to the overall week since 0 A.D. and then subtract. This may need some adjustment for Leap years.
=(YEAR(TODAY()) * 52) + WEEKNUM(NOW()) - (VALUE(LEFT(A2,4))* 52) - VALUE(RIGHT(A2,2))
This task seems easy enough yet I just can't figure a way of doing this without resorting to vba.
All I need is to know the number of hours an employee has used up on annual leave, based on a start and end date, and their hours of work.
To be more clear, this example shows one employees contracted hours from Monday to Sunday i.e. they work only Weds, Thurs, and Friday, for 7.5 hours each day.
Below shows the start and end date that the employee has chosen to take for annual leave. I need to calculate, based on their contracted hours, how much annual leave is used between the two dates. The answer would be 45 hours in this case.
Here's another approach - I've expanded the days between the start and end dates into an array then used the resulting day numbers to offset into the days of work range
=SUMPRODUCT(N(OFFSET(A3,0,WEEKDAY(ROW(INDIRECT(A6&":"&B6)),2)-1)))
If you had a list of holiday dates somewhere (say in I3:N3) you could exclude them as follows
=SUMPRODUCT(N(OFFSET(A3,0,WEEKDAY(ROW(INDIRECT(A6&":"&B6)),2)-1))*ISNA(MATCH(ROW(INDIRECT(A6&":"&B6)),I3:N3,0)))
- it is a bit long-winded but the only way I can think of at the moment.
Trying to show a rolling average of pieces produced from the last 5 work days.
Currently I am tracking all days Mon-Sun and taking the last 5 days.
Here is my current formula:
=SUMIFS(AL:AL,AK:AK,">="&TODAY()-5,AL:AL,"<="&TODAY())/5
With AL:AL being the date column and AK:AK being the pieces produced.
I Can't figure how to arrange the data and dates to get my last 5 days average.
This is not difficult with a helper column. As you indicated in the question, the arrangement is important. First, organize your data with the most recent values at the top. So AL1 will always hold today's date.
In AM1 enter:
=IF(OR(WEEKDAY(AL1)=1,WEEKDAY(AL1)=7),"",1)
In AM2 enter:
=IF(OR(WEEKDAY(AL2)=1,WEEKDAY(AL2)=7),"",IF(SUM(AM$1:AM1)=5,"",1))
(column AM defines the values to be averages)
Then in another cell enter:
=SUMPRODUCT(--(AM1:AM10=1)*(AK1:AK10))/5
Some beginners place the most recent data at the bottom of a column. This usually make it more difficult to analyze.
I think your SUMIFS() function is incorrectly reproduced. The first argument is the "sum_range," the data to be summed, so that should be the number of pieces.
Also, you are getting 6 days including today. If you want 5 days (and if you have data for today), then you have to subtract 4 instead of 5.
You can accomplish what you want with this formula, I think:
=SUMIFS(AK:AK,AL:AL,">="&WORKDAY(TODAY(),-4),AK:AK,"<="&TODAY())/5
If you don't actually have data for today, then subtract 5 instead of 4.
This also depends entirely on your not having any data for weekend days. If you have production data for weekend days, then the averages will be off (they will include extra days).
If you have data for both weekdays and weekend days, you will have to use something like #garysstudent suggested.
I have a pivot table with a lot of items currently grouped by date into quartiles and then months under that. My question is this, Our Financial year is not Jan to Jan so can I set up quartiles to reflect this? also our financial periods are not simply set months, they follow the months but are always full weeks around that. for example, P1 this year is 04/07/2015 - 07/08/2015. and Q1 would be 04/07/2015 - 02/09/2015.
Aside from manually grouping is there a way to set this up to happen automatically within Excel?
As stated by pnuts in the question's comments:
The most practical way may be to define the quarters (?) in your source data.
If you are at least using a Gregorian calendar, you may want to subtract an offset from your dates (i.e. # of days between 01-Jan-YYYY and DD-MMM-YYYY ... whereby the offset YYYY doesn't need to be the same as your date's YYYY). By this subtraction you get an "ordinal number" of the date within your business year.
[offset] =[FOY]-DATE(YEAR([FOY]),1,1)
So with your year starting on [FOY]=04-Jul-2015, you have an offset of of 184 days and a normalized date of
[date_normalized] = [current_date]-[offset]
So 04-Jul-2015 will be shrunk to 01-Jan-2015. Now the quarter easily calculates to
=CEILING(MONTH([date_normalized])/3,1)
... or =VALUE(MID("111222333444",MONTH([date_normalized]),1)) ... if you prefer
For your not-quite-months always being full weeks, I suggest to calculate a week number by
=MOD(CEILING(([date_normalized]+1)/7,1)-1,52)+1
to create a weekly reporting period 1 .. 52. With a further =CEILING(.../4,1) this can be converted to quasi-months having 4 weeks each.