A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Remove weekends



 
 
Thread Tools Display Modes
  #1  
Old May 22nd, 2010, 08:58 PM posted to microsoft.public.excel.worksheet.functions
rhhince[_2_]
external usenet poster
 
Posts: 34
Default Remove weekends

I have 2 dates and time:
5/21/2010 11:34 is in A2
5/25/2010 11:34 is in A3

If I subtract them, I get 4 days in cell A4.
I would like to subtract the weekends and give me a total of 2 days.

I came across this before, but forgot how to do it. Any help! Thanks.

  #2  
Old May 22nd, 2010, 09:41 PM posted to microsoft.public.excel.worksheet.functions
Lars-Åke Aspelin[_4_]
external usenet poster
 
Posts: 74
Default Remove weekends

On Sat, 22 May 2010 12:58:00 -0700 (PDT), rhhince
wrote:

I have 2 dates and time:
5/21/2010 11:34 is in A2
5/25/2010 11:34 is in A3

If I subtract them, I get 4 days in cell A4.
I would like to subtract the weekends and give me a total of 2 days.

I came across this before, but forgot how to do it. Any help! Thanks.


Assuming that the hours and minutes are significant and not always the
same in A2 and A3.
Also assuming that neither A2 or A3 hold a time on a weekend.

Try this formula:

=A3-A2-SUMPRODUCT((A2+ROW(1:999)A3)*(WEEKDAY(A2+ROW(1:99 9),2)5))

The 999 is a number bigger than the largest expected difference
between A3 and A2.

Hope this helps / Lars-Åke
  #3  
Old May 23rd, 2010, 04:57 AM posted to microsoft.public.excel.worksheet.functions
Ashish Mathur[_2_]
external usenet poster
 
Posts: 1,764
Default Remove weekends

Hi,

Try this

=networkdays(A2,A3). With the dates mentioned below, the answer would be 3

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"rhhince" wrote in message
...
I have 2 dates and time:
5/21/2010 11:34 is in A2
5/25/2010 11:34 is in A3

If I subtract them, I get 4 days in cell A4.
I would like to subtract the weekends and give me a total of 2 days.

I came across this before, but forgot how to do it. Any help! Thanks.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:33 AM.


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