<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener("load", function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <iframe src="http://www.blogger.com/navbar.g?targetBlogID=28182552&amp;blogName=:xL-tips&amp;publishMode=PUBLISH_MODE_BLOGSPOT&amp;navbarType=SILVER&amp;layoutType=CLASSIC&amp;searchRoot=http://xl-tips.blogspot.com/search&amp;blogLocale=en_US&amp;homepageUrl=http://xl-tips.blogspot.com/&amp;vt=-7072926953029533487" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" height="30px" width="100%" id="navbar-iframe" allowtransparency="true" title="Blogger Navigation and Search"></iframe> <div></div>






18 May 2006

Dayname (English Version)

Criteria: Technical, Multiple Formulas
Level: Intermediate


I myself often face this problem. That is, what is the dayname of certain date. Before found this multiple formulas from my partner job, Michael HTj, I always use macro. What a stupid way! Thx Mike! Now, I want to share how to get dayname of certain date.

There are two ways to have it:

.: Using format cell

1 Right click on selected range
2 Chose Format Cells...
3 In Number tab, chose Custom
4 Type ddd or dddd in Type textbox
5 To see the result, see in Sample box
6 OK



.: Using TEXT formula

TEXT(value, format_text)
Value is a numeric value, a formula that evaluates to a numeric value, or a reference to a cell containing a numeric value.
Format_text is a number format in text form from in the Category box on the Number tab in the Format Cells dialog box. Format_text cannot contain an asterisk (*) and cannot be the General number format.

For this case, set format_text to ddd for simple day (e.g. Sun) or dddd for complete day (e.g. Sunday)



Here are the formulas in cells of C3 and D3:
=TEXT(B3,"ddd")
=TEXT(B3,"dddd")
respectively.

0 Comments:

Post a Comment

<< Home