Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Formula 1

Status
Not open for further replies.

TSHDave

Technical User
Sep 18, 2003
66
0
0
GB
I need to beable to produce a value that count the number of days between two dates and takeaway the number of saturdays.
 
try:

=(B1-A1-(7-WEEKDAY(A1))-WEEKDAY(B1))-((B1-A1-(7-WEEKDAY(A1))-WEEKDAY(B1))/7)+(6-WEEKDAY(A1))+(IF(WEEKDAY(B1)=7,6,WEEKDAY(B1)))

where start date is a1 and end date is b1



Blue [dragon]

If I wasn't Blue, I would just be a Dragon...
 
Slight adjustment for starting dates begining on a Sat:

=(B1-A1-(7-WEEKDAY(A1))-WEEKDAY(B1))-((B1-A1-(7-WEEKDAY(A1))-WEEKDAY(B1))/7)+(IF(WEEKDAY(A1)=7,0,(6-WEEKDAY(A1))))+(IF(WEEKDAY(B1)=7,6,WEEKDAY(B1)))



Blue [dragon]

If I wasn't Blue, I would just be a Dragon...
 
Start Date in A1, Finish date in B1

=B1-A1-SUM(IF(WEEKDAY(A1-1+ROW(INDIRECT("1:"&TRUNC(B1-A1)+1)))=7,1,0))+1

Array entered

Regards
Ken................

----------------------------------------------------------------------------
Attitude - A little thing that makes a BIG difference
----------------------------------------------------------------------------
 
Just in case - 'Array entered' means enter the formula using CTRL+SHIFT+ENTER at the same time.

You are limited though to date intervals of a max of about 180 years :)

Regards
Ken...............

----------------------------------------------------------------------------
Attitude - A little thing that makes a BIG difference
----------------------------------------------------------------------------
 
=(B4-B4/(7)) if b4=B1-A1 is just fairly accurate.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top