Home > Net >  How to get the number of days of a specific calendar week belonging to a particular month using Goog
How to get the number of days of a specific calendar week belonging to a particular month using Goog

Time:12-22

I want to get the exact number of days of a specific calender week but only this one which matches a specific month.

For example: Calender week 48 has 3 days in November and 4 days in December. I only want to get the number of days of December.

I tried this formula but I only get the number of days of the whole week. I dont know how to continue.

=WEEKDAY(12/28/2022 ,2) - WEEKDAY(12/04/22 ,2) 1

CodePudding user response:

to get the dates for a specific week_number and month

=LAMBDA(aix,FILTER(aix,WEEKNUM(aix,2)=49,MONTH(aix)=12))(SEQUENCE(365,1,DATE(2022,1,1),1))

to get the count of it, wrap it in COUNTA()

=COUNTA(LAMBDA(aix,IFERROR(FILTER(aix,WEEKNUM(aix,2)=49,MONTH(aix)=12)))(SEQUENCE(365,1,DATE(2022,1,1),1)))

-

enter image description here

  • Related