excel date from week number and year - excel

I have the following table in Excel that has year number and week number:
Year Week
----- ------
2015 33
2014 41
2016 40
How can I get a 3rd column that has the date of the corresponding Friday for each row? So, week 33 of 2015 should return: Friday, August 14, 2015.
I have tried to use the date function, weeknum function, but cannot get any consistent results.

If you are using ISO week numbers then this formula will give the date you want
=DATE(A2,1,B2*7+2)-WEEKDAY(DATE(A2,1,3))
where year is in A2 and week number in B2
Format in required date format
With ISO week numbers week 1 always starts on the first Monday on or after 29th December

Assuming the week starts on Sunday and non-ISO week-numbering, the date of the Sunday of Week#1 of any year is given by:
=CHOOSE(WEEKDAY(DATE(A2,1,1)),DATE(A2,1,1),DATE(A2,1,1)-1,DATE(A2,1,1)-2,DATE(A2,1,1)-3,DATE(A2,1,1)-4,DATE(A2,1,1)-5,DATE(A2,1,1)-6)
Then add 5 to move to Friday. Then add:
(B2-1)*7
to advance to the proper week:
=CHOOSE(WEEKDAY(DATE(A2,1,1)),DATE(A2,1,1),DATE(A2,1,1)-1,DATE(A2,1,1)-2,DATE(A2,1,1)-3,DATE(A2,1,1)-4,DATE(A2,1,1)-5,DATE(A2,1,1)-6)+5+(B2-1)*7

Related

How to get week number based on Two dates based Conditions in Excel

I have a DateTime column in Excel in which data is sorted in ascending order based on DateTime conditions from 15th June to say 1st November ;
I want to print Week Number from 1st to Nth Week based on date condition; Week criteria are like first seven days i.e 15th June to 21st June is Week1, 22nd Jun-28th Jun is Week2, 29th June - 5th June is Week3 and so on.
How Can I do this?
Column1
06/15/2021 8:00
06/15/2021 10:00
:
:
11/01/2021 20:44
11/01/2021 20:46
Let's assume your list of dates is in A2:A.
Place the following formula in cell B2 of an otherwise empty range B2:B...
=ArrayFormula(IF(A2:A="",,ROUNDDOWN((INT(A2:A)-INT(A2))/7)+1))
INT is just removing the times from date-times.
The rest is really more of a math/logic question than a formula question.

How to identify the week within a month with criteria in Excel

How can I calculate the week of the month? I understand that with the WEEKNUM function and ISOWEEKNUM function I can get the week of the year but this is not what I am looking for.
A week has only 4 weeks so the function must look at a date written in a cell and only identify a week 1-4
There is one set of criteria that I found especially difficult to add:
Week 1 for July 2019 begins on June 30th - Ends on July 27th
Week 1 for August begins on July 28th - Ends on August 24th
How can something like this added to an excel function?
This formula calculates a week in month (assuming your have a date at A1 cell)
=WEEKNUM(A1,2)–WEEKNUM(DATE(YEAR(A1),MONTH(A1),1),2)+1
Use WEEKNUM to get the week of year.
Use WEEKNUM to from the date of the first day of the month the date falls within.
Subtract the two week numbers (add 1 in case result is 0 - first week in month).
Sample:
8/21/2019
=WEEKNUM(A1,2) -> 34
WEEKNUM(DATE(YEAR(A1),MONTH(A1),1),2) -> 31
34-31 = 3 -> third week of August

With having two dates now i month wise days calculation required

I have two dates. Now my aim is to calculate the number of days, month wise for n number of rows
Input:
start date 22/01/2019
finish date 21/06/2019
Output & result should be
January February March April May June
9 28 31 30 31 21
for many rows.
Excel or VBA Excel formula both will be great,
Thanks in advance....
Here is a screenshot of my Excel table:
https://ibb.co/tC38jzs
Here is a simple solution if your Active Month column entries are not the names of the month, but the last day.
31.01.2019 28.02.2019 ...
For the January column you can then use
=MAX(0, MIN($AV14-$AT14, AY$13-$AV14))
and for the other months you have to subtract the days aggregated since January. Here for February:
=MAX(0, MIN($AV14-$AT14, AZ$13-$AV14) - SUM($AY14:AY14))
Expand the last formula from Feb to Dec.

How to return day number of every moday

A big dilema for me, I have class with students on monday and friday, i cannot figure out with excel how to return the day number of monday or friday on this month or next month
eg. 19 sept is monday this week and next week is 26 september
I want to return next month that monday will be 3 then 10, 17
I tried a silly formula like =(19+7) return 26 but then show 33 but a month dont have 33 days.
Hope you guys understand me and maybe help me, thanks
Put the date 2016-09-19 in A1.
Create a custom format of d for that cell.
Then in A2 put this formula =A1+7.
Ensure that the same format is in that cell.
Then copy down.

Convert Week NUM to the Week Beg date in Excel

I have the below formula to give me the week ending of a week num, how can I get the date of the week beginning from this?
=DATE(YEAR(TODAY()),1,1)+(7-WEEKDAY(DATE(YEAR(TODAY()),1,1))-6)+(A2*7)
when A2 is 10 for example and B2 is the date.
thanks
Are your weeks ISO weeks? If so then that formula might work for this year but it will be wrong in 2016 because it will give the end date of week 1 as 3rd Jan when it should be 10th Jan
I would use this formula for start date (a Monday)
=DATE(YEAR(TODAY()),1,A2*7-2)-WEEKDAY(DATE(YEAR(TODAY()),1,3))
then just add 6 for the end date
=DATE(YEAR(TODAY()),1,A2*7+4)-WEEKDAY(DATE(YEAR(TODAY()),1,3))

Resources