+ Reply to Thread
Results 1 to 3 of 3

Count if workdays

  1. #1
    Registered User
    Join Date
    01-05-2012
    Location
    Wisconsin
    MS-Off Ver
    Excel 2010
    Posts
    24

    Count if workdays

    I'm trying to get a message box to appear at the end of my code to count lines that have "N" in a column and that are between today and 15 work days. Could someone help me here? The code keeps returning 0 and there are some.

    MsgBox "Count of Production Within 15 days: " & Worksheets("Holds").Evaluate("Countifs(P:P,""N"",T:T,""< &NOW"",T:T,"">&WORKDAY+16"")")

  2. #2
    Forum Contributor
    Join Date
    03-15-2007
    Location
    AL, USA
    MS-Off Ver
    2007
    Posts
    174

    Re: Count if workdays

    Quote Originally Posted by christopherw34 View Post
    I'm trying to get a message box to appear at the end of my code to count lines that have "N" in a column and that are between today and 15 work days. Could someone help me here? The code keeps returning 0 and there are some.

    Please Login or Register  to view this content.
    Well, I saw a couple of things that looked off, one was that you were looking BEFORE today, and AFTER 16 working days, and workday is a worksheet function
    Here is a suggested fix:
    Please Login or Register  to view this content.
    You'll have to take that logic and apply it to your sheet, but you get the idea. Also, I left your code in there for comparison, just commented it out.
    Last edited by mshale; 06-29-2012 at 10:51 AM. Reason: spelling

  3. #3
    Registered User
    Join Date
    01-05-2012
    Location
    Wisconsin
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Count if workdays

    Thanks! Worked like a charm!

+ 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