#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default dates of month

I have a date [i.e. 12/1/2008] that is entered in a cell, then I want all the
Sunday dates of that month to automatically enter in non-adjacent cells on
the form.

I've searched and cannot get this to work - help would be appreciated!!

thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default dates of month

With 12/1 entered into cell A1, use

=DATE(YEAR(A1),MONTH(A1),1)+CHOOSE(WEEKDAY(DATE(YE AR(A1),MONTH(A1),1)),0,6,5,4,3,2,1)

for the first Sunday, then for the next Sundays, use

=DATE(YEAR(A1),MONTH(A1),1)+CHOOSE(WEEKDAY(DATE(YE AR(A1),MONTH(A1),1)),0,6,5,4,3,2,1) + 7
=DATE(YEAR(A1),MONTH(A1),1)+CHOOSE(WEEKDAY(DATE(YE AR(A1),MONTH(A1),1)),0,6,5,4,3,2,1) + 14
=DATE(YEAR(A1),MONTH(A1),1)+CHOOSE(WEEKDAY(DATE(YE AR(A1),MONTH(A1),1)),0,6,5,4,3,2,1) + 21
and if there is a fifth Sunday:
==IF(MONTH(DATE(YEAR(A1),MONTH(A1),1)+CHOOSE(WEEKD AY(DATE(YEAR(A1),MONTH(A1),1)),0,6,5,4,3,2,1) + 28
)=MONTH(A1),DATE(YEAR(A1),MONTH(A1),1)+CHOOSE(WEEK DAY(DATE(YEAR(A1),MONTH(A1),1)),0,6,5,4,3,2,1) +
28,"")

HTH,
Bernie
MS Excel MVP


"rejoyce40" wrote in message
...
I have a date [i.e. 12/1/2008] that is entered in a cell, then I want all the
Sunday dates of that month to automatically enter in non-adjacent cells on
the form.

I've searched and cannot get this to work - help would be appreciated!!

thanks!



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default dates of month

Try these:

A1 = some date

A3 = 1st Sunday
A5 = 2nd Sunday
A7 = 3rd Sunday
A9 = 4th Sunday
A11 = 5th Sunday (if there is one)

Enter these formulas in their respective cells:

A3: for the 1st Sunday

=A1-DAY(A1)+8-WEEKDAY(A1-DAY(A1)+1-1)

A5: for the 2nd Sunday

=A3+7

A7: for the 3rd Sunday

=A3+14

A9: for the 4th Sunday

=A3+21

A11: for the 5th Sunday (if ther is one)

=IF(MONTH(A9+7)=MONTH(A1),A9+7,"")

You might have to format the cells as Date


--
Biff
Microsoft Excel MVP


"rejoyce40" wrote in message
...
I have a date [i.e. 12/1/2008] that is entered in a cell, then I want all
the
Sunday dates of that month to automatically enter in non-adjacent cells on
the form.

I've searched and cannot get this to work - help would be appreciated!!

thanks!



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 806
Default dates of month

Non-adjacent?? How?

Regards,
Bernd
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default dates of month

Wow, that worked just exactly like I wanted - THANK YOU, THANK YOU, THANK
YOU!!!

"T. Valko" wrote:

Try these:

A1 = some date

A3 = 1st Sunday
A5 = 2nd Sunday
A7 = 3rd Sunday
A9 = 4th Sunday
A11 = 5th Sunday (if there is one)

Enter these formulas in their respective cells:

A3: for the 1st Sunday

=A1-DAY(A1)+8-WEEKDAY(A1-DAY(A1)+1-1)

A5: for the 2nd Sunday

=A3+7

A7: for the 3rd Sunday

=A3+14

A9: for the 4th Sunday

=A3+21

A11: for the 5th Sunday (if ther is one)

=IF(MONTH(A9+7)=MONTH(A1),A9+7,"")

You might have to format the cells as Date


--
Biff
Microsoft Excel MVP


"rejoyce40" wrote in message
...
I have a date [i.e. 12/1/2008] that is entered in a cell, then I want all
the
Sunday dates of that month to automatically enter in non-adjacent cells on
the form.

I've searched and cannot get this to work - help would be appreciated!!

thanks!






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default dates of month

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"rejoyce40" wrote in message
...
Wow, that worked just exactly like I wanted - THANK YOU, THANK YOU, THANK
YOU!!!

"T. Valko" wrote:

Try these:

A1 = some date

A3 = 1st Sunday
A5 = 2nd Sunday
A7 = 3rd Sunday
A9 = 4th Sunday
A11 = 5th Sunday (if there is one)

Enter these formulas in their respective cells:

A3: for the 1st Sunday

=A1-DAY(A1)+8-WEEKDAY(A1-DAY(A1)+1-1)

A5: for the 2nd Sunday

=A3+7

A7: for the 3rd Sunday

=A3+14

A9: for the 4th Sunday

=A3+21

A11: for the 5th Sunday (if ther is one)

=IF(MONTH(A9+7)=MONTH(A1),A9+7,"")

You might have to format the cells as Date


--
Biff
Microsoft Excel MVP


"rejoyce40" wrote in message
...
I have a date [i.e. 12/1/2008] that is entered in a cell, then I want
all
the
Sunday dates of that month to automatically enter in non-adjacent cells
on
the form.

I've searched and cannot get this to work - help would be appreciated!!

thanks!






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
convert dates to month Mati Excel Worksheet Functions 7 October 22nd 08 09:23 PM
dates, 1 month prior wfactor Excel Worksheet Functions 5 June 19th 06 08:23 AM
Dates - Several Days In a month to month only Andy_Pimp Excel Discussion (Misc queries) 1 February 28th 06 11:11 AM
dates in one month Vibeke Excel Worksheet Functions 5 January 27th 06 12:26 AM
dates, 1st of month LatinViolin Excel Worksheet Functions 3 February 21st 05 04:38 PM


All times are GMT +1. The time now is 07:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"