+ Reply to Thread
Results 1 to 6 of 6

calculate days

  1. #1
    JR
    Guest

    calculate days

    I need to write a formula to calculate the number of week days in a year less
    the holidays. Do I have to go through a calendar and count the holidays, or
    does Excel have this built in somewhere?
    --
    JR

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    No, Excel doesn't have inbuilt holidays due to the differences country to country.

    You can use

    =NETWORKDAYS(date(2006,1,1),date(2006,12,31))

    to count the number of weekdays in 2006 or create a list of holidays and use

    =NETWORKDAYS(date(2006,1,1),date(2006,12,31),holidays)

  3. #3
    JR
    Guest

    Re: calculate days

    Thanks...this will make my project a lot easier! Appreciate the info.
    --
    JR


    "daddylonglegs" wrote:

    >
    > No, Excel doesn't have inbuilt holidays due to the differences country
    > to country.
    >
    > You can use
    >
    > =NETWORKDAYS(date(2006,1,1),date(2006,12,31))
    >
    > to count the number of weekdays in 2006 or create a list of holidays
    > and use
    >
    > =NETWORKDAYS(date(2006,1,1),date(2006,12,31),holidays)
    >
    >
    > --
    > daddylonglegs
    > ------------------------------------------------------------------------
    > daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
    > View this thread: http://www.excelforum.com/showthread...hreadid=527355
    >
    >


  4. #4
    Curt
    Guest

    Re: calculate days

    using =datedif(a1,b1,"d") how can we eliminate the error msg if b1 empty or 0
    or 01/01/1099 copy formula down works ok but have error msg in next cell
    first time trying to use dated.
    appreciate this forum. Thanks
    [email protected]
    "daddylonglegs" wrote:

    >
    > No, Excel doesn't have inbuilt holidays due to the differences country
    > to country.
    >
    > You can use
    >
    > =NETWORKDAYS(date(2006,1,1),date(2006,12,31))
    >
    > to count the number of weekdays in 2006 or create a list of holidays
    > and use
    >
    > =NETWORKDAYS(date(2006,1,1),date(2006,12,31),holidays)
    >
    >
    > --
    > daddylonglegs
    > ------------------------------------------------------------------------
    > daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
    > View this thread: http://www.excelforum.com/showthread...hreadid=527355
    >
    >


  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Hi Curt,

    If you want the difference in days between two dates you can use just

    =B1-A1

    format as general

    although to eliminate errors possibly

    =IF(A1*B1,IF(A1<B1,B1-A1,""),"")

  6. #6
    Curt
    Guest

    Re: calculate days

    Thank you for reply. I did make it function by entering zeros in blank cell.
    This gave a date function. Will keep your formula for future reference thanks
    again
    [email protected]

    "daddylonglegs" wrote:

    >
    > Hi Curt,
    >
    > If you want the difference in days between two dates you can use just
    >
    > =B1-A1
    >
    > format as general
    >
    > although to eliminate errors possibly
    >
    > =IF(A1*B1,IF(A1<B1,B1-A1,""),"")
    >
    >
    > --
    > daddylonglegs
    > ------------------------------------------------------------------------
    > daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
    > View this thread: http://www.excelforum.com/showthread...hreadid=527355
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1