+ Reply to Thread
Results 1 to 2 of 2

Difference in Dates Calculation

Hybrid View

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

    Difference in Dates Calculation

    Hello -

    See the attached .xls.

    I would like assistance in calculating the difference in calendar days for two scenario's:

    TT Credit Date 1 (Column D):
    Subtract Column A (Ship Date 1) - Column C (Credit Date); output the expected value in Column D ('TT Credit Date 1')
    - If 'Credit Date' has a date prior to 'Ship Date 1', output a '-1' in Column D.
    - If 'Ship Date 1' OR 'Credit Date' are blank, output a '-2' in Column D.

    TT Credit Date 1 (Column E):
    Subtract Column B (Ship Date 2) - Column C (Credit Date); output the expected value in Column E ('TT Credit Date E')
    - If 'Credit Date' has a date prior to 'Ship Date 2', output a '-1' in Column E.
    - If 'Ship Date 2' OR 'Credit Date' are blank, output a '-2' in Column E.

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Difference in Dates Calculation

    This
    If 'Credit Date' has a date prior to 'Ship Date 1', output a '-1' in Column D.
    Seems to be a condtradiction to the original subraction
    Subtract Column A (Ship Date 1) - Column C (Credit Date)
    Do you perhaps have that backwards ?
    Going by your manual entries in D2:D4, I think you meant if A is prior to C then -1.
    Same for Scenario 2

    Try this in D2 and filled right/down
    =IF(OR(A2="",$C2=""),-2,MAX(-1,A2-$C2))

+ 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. Time difference calculation (+mm:ss.00)
    By luchian in forum Excel General
    Replies: 9
    Last Post: 04-04-2019, 11:54 PM
  2. [SOLVED] Displaying difference between dates based on outcome of calculation
    By SilvM in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-20-2017, 01:58 AM
  3. date difference calculation
    By mubashar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-29-2014, 01:15 AM
  4. Replies: 4
    Last Post: 07-23-2013, 07:51 AM
  5. [SOLVED] Data difference calculation
    By jimmyqwerty in forum Excel General
    Replies: 6
    Last Post: 08-22-2012, 09:03 PM
  6. Accurate calculation of the difference between two dates
    By marcyspark in forum Excel General
    Replies: 30
    Last Post: 09-02-2011, 10:08 AM
  7. Time difference calculation
    By Sasha in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-22-2006, 12:55 AM

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