#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Date Functions

On Wed, 16 Apr 2008 06:54:00 -0700, Sean.rogers
wrote:

Thank you. It work beautifully. One more question. I am self tought in Excel
so can you please explane the Logic in this function?


=A1-6-WEEKDAY(A1-1)

The basic idea is that, with a date in A1, the formula

A1-WEEKDAY(A1) will return the previous Saturday.

Actually, A1-WEEKDAY(A1-DOW) returns the previous Saturday, where DOW = Day Of
Week and Sunday = 1; Saturday = 7. But, of course, WEEKDAY(A1) =
WEEKDAY(A1-7), so both are the same.

DOW becomes important when you want to return a different day than Saturday.

So, to return the Monday of the week befo

=A1-6-WEEKDAY(A1-6-DOW) --
A1-6-WEEKDAY(A1-6-2) --
A1-6-WEEKDAY(A1-8)

Since the weekdays are 1-7 --
A1-6-WEEKDAY(A1-MOD(8,7)) --
A1-6-WEEKDAY(A1-1)

--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
Date functions Dianethetech Excel Worksheet Functions 4 May 17th 07 04:31 PM
Date Functions mark.nelson4 Excel Worksheet Functions 7 January 3rd 07 10:47 PM
Date Functions Jules Excel Discussion (Misc queries) 4 July 5th 06 05:55 PM
Date Functions Keith Excel Discussion (Misc queries) 2 April 24th 06 06:43 PM
date functions VDan Excel Discussion (Misc queries) 1 August 31st 05 06:24 PM


All times are GMT +1. The time now is 09:33 PM.

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"