Home > other >  List dates of specific month and exclude Friday and Saturday
List dates of specific month and exclude Friday and Saturday

Time:11-19

I could list the dates of a specific month based on the date in cell A1 using the following formula

=TRANSPOSE(IFERROR(DATEVALUE(DAY(ROW(1:30))&"-"&MONTH($A$1)&"-"&YEAR($A$1)),""))

Is it possible using formulas to list the dates but to exclude Friday and Saturday from the list generated?

CodePudding user response:

Use WORKDAY.INTL which allows the exclusion of weekdays:

=LET(dy,WORKDAY.INTL(A1-1,SEQUENCE(31),"0000110"),IF(dy>EOMONTH(A1,0),"",dy))

enter image description here

If you want it horizontal:

=LET(dy,WORKDAY.INTL(A1-1,SEQUENCE(,31),"0000110"),IF(dy>EOMONTH(A1,0),"",dy))

Without the dynamic array formula, put this in the first column and drag over:

=IF(WORKDAY.INTL(A1-1,COLUMN(A1),"0000110")>EOMONTH(A1,0),"",WORKDAY.INTL(A1-1,COLUMN(A1),"0000110"))
  • Related