Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Connie Martin
 
Posts: n/a
Default Formula - Excluding weekends & holidays

I have this very simple formula: =N42-K42 Both N42 and K42 are dates.

QUESTION #1
Is there a way to incorporate into this formula something that would exclude
weekends when it calculates the number of days' difference?

QUESTION #2
Is there also a way to incorporate into this formula something that would
exclude statutory holidays when it calulcates the difference? I assume I
would need to put a list of statutory holidays somewhere in the worksheet or
on another worksheet.

Thank you
Connie Martin
  #2   Report Post  
Roger Govier
 
Posts: n/a
Default

Hi Connie

Try =NETWORKDAYS(startdate,enddate,holidays)
Holidays would be a named range containg a list of the public holidays.
Stardate and enddate the cell references to your dates.
I believe that NETWORKDAYS requires you to have the Analysis Toolpack
loaded.
Go to Tools=Add-ins and select Analysis Toolpack followed by OK

--
Regards
Roger Govier
"Connie Martin" wrote in message
...
I have this very simple formula: =N42-K42 Both N42 and K42 are dates.

QUESTION #1
Is there a way to incorporate into this formula something that would
exclude
weekends when it calculates the number of days' difference?

QUESTION #2
Is there also a way to incorporate into this formula something that would
exclude statutory holidays when it calulcates the difference? I assume I
would need to put a list of statutory holidays somewhere in the worksheet
or
on another worksheet.

Thank you
Connie Martin



  #3   Report Post  
Bob Phillips
 
Posts: n/a
Default

Look at NETWORKDAYS function in help, it can handle both situations you
describe. It is part of the Analysis Toolpak, so you would need to install
that.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Connie Martin" wrote in message
...
I have this very simple formula: =N42-K42 Both N42 and K42 are dates.

QUESTION #1
Is there a way to incorporate into this formula something that would

exclude
weekends when it calculates the number of days' difference?

QUESTION #2
Is there also a way to incorporate into this formula something that would
exclude statutory holidays when it calulcates the difference? I assume I
would need to put a list of statutory holidays somewhere in the worksheet

or
on another worksheet.

Thank you
Connie Martin



  #4   Report Post  
Connie Martin
 
Posts: n/a
Default

Okay, I can do the NETWORKDAYS formula, but how do I include it in my formula
=N42-K42? I want the difference between those two days excluding weekends
and holidays. I have created a named list and so the NETWORKDAYS formula of:
=NETWORKDAYS("01/01/2004","12/31/2004",NonWorkDays) works on its own, giving
me 252 but...I need an answer of 2 because K42 is Jan. 6/04 and N42 is Jan.
8/04. There is no weekend and no holiday between those two dates. However,
if I have Jan. 9/04 and Jan. 13/04, the formula should yield 2, as well
because there's a weekend in there. (I'm revising a huge report from last
year---that's why I've got 2004 dates here.)

"Roger Govier" wrote:

Hi Connie

Try =NETWORKDAYS(startdate,enddate,holidays)
Holidays would be a named range containg a list of the public holidays.
Stardate and enddate the cell references to your dates.
I believe that NETWORKDAYS requires you to have the Analysis Toolpack
loaded.
Go to Tools=Add-ins and select Analysis Toolpack followed by OK

--
Regards
Roger Govier
"Connie Martin" wrote in message
...
I have this very simple formula: =N42-K42 Both N42 and K42 are dates.

QUESTION #1
Is there a way to incorporate into this formula something that would
exclude
weekends when it calculates the number of days' difference?

QUESTION #2
Is there also a way to incorporate into this formula something that would
exclude statutory holidays when it calulcates the difference? I assume I
would need to put a list of statutory holidays somewhere in the worksheet
or
on another worksheet.

Thank you
Connie Martin




  #5   Report Post  
Roger Govier
 
Posts: n/a
Default

Hi Connie

So what result does it give you if you enter
=NETWORKDAYS(K42,N42,Non Work Days)



--
Regards
Roger Govier
"Connie Martin" wrote in message
...
I have this very simple formula: =N42-K42 Both N42 and K42 are dates.

QUESTION #1
Is there a way to incorporate into this formula something that would
exclude
weekends when it calculates the number of days' difference?

QUESTION #2
Is there also a way to incorporate into this formula something that would
exclude statutory holidays when it calulcates the difference? I assume I
would need to put a list of statutory holidays somewhere in the worksheet
or
on another worksheet.

Thank you
Connie Martin





  #6   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

=NETWORKDAYS(K42.N42,Holidays)

--

Regards,

Peo Sjoblom


"Connie Martin" wrote in message
...
Okay, I can do the NETWORKDAYS formula, but how do I include it in my

formula
=N42-K42? I want the difference between those two days excluding weekends
and holidays. I have created a named list and so the NETWORKDAYS formula

of:
=NETWORKDAYS("01/01/2004","12/31/2004",NonWorkDays) works on its own,

giving
me 252 but...I need an answer of 2 because K42 is Jan. 6/04 and N42 is

Jan.
8/04. There is no weekend and no holiday between those two dates.

However,
if I have Jan. 9/04 and Jan. 13/04, the formula should yield 2, as well
because there's a weekend in there. (I'm revising a huge report from last
year---that's why I've got 2004 dates here.)

"Roger Govier" wrote:

Hi Connie

Try =NETWORKDAYS(startdate,enddate,holidays)
Holidays would be a named range containg a list of the public holidays.
Stardate and enddate the cell references to your dates.
I believe that NETWORKDAYS requires you to have the Analysis Toolpack
loaded.
Go to Tools=Add-ins and select Analysis Toolpack followed by OK

--
Regards
Roger Govier
"Connie Martin" wrote in

message
...
I have this very simple formula: =N42-K42 Both N42 and K42 are dates.

QUESTION #1
Is there a way to incorporate into this formula something that would
exclude
weekends when it calculates the number of days' difference?

QUESTION #2
Is there also a way to incorporate into this formula something that

would
exclude statutory holidays when it calulcates the difference? I

assume I
would need to put a list of statutory holidays somewhere in the

worksheet
or
on another worksheet.

Thank you
Connie Martin






  #7   Report Post  
Connie Martin
 
Posts: n/a
Default

Thank you. With the formula slightly modified, I get the answer I need:
=NETWORKDAYS(K42,N42,NonWorkDays)-1 I am taking one day off because I don't
want to include the departure day, which is the first date.


"Peo Sjoblom" wrote:

=NETWORKDAYS(K42.N42,Holidays)

--

Regards,

Peo Sjoblom


"Connie Martin" wrote in message
...
Okay, I can do the NETWORKDAYS formula, but how do I include it in my

formula
=N42-K42? I want the difference between those two days excluding weekends
and holidays. I have created a named list and so the NETWORKDAYS formula

of:
=NETWORKDAYS("01/01/2004","12/31/2004",NonWorkDays) works on its own,

giving
me 252 but...I need an answer of 2 because K42 is Jan. 6/04 and N42 is

Jan.
8/04. There is no weekend and no holiday between those two dates.

However,
if I have Jan. 9/04 and Jan. 13/04, the formula should yield 2, as well
because there's a weekend in there. (I'm revising a huge report from last
year---that's why I've got 2004 dates here.)

"Roger Govier" wrote:

Hi Connie

Try =NETWORKDAYS(startdate,enddate,holidays)
Holidays would be a named range containg a list of the public holidays.
Stardate and enddate the cell references to your dates.
I believe that NETWORKDAYS requires you to have the Analysis Toolpack
loaded.
Go to Tools=Add-ins and select Analysis Toolpack followed by OK

--
Regards
Roger Govier
"Connie Martin" wrote in

message
...
I have this very simple formula: =N42-K42 Both N42 and K42 are dates.

QUESTION #1
Is there a way to incorporate into this formula something that would
exclude
weekends when it calculates the number of days' difference?

QUESTION #2
Is there also a way to incorporate into this formula something that

would
exclude statutory holidays when it calulcates the difference? I

assume I
would need to put a list of statutory holidays somewhere in the

worksheet
or
on another worksheet.

Thank you
Connie Martin






  #8   Report Post  
Connie Martin
 
Posts: n/a
Default

If I modify the formula slightly, I get the answer I need:
=NETWORKDAYS(K42,N42,NonWorkDays)-1 I am taking one day off because I don't
want to include the departure day, which is the first date, which is the same
answer N42-K42 will give me. Thank you very much!


"Roger Govier" wrote:

Hi Connie

So what result does it give you if you enter
=NETWORKDAYS(K42,N42,Non Work Days)



--
Regards
Roger Govier
"Connie Martin" wrote in message
...
I have this very simple formula: =N42-K42 Both N42 and K42 are dates.

QUESTION #1
Is there a way to incorporate into this formula something that would
exclude
weekends when it calculates the number of days' difference?

QUESTION #2
Is there also a way to incorporate into this formula something that would
exclude statutory holidays when it calulcates the difference? I assume I
would need to put a list of statutory holidays somewhere in the worksheet
or
on another worksheet.

Thank you
Connie Martin




  #9   Report Post  
Gord Dibben
 
Posts: n/a
Default

Connie

NETWORKDAYS Function.

Returns the number of whole working days between start_date and end_date.
Working days exclude weekends and any dates identified in holidays. Use
NETWORKDAYS to calculate employee benefits that accrue based on the number of
days worked during a specific term.

If this function is not available, and returns the #NAME? error, install and
load the Analysis ToolPak add-in.

See Help for formula examples.


Gord Dibben Excel MVP

On Thu, 24 Feb 2005 08:23:06 -0800, "Connie Martin"
wrote:

I have this very simple formula: =N42-K42 Both N42 and K42 are dates.

QUESTION #1
Is there a way to incorporate into this formula something that would exclude
weekends when it calculates the number of days' difference?

QUESTION #2
Is there also a way to incorporate into this formula something that would
exclude statutory holidays when it calulcates the difference? I assume I
would need to put a list of statutory holidays somewhere in the worksheet or
on another worksheet.

Thank you
Connie Martin


  #10   Report Post  
Myrna Larson
 
Posts: n/a
Default

I think a better way to do that is to modify the departure date, i.e. write
the formula as =NETWORKDAYS(K42+1,N42,NonWorkDays)

On Thu, 24 Feb 2005 10:19:01 -0800, "Connie Martin"
wrote:

Thank you. With the formula slightly modified, I get the answer I need:
=NETWORKDAYS(K42,N42,NonWorkDays)-1 I am taking one day off because I don't
want to include the departure day, which is the first date.


"Peo Sjoblom" wrote:

=NETWORKDAYS(K42.N42,Holidays)

--

Regards,

Peo Sjoblom


"Connie Martin" wrote in message
...
Okay, I can do the NETWORKDAYS formula, but how do I include it in my

formula
=N42-K42? I want the difference between those two days excluding

weekends
and holidays. I have created a named list and so the NETWORKDAYS formula

of:
=NETWORKDAYS("01/01/2004","12/31/2004",NonWorkDays) works on its own,

giving
me 252 but...I need an answer of 2 because K42 is Jan. 6/04 and N42 is

Jan.
8/04. There is no weekend and no holiday between those two dates.

However,
if I have Jan. 9/04 and Jan. 13/04, the formula should yield 2, as well
because there's a weekend in there. (I'm revising a huge report from

last
year---that's why I've got 2004 dates here.)

"Roger Govier" wrote:

Hi Connie

Try =NETWORKDAYS(startdate,enddate,holidays)
Holidays would be a named range containg a list of the public holidays.
Stardate and enddate the cell references to your dates.
I believe that NETWORKDAYS requires you to have the Analysis Toolpack
loaded.
Go to Tools=Add-ins and select Analysis Toolpack followed by OK

--
Regards
Roger Govier
"Connie Martin" wrote in

message
...
I have this very simple formula: =N42-K42 Both N42 and K42 are

dates.

QUESTION #1
Is there a way to incorporate into this formula something that would
exclude
weekends when it calculates the number of days' difference?

QUESTION #2
Is there also a way to incorporate into this formula something that

would
exclude statutory holidays when it calulcates the difference? I

assume I
would need to put a list of statutory holidays somewhere in the

worksheet
or
on another worksheet.

Thank you
Connie Martin







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
Match / Vlookup within an Array formula Hari Prasadh Excel Discussion (Misc queries) 3 February 3rd 05 04:37 PM
Skip the Holidays 2 Aviator Excel Discussion (Misc queries) 9 January 13th 05 12:37 PM
Help with macro formula and variable Huge project Excel Worksheet Functions 0 December 28th 04 01:27 AM
excluding cells from the formula when empty Joe Shell Excel Worksheet Functions 5 November 21st 04 04:37 PM
Formula to make Excel count business days/skip weekends? Inga Excel Worksheet Functions 1 November 17th 04 07:45 PM


All times are GMT +1. The time now is 01:10 AM.

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"