+ Reply to Thread
Results 1 to 2 of 2

Calculation - Calculating Difference in Days

  1. #1
    Forum Contributor
    Join Date
    03-19-2016
    Location
    Chicago, IL
    MS-Off Ver
    Office 2016 Professional
    Posts
    388

    Calculation - Calculating Difference in Days

    Attempting to subtract dates using NETWORKDAYS.

    =NETWORKDAYS(BN2,O2)
    BN2 Value = 07/25/2016
    O2 Value = 07/28/2016
    Returns Value: 1

    Everything seems to be working fine except for the following scenario's:

    I have some illogical data that I would like to exclude:
    =NETWORKDAYS(BO5,BA5)
    BO5: 01/11/2017
    BA5: 11/30/16
    Returns Value: -31
    When I have a negative value, how do I reset that to EITHER
    1) an absolute value of 31
    OR
    2) output a '-1'

    I have another situation where BA is empty, but BO has a value of 12/20/2016.
    The return value is -30517
    Is there a way to return a value of -1 when one of the two values is blank? Otherwise this will skew my results.

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Calculation - Calculating Difference in Days

    you could use an IF statement to test if the values are blank or the result negative and give -1

    =IF( OR( BO5 ="" , BA5 = "", NETWORKDAYS(BO5,BA5)<0 ) ,-1, NETWORKDAYS(BO5,BA5))

    or if you want -31 to 31 - USE ABS()

    =IF( OR( BO5 ="" , BA5 = "" ) ,-1, ABS(NETWORKDAYS(BO5,BA5)))
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

+ 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] Calculating time difference between two days combined with IF formula
    By kj2607 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-30-2014, 06:20 AM
  2. Replies: 4
    Last Post: 07-23-2013, 07:51 AM
  3. time difference calculation between days
    By astrosrini in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 06-25-2012, 06:47 AM
  4. [SOLVED] Calculating difference in working hours between days?
    By ishtar72 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2012, 04:09 AM
  5. Calculating difference between working days
    By jantonio in forum Excel General
    Replies: 4
    Last Post: 09-28-2010, 12:32 PM
  6. Calculating difference between working days?
    By mccrimmon in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-16-2007, 08:33 AM
  7. Calculating time difference between two days capturing the overnight time.
    By Monica_La in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-08-2007, 11:22 AM
  8. i have two days and i want the difference in days, months, year
    By maja in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-21-2006, 08:14 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