Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Eutrapelia
 
Posts: n/a
Default Find the first Sunday for a given year?

I am looking for a way to find the first weekday of the year, say the first
Sunday or Monday, while giving only the year to excel. For example, if I
type in 2006, I want it to automatically give me the date of the first Monday
of the year. Is there any function or combination of functions that will do
this for me?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
vezerid
 
Posts: n/a
Default Find the first Sunday for a given year?

Eutrapelia,
(nice nickname btw, I trust you have the idea of its meaning in its
original language :))

Assume the year is in A1 and in B1 you put a number from 1(Sunday) to
7(Saturday). The following formula will return the first day of your B1
choice:
=DATE(A1, 1, MOD(7-DATE(A1, 1, 1)+ B1,7)+1)

HTH
Kostis Vezerides

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld
 
Posts: n/a
Default Find the first Sunday for a given year?

On Thu, 19 Jan 2006 02:47:02 -0800, "Eutrapelia"
wrote:

I am looking for a way to find the first weekday of the year, say the first
Sunday or Monday, while giving only the year to excel. For example, if I
type in 2006, I want it to automatically give me the date of the first Monday
of the year. Is there any function or combination of functions that will do
this for me?


With YEAR in A1:

First Sunday:

=DATE(A1,1,8)-WEEKDAY(DATE(A1,1,7))

First Monday:

=DATE(A1,1,8)-WEEKDAY(DATE(A1,1,6))

First Weekday:

If you have the Analysis ToolPak installed:

=workday(DATE(A1,1,0),1)

(See HELP for the workday function for instructions on how to install it).

If you do not have the ATP installed:

=DATE(A1,1,0)+CHOOSE(WEEKDAY(DATE(A1,1,0)),1,1,1,1 ,1,3,2)


--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
Need to Sum Mon-Sat each seven days; Average Sunday Robert Moore Excel Worksheet Functions 7 November 4th 05 10:20 AM
Upgraded to office 2003 now cannot find personal.xls jgg765 Excel Discussion (Misc queries) 1 June 21st 05 06:20 PM
How do I find the cell address of the 2nd largest of a set? Mr. Snrub Excel Discussion (Misc queries) 4 May 30th 05 12:53 PM
Keep find box open while in spreadsheet Frantic Excel-er Excel Discussion (Misc queries) 6 May 20th 05 07:31 PM
How to compare current year to prior year in bar chart? substring Charts and Charting in Excel 4 May 12th 05 07:04 PM


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