Highlight Weekends in Google Sheets

Published on

You may want to highlight weekends in a calendar, in a column in a table, or in the taskbar area of a Gantt chart in Google Sheets. How do you do that?

Different techniques are needed for each scenario. It’s easy if you want to highlight in a column or row. However, in a timescale or calendar, you may want to match weekends and highlight the entire column.

Before we delve into examples that illustrate these different scenarios and how to handle them, please take a moment to look at the table below. It contains numbers representing days of the week.

Day of the WeekWeekday Number
Sunday1
Monday2
Tuesday3
Wednesday4
Thursday5
Friday6
Saturday7

We may need to use these numbers in my formula to highlight specific weekends.

Highlight Weekends in a Column

In the following example, I have sales dates in column A and sales quantities in column B where A1 and B1 contain the field labels.

We need to highlight A2:A for weekends Saturday and Sunday.

Highlight Rule:

=AND(OR(WEEKDAY(A2)=1, WEEKDAY(A2)=7), ISDATE(A2))
Highlighted weekends in a column in Google Sheets

How to apply this rule in the range A2:A?

  • Click on Format > Conditional formatting
  • Enter A2:A under “Apply to range.”
  • Under “Format rules,” select “Custom formula is,” and enter the above formula in the field below that.
  • Under the “Formatting style,” pick/apply your choice and click “Done.”
Applying Conditional Format Rules: Range (A2:A) and Custom Formula in Google Sheets

Follow-Up Questions:

  1. What changes should I make to highlight specific weekends such as Friday and Saturday in columns?

In the formula, replace =1 with =6 (representing Friday, you can refer to the table above).

=AND(OR(WEEKDAY(A2)=6, WEEKDAY(A2)=7), ISDATE(A2))
  1. If you want to highlight only a single weekend day such as Sunday only?

You do not need the OR logical test and also require only one WEEKDAY test.

=AND(WEEKDAY(A2)=1), ISDATE(A2))
  1. How to highlight the entire rows matching weekends in Google Sheets?

There are two changes required.

  • In the “Apply to range,” replace A2:A with the range you want to highlight, for example, A2:B.
  • In the formula, place a dollar sign in front of the column letter in cell references. So A2 will become $A2. Please see the below formula which highlights Saturday and Sunday weekends, but the entire row in the selected range.
=AND(OR(WEEKDAY($A2)=1, WEEKDAY($A2)=7), ISDATE($A2))
Conditional Format Rule for a Row Range in Google Sheets

To learn the formula, you may check out: “Combined Use of IF, AND, and OR Logical Functions in Google Sheets.”

Highlight Weekends in a Calendar

You can find plenty of Google Sheets calendar templates online, and we have our own too.

Yearly Calendar

Highlighting weekends in a calendar is challenging, as each calendar may have its own formula approaches and layout settings.

Our formula (conditional format rule) will work if the days within the calendar are actual dates. You can use the ISDATE function to test whether a cell value is a date.

Another criterion is a month name in any cell in the sheet. If your template satisfies this, you can use the same formula as above, with one addition.

Example:

=AND(OR(WEEKDAY(C4)=1, WEEKDAY(C4)=7), ISDATE(C4), MONTH(C4)=MONTH($H$1&1))
Highlighted weekends in a calendar in Google Sheets

In the above example, the “Apply to range” (highlight range) is C4:I22. So, in the formula, you should use cell C4 as a reference.

The other change in the formula is the use of MONTH(C4)=MONTH($H$1&1)

It checks whether the month number of the dates in the calendar matches the month number in cell H1 (MONTH($H$1&1) converts the month text in cell H1 to the month number).

Related: Formula to Convert Month Name in Text to Month Number in Google Sheets.

Why is this necessary?

Most calendars may have dates from the previous month in the first row (week), which are hidden, and dates from the next month in the last row (week), which are also hidden.

We don’t want the formula to highlight those cells.

Notes:

A calendar may already have several formatting. You may need to drag and drop the rules according to your priority. To do that, hover your mouse pointer over the rule in question, and click on the vertical dots on the left, and drag.

Moving rules by drag and drop in Google Sheets

To highlight specific weekends in a Google Sheets calendar, please scroll up and see the instructions under the “Follow-up questions.”

Highlight Weekends in a Gantt Chart Timescale

To highlight weekends in the taskbar area of a Gantt chart, you may need to match weekends in the timescale.

Here also, the conditional format rule will work if the values in the timescale are dates. You may check that using the ISDATE function.

Gantt Chart

Example:

Highlighted weekends in a Gantt chart in Google Sheets

In this example, I’ve used the following formula to highlight weekends in the taskbar area. The “Apply to range” is E4:Z20.

=AND(OR(WEEKDAY(E$3)=1, WEEKDAY(E$3)=7), ISDATE(E$3))

Note: To highlight specific weekends in a Gantt chart, please scroll up and see the instructions under the “Follow-up questions.”

Resources

With the above examples, I hope you can learn to highlight weekends in specific cells, entire columns, and rows in Google Sheets. Here are some related resources to further deepen your conditional formatting expertise.

  1. Highlighting Today and N Cells Below in Google Sheets Calendar
  2. How to Highlight Next N Working Days in Google Sheets
  3. Highlight Earliest Events Based on Date Column in Google Sheets
  4. Date-Related Conditional Formatting Rules in Google Sheets
  5. How to Highlight Cells Based on Expiry Date in Google Sheets
  6. How to Highlight Recurring Events or Payment Dates in Google Sheets

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Lookup Values Under Categories in Excel and Google Sheets

We can use a combination of XLOOKUP and VLOOKUP in both Excel and Google...

Extract Items Under a Category from the Same Column in Excel

In Excel, you can use a combination of the XLOOKUP and DROP functions to...

How to Create a Searchable Table in Excel Using the FILTER Function

Finding specific records, or rows containing the required information, is straightforward in Excel using...

Time Sequences in Excel by Minute, Hour, or Second Increments

Creating time sequences, whether by hour, minute, or second increments in Excel, can be...

More like this

XMATCH Row by Row: Finding Values Across a Range in Google Sheets

Using the BYROW function with XMATCH in Google Sheets allows us to match values...

Limit Formula Expansion to a Specific Row in Google Sheets

In this tutorial, I’ll explain how to limit the expansion of an array formula...

3-D Referencing Structured Data Tables in Google Sheets

When you have several tables within a single sheet—not across multiple sheets in a...

2 COMMENTS

  1. Hello Mr. Prashanth,

    I found your blog very useful, with clear explanations. But I have a question: what if I have a duty schedule for my staff? In rows B1:ND1 are dates from January 1st until December 31st. From A2:A20 is my list of staff. I want to apply conditional formatting so that if certain dates are included in the list of national holidays, then the column where the date is located will have a certain color. Thank you.

    • You haven’t mentioned where the list of holidays is located. I assume the date range B1:ND1 is in Sheet1, and the holidays are listed in A1:A in Sheet2.

      If so, select B1:ND20 in Sheet1. Go to Conditional Formatting and copy-paste the following rule under Custom Formula:

      =XMATCH(B$1, INDIRECT("Shee2!A1:A"))

      I hope that helps.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.