How to return day number of every moday - excel

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.

Related

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.

excel date from week number and year

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

Excel : Weeknumber within month with criteria

I'm trying to make a formule to calculate the weeknumber within a week but with certain criteria. The week always starts on a monday. But if the thursday of that week is in the next month, then that weeknumber is part of the next month.
[enter image description here][2]
Right now I have the following formula:
=INTEGER((6+DAY(A4+1-WEEKDAY(A4-1)))/7) where A4 is the date.
This already calculates the weeknumber within the month, but not with the criteria of thursday. An extra added criteria is that the weeknumber should start from 6am on monday instead of at midnight. But that I can solve with an extra column to check for that.
Thanks in advance!
Consider working out the week number from the previous week number:
If it is Monday then
If following Thursday goes into the next month, reset to 1
Else increase by 1
Else use same value
So starting with a 1 in E4
=IF(WEEKDAY(A5)=2,IF(MONTH(A5+3)>MONTH(A5-4),1,E4+1),E4)
entered in E5 and copied down.
EDIT
Above works for 2017 but would need slight change to work for 2018 and onwards because month decreases from 12 to 1 across year boundary:
=IF(WEEKDAY(A5)=2,IF(MONTH(A5+3)<>MONTH(A5-4),1,E4+1),E4)
I cant upload a workbook but here is a solution:
Row 2 is headers
Row 3 is empty
B4 going down is the date(01/01/2017 up to 31/12/2017)
C4 =WEEKDAY(B4,2)
D4 =VLOOKUP($C4,$L$3:$M$9,2,0)
E4 =MONTH(B4)
F4 to J4 are empty
F5 =IF(C5=1,F4+1,F4)
G5 =IF(C5=4,11,0)
H5 =IF(MAX(E5:E11)-MIN(E5:E11)<>0,22,0)
I5 =IF(AND(C5=4,SUM(G5:G11)+SUM(H5:H11)>22),I4+1,0)
J5 =IF(H6-H5<0,1,IF(H6=22,J5,IF(OR(C6=1,I6<>0),J5+1,J5)))
L3 to M9 are vlookups
1 Monday
2 Tuesday
3 Wednesday
4 Thursday
5 Friday
6 Saturday
7 Sunday
Does that work ok for you?
In my experience most of those week number questions can be answered with some variation of your original formula - in this case this version should cater for Monday week start with the Thursday determining the month
=INT((6+DAY(B4+4-WEEKDAY(B4-1)))/7)
That works for a date in A4 but assuming you have a date/time in A4 and the week doesn't start until 06:00 on Monday then you can tweak that as follows:
=INT((6+DAY(B4+3.75-WEEKDAY(B4-1.25)))/7)

Excel Formula: Current 12 months

I'm looking for a formula in excel that will give me a current 12 month table. For example this month is April. I want a formula that gives me 12 months back from April in the exact format as show in the table below. For next month it will be May, and 12 months back from may without having to adjust any dates.
Month
5/1/2015
6/1/2015
8/1/2015
9/1/2015
10/1/2015
11/1/2015
12/1/2015
1/1/2016
2/1/2016
3/1/2016
4/1/2016
Thank you
Try this and copy down 11 rows
=EDATE((TODAY()-DAY(TODAY())+1),ROW(A1)-12)
If you number the months in column b starting from b2 =0 to b13=11
And row 1 has headers
A2 formula =EOMONTH(today(),b2-1)+1
A3 formula = EOMONTH(today(),b3-1)+1
Etc.
EOMONTH will give you the last day of any month. So if we start with today() it will give you the last day of the current month, but if we count back 1 month (b2-1). It will give you the last day of last month. So we add 1 day to it and you get the first day of each month.
Hope this helps :)

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