
68 GOOGLE APPS HACKS
HaCK 24:
To get from a date value to the actual name of the day—inspired
by the hack “Return the Weekday of a Date” from David and Raina
Hawley’s Excel Hacks, 2nd Edition—you need to press a couple of
different functions into service.
Among Google Spreadsheet’s functions are a few that let you get the name of the day or month
for a given date value. Take a look at the sample spreadsheet with user registration dates shown in
Figure 3-20. To the left side, you can see a list of usernames; next to them, you can see the date on
which each user registered for the service. Dates are easy enough to get into a spreadsheet, but
to get the spreadsheet to print out the weekday in every row, you’ll need to use some functions.
The functions you need to pick the weekday are called WEEKDAY and CHOOSE. The WEEKDAY
function returns a number from 1 to 7, where 1 is Sunday, 2 is Monday, 3 is Tuesday and so on.
Wondering how to calculate the number of days the user has been registered so far? Check out for
complete details.
Try it out yourself by entering the following into any cell:
=WEEKDAY(B2)
This formula shows that April 21, 2004 (the value in B2), is a “4”, which means Wednesday. (A
quick jump over to Google Calendar at http://calendar.google.com veries this.) But that isn’t very
readable—you still need to convert this number ...