Beginning PivotTables in Excel 2007 will introduce you to the exciting new pivot table features in Excel 2007. Create quick summaries and pivot charts, add impact with traffic light icons, design calculated fields, group dates and numbers.

Categories

Archives

Learn how to create Excel dashboards.

Highlight Weekend Dates In Excel

Yes, the weekend is over, but another one is just five days away! To make it easier to keep track of weekends in Excel, you can use conditional formatting to highlight the rows where the date is a Saturday or Sunday.

For example, our Excel file has a list of product sales for the first half of July. We’d like to highlight the dates and sales numbers that fall on a weekend.

Add Conditional Formatting

To highlight the weekend sales:

  1. Select all the cells where conditional formatting should be applied, cells H2:J16 in this example. Cell H2 is the active cell in the selection.ProdSalesSel
  2. On the Ribbon, click the Home tab, then click Conditional Formatting.
  3. Click New Rule, to open the New Formatting Rule dialog box
  4. In the Select a Rule Type list, click Use a formula to determine which cells to format.
  5. In the Formula box, enter a formula to check the weekday of the date in row 2, which is the active row on the worksheet:
    =WEEKDAY($H2,2)>5

    CondFormatWeekend

  6. Click the Format button, and select a Fill colour, or other formatting options, then click OK.
  7. Click OK to close the New Formatting Rule dialog box.

The weekend rows are highlighted in green.

CondFormatGreen

The WEEKDAY Function

The WEEKDAY function checks the date in column H, and returns a weekday number, based on a numbering system (2) that starts with Monday as 1. Saturday is 6 and Sunday is 7, so we want to highlight weekday numbers that are greater than 5.

Instead of that numbering system, we could have entered 1 or 3 as the second argument (return_type) in the WEEKDAY function. If we entered a 1, or omitted the second argument, the numbering would start with Sunday as 1. With a 3, Monday would start as 0, and end with a 6 on Sunday.

WEEKDAYArg

I used the 2 because that groups Saturday and Sunday at the end of the numbering, and we can simply test for >5.

More About Conditional Formatting

On the Contextures website there are basic instructions for conditional formatting, and other examples of ways you can use it.

Watch the Video

Here’s a short video that shows the steps in Excel 2007. No animated creatures in this one, but maybe they’ll be back another day.

__________________

2 comments to Highlight Weekend Dates In Excel

  1. Michael Pierce
    June 15th, 2009 at 11:21 am

    A good reminder that default behaviors don't always make things easier!

  2. Debra Dalgleish
    June 15th, 2009 at 9:16 pm

    Michael, you're right!

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>