Gabriel Ideas Written by Gabriel

Calculate Week Number in Google Sheets

By Gabriel Aug 06, 2026
How to Number Rows in Google Sheets (Add Serial Numbers)
How to Number Rows in Google Sheets (Add Serial Numbers)

Calculating the week number in Google Sheets is a common task when working with dates. While Google Sheets doesn't have a built-in function to do this, we can use a combination of other functions to achieve the result. But first, let's understand what we mean by a 'week number'. Generally, a week is considered to start on a Monday and end on a Sunday. The first day of the year that is not a Thursday is considered week 1.

How to Number Rows in Google Sheets (Add Serial Numbers)
How to Number Rows in Google Sheets (Add Serial Numbers)

Now, let's dive into how we can calculate the week number using Google Sheets. We'll use a combination of the WEEK, DATE, and YEAR functions. Before proceeding, ensure your date column is formatted as a date type in Google Sheets.

Free Google Sheets Weekly Schedule Template & Calendars
Free Google Sheets Weekly Schedule Template & Calendars

Using the WEEK Function

The WEEK function returns the day of the week for a given date, but it doesn't directly provide the week number. To get the week number, we'll use it in combination with other functions.

Free Monthly Expense Tracker - Google Sheets Template
Free Monthly Expense Tracker - Google Sheets Template

Here's how you can use the WEEK function:

Syntax: =WEEK(date)

Google Sheets Weekly Schedule Template (Free Download)
Google Sheets Weekly Schedule Template (Free Download)

The date argument is the date for which you want to find the day of the week. The default format is a sorry number (1, 2, 3...).

Getting the Week Number

Now, let's use the WEEK function along with DATE and YEAR functions to get the week number. The formula will subtract the starting day of the week (usually a Monday) from the date, and then divide by 7. The integer part of the result is the week number.

Payroll Calculator Google Sheets, Employee Paycheck Template, Gross to Net Pay Stub Spreadsheet, Small Business Payroll, Wage Calculator
Payroll Calculator Google Sheets, Employee Paycheck Template, Gross to Net Pay Stub Spreadsheet, Small Business Payroll, Wage Calculator

Formula: =INT((DATE(YEAR(B1), 1, 1) - B1 + B1 - DATE(YEAR(B1), 1, 0))/7)

In this formula, B1 is the date cell for which you want to find the week number. The INT function is used to get the integer part of the division result.

Adjusting for Leap Years

two computer monitors sitting on top of a desk next to each other with the words google sheets weekly planner
two computer monitors sitting on top of a desk next to each other with the words google sheets weekly planner

In the above formula, we're assuming that the first day of the year is a Monday, which may not be the case due to leap years. To adjust for this, we can use the TEXT function to get the day of the week for the first day of the year and then adjust the formula accordingly.

Adjusted Formula: =IF(TEXT(DATE(YEAR(B1), 1, 1),"DDDD")="Monday",INT((DATE(YEAR(B1), 1, 1) - B1 + B1 - DATE(YEAR(B1), 1, 0))/7),INT((DATE(YEAR(B1), 1, 2) - B1 + B1 - DATE(YEAR(B1), 1, 0))/7))

Google Sheets Calendar Templates | Firstprintable
Google Sheets Calendar Templates | Firstprintable
Freelancer Pricing Calculator Spreadsheet | Hourly, Day, Week Rates (Excel, Google Sheets)
Freelancer Pricing Calculator Spreadsheet | Hourly, Day, Week Rates (Excel, Google Sheets)
Work Hours Tracker & Payroll Spreadsheet | Timesheet Template Excel Google Sheets | Employee Hours Calculator | Overtime and Pay Tracker
Work Hours Tracker & Payroll Spreadsheet | Timesheet Template Excel Google Sheets | Employee Hours Calculator | Overtime and Pay Tracker
Weekly Staff Schedule Timesheet Template Google Sheets Text Fillable / Text Editable Online Spreadsheet With Automated Hours Totals
Weekly Staff Schedule Timesheet Template Google Sheets Text Fillable / Text Editable Online Spreadsheet With Automated Hours Totals
How to use an Excel spreadsheet in Google Sheets (access from any device, anytime) or Numbers for Ma
How to use an Excel spreadsheet in Google Sheets (access from any device, anytime) or Numbers for Ma

This formula checks whether the first day of the year is a Monday. If it's not, it adjusts the formula to start from the second day of the year.

Using Google Apps Script

Alternatively, you can use Google Apps Script to create a custom function that calculates the week number. This method is more straightforward and doesn't require understanding the internally used date values in Google Sheets.

Here's a basic Google Apps Script function that calculates the week number:

Function: function GET_WEEK(date) {

var dt = new Date(date);

var year = dt.getYear();

var firstDay = new Date(year, 0, 1); // get first day of the year

var days = Math.round(((dt - firstDay) / 1000 / 60 / 60 / 24) + 1); // count days since start of the year

var week = Math.ceil(days / 7); // find week number

return "Week " + week + " of " + year;

}

You can use this function in your Google Sheets cells like this: =GET_WEEK(B1)

In closing, calculating the week number in Google Sheets can be achieved using a combination of built-in functions or by using Google Apps Script. The method you choose will depend on your specific needs and comfort level with these tools. Happy calculating!"