#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Date Formula help

I am trying to calculate the number of days in a time period excluding
Sundays,
(i.e., 2/29/08 minus 2/23/08 = 5 )

Can anyone help me?

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Date Formula help

(i.e., 2/29/08 minus 2/23/08 = 5 )

The correct result is 6.

A1 = 2/23/2008
B1 = 2/29/2008

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&B1)),2)<7))


--
Biff
Microsoft Excel MVP


"Di" <Di @discussions.microsoft.com wrote in message
...
I am trying to calculate the number of days in a time period excluding
Sundays,
(i.e., 2/29/08 minus 2/23/08 = 5 )

Can anyone help me?

Thanks




  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Date Formula help

=B1-A1-SUM((WEEKDAY(A1-1+ROW(INDIRECT("1:"&TRUNC(B1-A1)+1)))=1)*1)

This is an array formula and must be entered with CNTRL-SHFT-ENTER rather
than just the ENTER key.
--
Gary''s Student - gsnu200773


"Di" wrote:

I am trying to calculate the number of days in a time period excluding
Sundays,
(i.e., 2/29/08 minus 2/23/08 = 5 )

Can anyone help me?

Thanks


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Date Formula help

On Fri, 14 Mar 2008 09:28:00 -0700, Di <Di @discussions.microsoft.com wrote:

I am trying to calculate the number of days in a time period excluding
Sundays,
(i.e., 2/29/08 minus 2/23/08 = 5 )

Can anyone help me?

Thanks


=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&A2)))<1))

will return a count of all the days from and INCLUDING A1 and A2 that are not
Sundays.

To exclude the starting date, merely subtract 1 from that value:

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&A2)))<1))-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
Create a formula in a date range to locate a specific date - ecel util Excel Discussion (Misc queries) 0 February 19th 07 03:03 PM
Excel Formula to calulate number of days passed from date to date K. Mack Excel Discussion (Misc queries) 8 January 4th 07 11:27 PM
Date Function formula that will return the date of a specific week Greg Excel Worksheet Functions 4 June 12th 06 05:07 PM
Formula for determining if two date columns fall within specific date range Igottabeme Excel Worksheet Functions 2 April 21st 06 02:50 AM
Formula for determining if two date columns fall within specific date range Igottabeme Excel Discussion (Misc queries) 1 April 20th 06 10:03 PM


All times are GMT +1. The time now is 11:15 PM.

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

About Us

"It's about Microsoft Excel"