ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Return day of week for 1 January (https://www.excelbanter.com/excel-worksheet-functions/66442-return-day-week-1-january.html)

dalymjl

Return day of week for 1 January
 
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

Kevin Vaughn

Return day of week for 1 January
 
=TEXT(DATE(a1,1,1),"dddd")

--
Kevin Vaughn


"dalymjl" wrote:


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


--
dalymjl


dalymjl

Quote:

Originally Posted by Kevin Vaughn
=TEXT(DATE(a1,1,1),"dddd")

--
Kevin Vaughn


"dalymjl" wrote:


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


--
dalymjl

Thanks 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.

daddylonglegs

Return day of week for 1 January
 

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: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=503560


dalymjl

Quote:

Originally Posted by daddylonglegs
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: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=503560

Excellent!! Thanks very much.

regards

mjd


All times are GMT +1. The time now is 03:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com