A Function to Automatically Display the Weekends in a Column.

Posted on January 15, 2008 
Filed Under Excel Tips & Tricks

I’ve already showed you how you can automatically display the weekdays in MS Excel and with this next Excel Tip and Trick I want to show you how you can use a formula to display or determine the weekdays in a spreadsheet.

 

If you want to know if a given day is a weekday or not you can use the WEEKDAY function.

 

With the help of the WEEKDAY function we can find out the day of the week for a particular date. This function returns the days as an integer ranging from 1 (Sunday) to 7 (Saturday) by default.

 

To determine the Weekends in an MS Excel column you’ll need to take the following steps.

 

Excel-tip-trick-pic1

 

Select the Cells B2:B10

Type in the formula =IF(OR(WEEKDAY(A2)=7;WEEKDAY(A2)=1);"Weekend";"")

 

Excel-tip-trick-pic2

 

And press CTRL+ENTER

 

Excel-tip-trick-pic3

 

I hope you all liked this Excel Tip and Trick. Ill see you tomorrow.





Comments

Leave a Reply