简体   繁体   中英

How to get the number of days of a specific calendar week belonging to a particular month using Google Sheets?

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

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

-

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM