#1   Report Post  
Posted to microsoft.public.excel.misc
Bonniem
 
Posts: n/a
Default Date Functions

I had previously asked this question "is there a way to have excel figure out
cetain dates for example the last saturday of every month for the next year?"
Answer:
If you put this formula in A1, and copy/drag down, it will give you the date
of
the last Saturday in every month starting with Jan 2006:

=DATE(2006,ROW()+1,1)-WEEKDAY(DATE(2006,ROW()+1,1))

The portion ROW()+1 denotes the month, and will change automatically as you
drag the date down. So if you start, for example, in A5, you would change
that
to ROW()-4

Question 2:

Can you tell me how to use this formula by not dragging the date down and by
just using the systems time and date? What I was trying to do is set up a
time table starting with the date of December 24, 2005 and carrying through
using the second from last Saturday of each month. I got the formula to work
by dragging but I now want to know if you can help me with the formula by
using just the systems date and time?

Thanks

Bonnie Millward

  #2   Report Post  
Posted to microsoft.public.excel.misc
bpeltzer
 
Posts: n/a
Default Date Functions

The final Saturday of the current month is calculated as:
=DATE(YEAR(TODAY()),MONTH(TODAY())+1,1)-WEEKDAY(DATE(YEAR(TODAY()),MONTH(TODAY())+1,1))
HTH. --Bruce


"Bonniem" wrote:

I had previously asked this question "is there a way to have excel figure out
cetain dates for example the last saturday of every month for the next year?"
Answer:
If you put this formula in A1, and copy/drag down, it will give you the date
of
the last Saturday in every month starting with Jan 2006:

=DATE(2006,ROW()+1,1)-WEEKDAY(DATE(2006,ROW()+1,1))

The portion ROW()+1 denotes the month, and will change automatically as you
drag the date down. So if you start, for example, in A5, you would change
that
to ROW()-4

Question 2:

Can you tell me how to use this formula by not dragging the date down and by
just using the systems time and date? What I was trying to do is set up a
time table starting with the date of December 24, 2005 and carrying through
using the second from last Saturday of each month. I got the formula to work
by dragging but I now want to know if you can help me with the formula by
using just the systems date and time?

Thanks

Bonnie Millward

  #3   Report Post  
Posted to microsoft.public.excel.misc
Dave O
 
Posts: n/a
Default Date Functions

Nicely done, Bruce. The only caveat for Bonnie (the OP) is to make
sure the day numbering scheme is the Excel default(Sunday = 1, Saturday
= 7).

  #4   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld
 
Posts: n/a
Default Date Functions

On Fri, 2 Dec 2005 05:45:02 -0800, "Bonniem"
wrote:

I had previously asked this question "is there a way to have excel figure out
cetain dates for example the last saturday of every month for the next year?"
Answer:
If you put this formula in A1, and copy/drag down, it will give you the date
of
the last Saturday in every month starting with Jan 2006:

=DATE(2006,ROW()+1,1)-WEEKDAY(DATE(2006,ROW()+1,1))

The portion ROW()+1 denotes the month, and will change automatically as you
drag the date down. So if you start, for example, in A5, you would change
that
to ROW()-4

Question 2:

Can you tell me how to use this formula by not dragging the date down and by
just using the systems time and date? What I was trying to do is set up a
time table starting with the date of December 24, 2005 and carrying through
using the second from last Saturday of each month. I got the formula to work
by dragging but I now want to know if you can help me with the formula by
using just the systems date and time?


I don't understand why you want to start with 24 DEC 2005 since that is not the
last Saturday in December???

But to get the last Saturday of "this month", use the formula:

=TODAY()+40-DAY(TODAY()+39)-WEEKDAY(TODAY()+40-DAY(TODAY()+39))

If the formula is in A1, you can use the following formula to get the last
Saturday of the subsequent month:

=A1+40-DAY(A1+39)-WEEKDAY(A1+40-DAY(A1+39))


--ron
  #5   Report Post  
Posted to microsoft.public.excel.misc
Dave O
 
Posts: n/a
Default Date Functions

Another way to skin this cat: I worked on it too long to not post!
This assumes the Excel default day numbering, where Sunday = 1 and
Saturday = 7. Derive the last Saturday in the month with
=EOMONTH(TODAY(),0)-MOD(WEEKDAY(EOMONTH(TODAY(),0)),7)-(7-7)

Yes, the (7-7) yields zero in this context- but you can find the last
Friday with
=EOMONTH(TODAY(),0)-MOD(WEEKDAY(EOMONTH(TODAY(),0)),7)-(7-6)

and the last Thursday with
=EOMONTH(TODAY(),0)-MOD(WEEKDAY(EOMONTH(TODAY(),0)),7)-(7-5)

etc.



  #6   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld
 
Posts: n/a
Default Date Functions

On 2 Dec 2005 08:16:31 -0800, "Dave O" wrote:

Another way to skin this cat: I worked on it too long to not post!
This assumes the Excel default day numbering, where Sunday = 1 and
Saturday = 7. Derive the last Saturday in the month with
=EOMONTH(TODAY(),0)-MOD(WEEKDAY(EOMONTH(TODAY(),0)),7)-(7-7)

Yes, the (7-7) yields zero in this context- but you can find the last
Friday with
=EOMONTH(TODAY(),0)-MOD(WEEKDAY(EOMONTH(TODAY(),0)),7)-(7-6)

and the last Thursday with
=EOMONTH(TODAY(),0)-MOD(WEEKDAY(EOMONTH(TODAY(),0)),7)-(7-5)

etc.


Of course, your formula requires the installation of the Analysis ToolPak. Not
all places allow or want that.

Also, MOD(Weekday,... is redundant as Weekday already implies a MOD ...7


--ron
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
Advanced Date Functions enright_m Excel Worksheet Functions 1 October 26th 05 04:08 PM
Date functions John New Users to Excel 3 August 15th 05 08:50 PM
Date Math Problem Dkline Excel Worksheet Functions 4 March 4th 05 04:11 PM
Date issue between Windows and Macintosh version dlg1967 Excel Discussion (Misc queries) 4 January 19th 05 03:51 PM
Addition to Turn cell red if today is greater or equal to date in cell Rich New Users to Excel 2 December 9th 04 02:06 AM


All times are GMT +1. The time now is 09: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"