16.7 Generate a time sequence with the same time interval - Sunday

 

To generate a sequence of Sundays from 2020-02-01 to 2020-04-30, like this:

imagepng

Script:

A
1 =date(“2020-02-01”)
2 =pdate@w(A1)
3 =if(A2<A1,A2+7,A2)
4 =periods@x(A3,“2020-04-30”,7)

A1: The start date 2020-02-01
A2: Find the Sunday of the week of the start date, the option @w means to get the Sunday of the week of the specified date
A3: If A2 is earlier than the start date, let A3 be A2+7, i.e., the next Sunday, otherwise let A3 be A2
A4: Generate a date sequence with a 7-day interval between the first Sunday (A3) and the end date (2020-04-30), that is, a sequence of consecutive Sundays within the time period of specifying the start and end times. The option @x means that the backend date 2020-04-30 is not included.


esProc Desktop and Excel Processing
16.6 Generate a time sequence with the same time interval – one month
16.8 The first Friday of a certain month/quarter/year