@dateceil |

Syntax: @dateceil(d1, u[, step])

Argument 1: date number, d1

Argument 2: time unit, u

Argument 3: step, step

Return: date number

Finds the last possible date number defined by d1 in the regular frequency defined by the given time unit u and optional step step. The frequency is defined relative to the basedate of Midnight, January 2001.

The valid time unit string values are: “A” or “Y” (annual), “S” (semi-annual), “Q” (quarters), “MM” (months), “WW” (weeks), “DD” (days), “B” (business days), “HH” (hours), “MI” (minutes), “SS” (seconds).

If step is omitted, the frequency will use a step of 1 so that by default, @dateceil will find the end of the period defined by the time unit.

Example:

Suppose that date1 is 730110.8 (7 PM, December 23, 1999). Then the @dateceil values

@dateceil(730110.8, "dd")

@dateceil(730110.8, "mm")

yield 730110.999 (11:59:59.999... PM, December 23, 1999) and 730118.999 (11:59:59.999... PM, December 31, 1999), the date numbers for the end of the day and month associated with 730110.8, respectively.

@dateceil(730110.8, "hh", 3)

@dateceil(730110.8, "hh", 6)

return 730110.874999 (8:59:59.999... PM, December 23, 1999), and 730110.999 (11:59:59.999... PM, December 23, 1999), which are the last date numbers for 3 and 6 hour regular frequencies anchored at Midnight, January 1, 2001.