close

Sorry Posted in wrong forum

I want to find the day of the week on which the 1st Jan falls in the year I input. For example: in A1 all I want to enter is a year e.g. 2006. In B1 I want a formula that will return the value SUNDAY. I can get the formula to work if I enter 1/1/06 in A1 but I just want to enter the year. I tried using Concatenate to add 1/1/ to the value in A1 but couldn't get excel to recognise the concatenation as a date. Any ideas?

thanks

mjd
=TEXT(DATE(a1,1,1),quot;ddddquot;)

--
Kevin Vaughnquot;dalymjlquot; wrote:

gt;
gt; Sorry Posted in wrong forum
gt;
gt; I want to find the day of the week on which the 1st Jan falls in the
gt; year I input. For example: in A1 all I want to enter is a year e.g.
gt; 2006. In B1 I want a formula that will return the value SUNDAY. I can
gt; get the formula to work if I enter 1/1/06 in A1 but I just want to
gt; enter the year. I tried using Concatenate to add 1/1/ to the value in
gt; A1 but couldn't get excel to recognise the concatenation as a date. Any
gt; ideas?
gt;
gt; thanks
gt;
gt; mjd
gt;
gt;
gt; --
gt; dalymjl
gt;


Originally Posted by Kevin Vaughn=TEXT(DATE(a1,1,1),quot;ddddquot;)

--
Kevin Vaughnquot;dalymjlquot; wrote:

Sorry Posted in wrong forum
I want to find the day of the week on which the 1st Jan falls in theyear I input. For example: in A1 all I want to enter is a year e.g.2006. In B1 I want a formula that will return the value SUNDAY. I canget the formula to work if I enter 1/1/06 in A1 but I just want toenter the year. I tried using Concatenate to add 1/1/ to the value inA1 but couldn't get excel to recognise the concatenation as a date. Anyideas?
thanks
mjd

--dalymjlThanks Kevin,

That worked fine.

Would you know how I could test the year entered in A1 to return TRUE if the year is a leap year and FALSE if not. I can do this if a full date is entered using = IF(MONTH(DATE(YEAR(A1),2,29))=2,TRUE,FALSE). However I can't get it to work if A1 contains only the year.

Just replace YEAR(A1) in your formula with A1 - also the IF function is
redundant so this suffices

=MONTH(DATE(A1,2,29))=2--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: www.excelforum.com/member.php...oamp;userid=30486
View this thread: www.excelforum.com/showthread...hreadid=503560
Originally Posted by daddylonglegsJust replace YEAR(A1) in your formula with A1 - also the IF function is
redundant so this suffices

=MONTH(DATE(A1,2,29))=2--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: www.excelforum.com/member.php...oamp;userid=30486
View this thread: www.excelforum.com/showthread...hreadid=503560

Excellent!! Thanks very much.

regards

mjd

全站熱搜
創作者介紹
創作者 software 的頭像
software

software

software 發表在 痞客邦 留言(0) 人氣()