This page is an advertiser-supported excerpt of the book, Learn Excel 2007-2010 from MrExcel - 512 Excel Mysteries Solved. If you like this topic, please consider buying the entire e-book.
Add a Column to Show Month or Weekday
Problem: I want to analyze sales by weekday. Can I calculate the weekday from a date?
Strategy: Use the TEXT function. The first argument for this function is a cell containing a date. The second argument is any custom number format in quotes. =TEXT(A2,"DDDD") will give you a weekday. =TEXT(A2,"MMM") will give you the month abbreviation.
Figure 537 Convert dates to weekdays.
Note that unlike applying a date format, the TEXT function actually converts the date to text. You can sort by column B and all of the Mondays will sort together.