Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default days of the week formulas

On Thu, 6 Mar 2008 17:43:20 -0500, "Rick Rothstein \(MVP - VB\)"
wrote:

End of Period:

=A1+39-DAY(A1+32)-WEEKDAY(A1+32-DAY(A1+33))


I do not believe this formula works all the time. Unless I am wrong, it
fails for dates like 2/28/2008 through 3/1/2008, 3/29/2008 through 4/1/2008,
4/29/2008 through 5/1/2008, and so on.

Rick


You're correct, and <slap upside the face I've made that same %$#^&$ mistake
before.

Should be:

=A1-DAY(A1)+39-DAY(A1-DAY(A1)+32)-WEEKDAY(A1-DAY(A1)+39-DAY(A1-DAY(A1)+33))

--ron
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default days of the week formulas

End of Period:

=A1+39-DAY(A1+32)-WEEKDAY(A1+32-DAY(A1+33))


I do not believe this formula works all the time. Unless I am wrong, it
fails for dates like 2/28/2008 through 3/1/2008, 3/29/2008 through
4/1/2008,
4/29/2008 through 5/1/2008, and so on.

Rick


You're correct, and <slap upside the face I've made that same %$#^&$
mistake
before.

Should be:

=A1-DAY(A1)+39-DAY(A1-DAY(A1)+32)-WEEKDAY(A1-DAY(A1)+39-DAY(A1-DAY(A1)+33))


I think there are still problems with that one too. Try the first of each
month (2/1/2008, 3/1/2008, 4/1/2008, etc.)

Rick

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default days of the week formulas

On Thu, 6 Mar 2008 18:05:50 -0500, "Rick Rothstein \(MVP - VB\)"
wrote:

End of Period:

=A1+39-DAY(A1+32)-WEEKDAY(A1+32-DAY(A1+33))

I do not believe this formula works all the time. Unless I am wrong, it
fails for dates like 2/28/2008 through 3/1/2008, 3/29/2008 through
4/1/2008,
4/29/2008 through 5/1/2008, and so on.

Rick


You're correct, and <slap upside the face I've made that same %$#^&$
mistake
before.

Should be:

=A1-DAY(A1)+39-DAY(A1-DAY(A1)+32)-WEEKDAY(A1-DAY(A1)+39-DAY(A1-DAY(A1)+33))


I think there are still problems with that one too. Try the first of each
month (2/1/2008, 3/1/2008, 4/1/2008, etc.)

Rick


I don't see that.

2/1/2008 -- Sunday 3/2/2008, which is the same result as your longer formula
gives.

Given that the OP's definition results in overlapping, I wonder what it is used
for.

--ron
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default days of the week formulas

End of Period:

=A1+39-DAY(A1+32)-WEEKDAY(A1+32-DAY(A1+33))

I do not believe this formula works all the time. Unless I am wrong, it
fails for dates like 2/28/2008 through 3/1/2008, 3/29/2008 through
4/1/2008,
4/29/2008 through 5/1/2008, and so on.

Rick

You're correct, and <slap upside the face I've made that same %$#^&$
mistake
before.

Should be:

=A1-DAY(A1)+39-DAY(A1-DAY(A1)+32)-WEEKDAY(A1-DAY(A1)+39-DAY(A1-DAY(A1)+33))


I think there are still problems with that one too. Try the first of each
month (2/1/2008, 3/1/2008, 4/1/2008, etc.)

Rick


I don't see that.

2/1/2008 -- Sunday 3/2/2008, which is the same result as your longer
formula
gives.


Hmm! You are right... they *do* match up. I must have screwed something up
in my initial test bed. Sorry about that.

Rick

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
5 working days of a week deepika :excel help[_2_] Excel Discussion (Misc queries) 3 January 31st 08 08:37 PM
Re Change 5 week days to 7 days in this formula pano Excel Worksheet Functions 7 February 1st 07 04:20 PM
5 days week date (mon to fri) chiuinggum Excel Worksheet Functions 1 June 11th 06 01:21 AM
7 days of the week James C Excel Discussion (Misc queries) 8 October 10th 05 04:14 AM
Days of the week. Johan Bornman Excel Worksheet Functions 1 November 10th 04 05:25 PM


All times are GMT +1. The time now is 10:32 AM.

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

About Us

"It's about Microsoft Excel"