Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Number of sundays
Hi,
I have a date which is a sunday and I need to find how many sundays it is from the begining of the year. Thanks MarkS |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Number of sundays
Mark,
Try this. Function SundaysFromStartOfYear(dtInput As Date) 'assumes dtinput is a sunday SundaysFromStartOfYear = Int((dtInput - DateSerial(Year(dtInput), 1, 1)) / 7) + 1 End Function Robin Hammond www.enhanceddatasystems.com "Mark Scholes" wrote in message ... Hi, I have a date which is a sunday and I need to find how many sundays it is from the begining of the year. Thanks MarkS |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Number of sundays
On Tue, 22 Feb 2005 16:36:43 -0800, "Mark Scholes"
wrote: Hi, I have a date which is a sunday and I need to find how many sundays it is from the begining of the year. Thanks MarkS With your Sunday date in A1: =(A1-DATE(YEAR(A1),1,7)+WEEKDAY(DATE(YEAR(A1),1,6)))/7+1 gives the Sunday number; counting the first Sunday in the year as number 1. If you don't want to count the first Sunday, then omit the +1 at the end of the formula. --ron |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Number of sundays
On Tue, 22 Feb 2005 16:36:43 -0800, "Mark Scholes"
wrote: Hi, I have a date which is a sunday and I need to find how many sundays it is from the begining of the year. Thanks MarkS OOPS. My formula should be: =DATE(YEAR(A1),1,8)-WEEKDAY(DATE(YEAR(A1),1,7)) --ron |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Number of sundays
On Tue, 22 Feb 2005 16:36:43 -0800, "Mark Scholes"
wrote: Hi, I have a date which is a sunday and I need to find how many sundays it is from the begining of the year. Thanks MarkS Maybe now that I am awake I can get it correct: =(A1-DATE(YEAR(A1),1,8)+WEEKDAY(DATE(YEAR(A1),1,7)))/7+1 --ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sundays | Excel Worksheet Functions | |||
Get all Sundays | Excel Worksheet Functions | |||
Number of sundays between two dates | Excel Worksheet Functions | |||
Calculate the number of Saturdays or Sundays between 2 dates? | Excel Discussion (Misc queries) | |||
Need number of Saturdays and number of Sundays between 2 dates | Excel Worksheet Functions |