The start date is entered in cell B5.
The number of dates to create (n) is entered in cell B8.
If either of these two values are changed, a new list of weekend dates should be generated.
WORKDAY.INTL will automatically exclude weekends and can optionally exclude dates that are holidays.
In this code, a 1 indicates a weekend and a 0 indicates a workday.
Each digit in the code represents a day of the week.
The first digit represents Monday and the last digit represents Sunday.
non-working days) the next working day gets pushed out.
We use this behavior to list Saturdays or Sundays only in the formulas explained below.
We do this because we want to force WORKDAY.INTL to evaluate the start date as well.
non-working days), which are excluded by WORKDAY.INTL.
There are 7 characters in the string, one for each day of the week starting on Monday.
A “1” means the day is a non-working day (i.e.
a “weekend”) and should be excluded.
A “0” means the dayis a working dayand should be allowed.
For more details on WORKDAY.INTL, seeHow to use the WORKDAY.INTL function.
Otherwise, the next Saturday or Sunday will be returned.
The result is that WORKDAY.INTL will only return dates that are a Saturday or Sunday.
In addition, you could combine WORKDAY.INTL with SEQUENCE and theFILTER functionto list weekendsbetweentwo given dates.
By default, WEEKDAY returns 1 for Sunday and 7 for Saturday, but this is configurable.
you could use the WEEKDAY function inside other formulas to check the day of week.
SEQUENCE Function
The Excel SEQUENCE function generates a list of sequential numbers in an array.
The array can be one dimensional, or two-dimensional, determined byrowsandcolumnsarguments.