Tabular IQ
Back to Function Index

WEEK()

Overview

WEEK() calculates the week number of the year for a given date. The function returns an integer between 1 and 52 (or 53 in some years), representing which week of the year contains the specified date. If a null date is provided, WEEK() returns zero. This function is useful for date-based analysis, reporting, and scheduling.

Function Format

WEEK(date)

Return Value

WEEK() returns an integer

Examples


// Basic week calculation
WEEK(DATE("07/04/2007")) = 27

// End of year week
WEEK(DATE(2007, 12, 25)) = 52

// Additional examples
WEEK(DATE(2024, 1, 1)) = 1      // First week of year
WEEK(DATE(2024, 12, 31)) = 53   // Last week of year
WEEK(DATE(2024, 6, 15)) = 24    // Middle of year
WEEK(NULL) = 0                  // Null date handling

Notes

  • Important behaviors:
    • Returns week number (1-52/53)
    • Returns 0 for null dates
    • Considers full calendar weeks
    • Handles leap years correctly
    • Works with various date formats
  • Common use cases include:
    • Weekly reporting
    • Date-based analysis
    • Project scheduling
    • Financial period tracking
    • Calendar management
  • The function is useful for:
    • Week-based grouping
    • Time period analysis
    • Schedule planning
    • Date calculations
  • Important considerations:
    • Week 1 starts at beginning of year
    • Some years have 53 weeks
    • Consistent with calendar weeks
    • Works with DATE() function

See Also