Automatic Calendar

GhostWatch

New Member
Joined
May 26, 2023
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Im making an automatics calendar where the months are separate and weeks are Monday to Sunday.
I use this to find the weeknumber within the month and it resets for each month.

=ISOWEEKNUM(A364)-ISOWEEKNUM(DATE(YEAR(A364),MONTH(A364),1))+1

However for the end of December it no longer works and gives an error.
Each month is set out as below but as you can see the dates do not carry on until the month end.

1685098195217.png

1685098350612.png







If i use

=WEEKNUM(A364,2)-WEEKNUM(DATE(YEAR(A364),MONTH(A364),1),1)+1


then if the week doesn't start on a Sunday, then it leaves an empty row in the calendar under the days.
How would i go about fixing this?
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hi, welcome to the forum!

If I've understood correctly, you could try with this:
Excel Formula:
=INT((A364-WORKDAY.INTL(DATE(YEAR(A364),MONTH(A364),2),-1,"0111111"))/7)+1
 
Upvote 1
Solution

Forum statistics

Threads
1,215,096
Messages
6,123,074
Members
449,093
Latest member
ripvw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top