Wednesday, January 11, 2012

thought of the dayWhat is the spreadsheet equation that will result in the day of the week from it's numerical equivalent?

With the 3 or so "spreadsheet" applications, they each have, albeit unique, functions which are able to extract the day of the week from a given date [reference]. What all these programs have in common is a function the results in a numerical day of the week rather than a day name. For example, while setting aside application specific parameters of each application, the weekday / day of week function would render "1", an integer, to represent "Sunday", the string result thought of the dayI'm attempting to reach as a result. My only guess would be a nested series of if statements.The thought of this gets me dizzy. I would appreciate someone posting the appropriate result so that I can copy it. Ideally, it would be one that would be able to be used in any spreadsheet program WITHOUT cell formatting.
A1 date eg 1/1/12
B1 =WEEKDAY(A1) result 1 (Sunday) or
B1 =CHOOSE( WEEKDAY(A1),"Sunday","Monday",. . . ,"Saturday")

Edit Are we dealing with Excel?
Choose uses numbers up tothought of the day 29 that then chooses a result corresponding to its position in the list.
A1 is the integer to be represented by Sun, Mon etc.
Place this formula (all one line, split up because Yahoo text does not show complete lines) in any cell.

=IF(EXACT(A1,1),"Sun",IF(EXACT(A1,2),
"Mon",IF(EXACT(A1,3),
"Tue",IF(EXACT(A1,4),
"Wed",IF(EXACT(A1,5),
"Thu",IF(EXACT(A1,6),
"Fri",IF(EXACT(A1,7),"Sat")))))))

No comments:

Post a Comment