View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default counting Sundays between two dates

Hi
try the formula:
=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&A2)))<1),--(COUNTIF(C1:C5,ROW(INDIRECT(A1&":"&A2)))=0))*(1-2*(A1A2))

--
Regards
Frank Kabel
Frankfurt, Germany
"kippi3000" schrieb im Newsbeitrag
...
Given A1= 1/5/05 and A2=1/20/05
and range C1:C5 is a list of holiday dates, what can I do to calculate the
duration of the two dates, minus sundays and the holidays?

I've gotten as far as

=A2-A1+1-(COUNTIF(C1:C5,"="&A1)-COUNTIF(C1:C5,""&A2))

A2-A1+1 calculates the duration between the two dates inclusive;
COUNTIF(C1:C5,"="&A1)-COUNTIF(C1:C5,""&A2) calculates the number of
holidays which fall within the dates

I have not figured out a way to count sundays.. anyone with any
suggestions?