How to Calculate relative week diff in excel. If I Have Year and week in one column - excel

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))

Related

Excel - Photovoltaic - converting hours

I have a problem that I would like to solve. I got data in excel, which are
in this form, basically I have number of hours from 0 to 8760 in a column in excel, which represent the whole year. And in another column I have "Power from PV" which corresponds to how much power does photovoltaic system produce in that specific hour. I would like to convert these hours to months, so I could make a graph of monthly production of power in a whole year. Is there some sensible way to do this in excel?
Thank you for any suggestions.
You need three things:
You need to know that 1 equals 1 day, so if you want to convert hours into date related information, you need to divide it by 24.
There is a function, called Date(), which gives the date, based on year, month and day, like =DATE(2022,1,1).
There is a function, called Month(), which gives the month number of a date.
So, in summary, you need something like:
=MONTH(DATE(2022,1,1) + A3 / 24)
Once you have this in a new helper column, you can start using the Subtotals basic Excel feature.

Calculate Hours depending on workdays, month, hours per day

I made a formula in excel, yet when trying it out, it responds with NAME?
=IF(MAAND(VANDAAG()) > MAAND(D1); (NETTO.WERKDAGEN(D1; D3)) * D5; D6)
My goal is to calculate how many Hours I still need This Month in Row 8.
depending on startdate(startdatum and current date (huidige datum) (not enddate(einddatum)) and how many work days there are between those dates times the hours.
Any ideas on how to solve this?
UPDATE
translations:
Maand = Month
Vandaag = Today
Netto.WerkDagen = NETWORKDAYS
Solved. I had to use ALS (dutch translation).....

Calculate annual leave between two dates in Excel

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.

Excel Trend Projection

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."

grouping in an excel pivot table with different year end and quartiles

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.

Resources