+ Reply to Thread
Results 1 to 14 of 14

Counting days issue

Hybrid View

  1. #1
    Registered User
    Join Date
    04-15-2014
    Location
    North Lincs
    MS-Off Ver
    Excel 2010
    Posts
    18

    Counting days issue

    Monitoring Matrix.xlsx

    Hi there

    I need formula help. In column E I have a deadline date and in column F is the actual date the work was done. Column G calculates the difference between the dates to give whether in or out of timescales and red or green is then applied with conditional formatting. However, the issue is that all dates are counted therefore always one to0 many which impacts on the number in column G. Is there a way of adding to the formula in G which is =NETWORKDAYS(E5,F5,holidays) to discount one day? It is made more challenging by the fact that some deadlines are reached before deadline and others are not. As you can see, entries in F that are the same as in E are coming up with 1 not 0 and then flag red.

    I hope you understand what I mean and can help!

    Thanks

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Counting days issue

    I think all you need to do is subtract 1 from That will give you a 0 in G8 and a 2 in G10. NetWorkDays assumes starting and stopping on same day is 1 business day.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Counting days issue

    If you just want to universally decrease the result by one....

    =NETWORKDAYS(E5, F5, holidays) -1

  4. #4
    Registered User
    Join Date
    04-15-2014
    Location
    North Lincs
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Counting days issue

    Hi
    Adding -1 gives me #########

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Counting days issue

    Quote Originally Posted by maddy1980 View Post
    Hi
    Adding -1 gives me #########
    Moi aussi!.

    Seems Networkdays() is somewhat sensitive. I found enclosing it in a second pair of parentheses seemed to cure it!

    Must admit it's not something I've noted before.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  6. #6
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Counting days issue

    Quote Originally Posted by maddy1980 View Post
    Hi
    Adding -1 gives me #########
    That's because it's trying to format as a date and it doesn't like negative numbers. Change the format to "number" or "general" (ie, not "date") and it will be fine.

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Counting days issue

    Hi, and welcome to the forum.

    How about G5

    Formula: copy to clipboard
    =(NETWORKDAYS(E5,F5,holidays))-IF(E5<=F5,1,-1)

  8. #8
    Registered User
    Join Date
    04-15-2014
    Location
    North Lincs
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Counting days issue

    Quote Originally Posted by Richard Buttrey View Post
    Hi, and welcome to the forum.

    How about G5

    Formula: copy to clipboard
    =(NETWORKDAYS(E5,F5,holidays))-IF(E5<=F5,1,-1)
    Oh wow my hero it works! How good are you?!!! I shall seek you out in the future if I need help!

  9. #9
    Registered User
    Join Date
    04-15-2014
    Location
    North Lincs
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Counting days issue

    Ooh there's another part to my problem I almost forgot about. How do I ensure column G is blank until an entry is made in column F? Do I add to =(NETWORKDAYS(E5,F5,holidays))-IF(E5<=F5,1,-1)?

    Many thanks in advance of your wisdom!

  10. #10
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Counting days issue

    One possibility

    =IF(ISNUMBER(F5),NETWORKDAYS(E5,F5,holidays)-1,"")

  11. #11
    Registered User
    Join Date
    04-15-2014
    Location
    North Lincs
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Counting days issue

    Quote Originally Posted by ChemistB View Post
    One possibility

    =IF(ISNUMBER(F5),NETWORKDAYS(E5,F5,holidays)-1,"")
    This changes the number though allows a blank cell. I can't use -1. This was solved further up with =(NETWORKDAYS(E5,F5,holidays))-IF(E5<=F5,1,-1). If this can be incorporated with your formula maybe but I don't know how.

    Thanks

  12. #12
    Registered User
    Join Date
    04-15-2014
    Location
    North Lincs
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Counting days issue

    I've cracked it: =IF(F5<=0,"",(NETWORKDAYS(E5,F5,holidays))-IF(E5<=F5,1,-1)). I will use the reformat of the red conditional formatting suggested by ChemistB.

    Thanks

  13. #13
    Registered User
    Join Date
    04-15-2014
    Location
    North Lincs
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Counting days issue

    And I just used the blanks option in conditional formatting to stop blank cells going red. Thanks one and all for your help. Much appreciated.

  14. #14
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Counting days issue

    You'll then need to modify your conditional formatting for G for RED to a formula
    =AND(ISNUMBER(G5), G5>0)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Number of days till.. Formula for counting number of days
    By Saturn in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-21-2013, 05:46 AM
  2. counting days
    By Xtopher in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-25-2010, 07:29 PM
  3. Replies: 9
    Last Post: 09-03-2007, 08:26 PM
  4. Counting days
    By Crusty in forum Excel General
    Replies: 4
    Last Post: 08-13-2005, 03:05 PM
  5. [SOLVED] Counting days
    By tinkertron in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-06-2005, 03:06 PM

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