+ Reply to Thread
Results 1 to 5 of 5

Formula to Count weekdays only - excluding Holidays, too

  1. #1
    Registered User
    Join Date
    02-08-2010
    Location
    Madison, Wisconsin
    MS-Off Ver
    Excel 2007
    Posts
    47

    Formula to Count weekdays only - excluding Holidays, too

    I need some help tweaking a formula (version 2007) that counts working days each month. I have it working so far except I can get it to omit holidays. I have a list of holidays on separate tab that can be referenced.

    Anyway, easiest thing is to attach the spreadsheet. I need help with the column G formula. It doesn't double count the Holidays, but I would strongly prefer the have the cell blank (or even out an "H" in the cell) if that days is one of the Holidays.

    Thanks in advance for any help.
    Attached Files Attached Files

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Formula to Count weekdays only - excluding Holidays, too

    add another if
    =IF(COUNTIF(HOLIDAYS!$C$4:$C$14,A5),"h",IF(OR(F5="Sat",F5="Sun")," ",SUMPRODUCT(--(WEEKDAY(A5+1-ROW(INDIRECT("1:"&DAY(A5))),2)<6),--ISNA(MATCH(A5+1-ROW(INDIRECT("1:"&DAY(A5))),HOLIDAYS!$C$4:HOLIDAYS!$C$14,0))))
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    02-08-2010
    Location
    Madison, Wisconsin
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Formula to Count weekdays only - excluding Holidays, too

    Thanks, Martin! That's perfect. I figured it would be relatively simple for someone who know what to do. I tried something along these lines before, but couldn't get it to work - I was missing the COUNTIF function.

    I think I'll enjoy a mojito in your honor!

  4. #4
    Registered User
    Join Date
    02-08-2010
    Location
    Madison, Wisconsin
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Formula to Count weekdays only - excluding Holidays, too

    Pardon my ignorance on these things. But I have a follow up question for this same spreadsheet.

    I need a formula in another column that uses the last work day or next to last work day in each month and returns a value (say 1) if this is true.

    Thank you!!!

  5. #5
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Formula to Count weekdays only - excluding Holidays, too

    Hi Joel, perhaps the formula provided at the end of this thread will help?

    http://www.excelforum.com/excel-gene...iness-day.html

+ 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