+ Reply to Thread
Results 1 to 10 of 10

Sum up date difference between multiple dates

  1. #1
    Registered User
    Join Date
    01-23-2022
    Location
    U.S.
    MS-Off Ver
    Microsoft Office Professional Plus 2019
    Posts
    3

    Sum up date difference between multiple dates

    Hello, everyone!

    I am trying to come up with a formula to calculate the total number of days derived from multiple date differences.

    I have 2 columns: Submitted Date (column J) and Closed Date (column L). Unfortunately, I cannot add any more columns to calculate individual difference per line, as the data will be coming from an auto-generated Excel spreadsheet in a format like the snapshot below:

    snapshot.jpg

    So far, the best I could come up with is this:
    =IF(OR([exported.xlsx]Sheet1!$L$4="", [exported.xlsx]Sheet1!$J$4=""),"", DATEDIF([exported.xlsx]Sheet1!$J$4, [exported.xlsx]Sheet1!$L$4, "d"))
    But this only calculates the days between a single set of 2 dates.

    I am really hoping there's a way to indicate an entire range and plus all the days up in a single formula.

    Thank you very much in advance!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,509

    Re: Sum up date difference between multiple dates

    You can probably use SUMPRODUCT.


    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    01-23-2022
    Location
    U.S.
    MS-Off Ver
    Microsoft Office Professional Plus 2019
    Posts
    3

    Re: Sum up date difference between multiple dates

    Quote Originally Posted by TMS View Post
    You can probably use SUMPRODUCT.

    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file.
    Thank you, you're right! Attaching a sample workbook. Sheet1 contains sample data, Sheet2 contains what the outcome of the formula should show.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    3,228

    Re: Sum up date difference between multiple dates

    I don't know if this will work on V2019. It works for MS365. You may have to press Shift, Ctrl, and Enter at the same time.

    =SUM(IF(Sheet1!$L$2:$L$30="","",ROUND(Sheet1!$L$2:$L$30-Sheet1!$J$2:$J$30,0)))

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,509

    Re: Sum up date difference between multiple dates

    Try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,509

    Re: Sum up date difference between multiple dates

    Think that would have to be
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,509

    Re: Sum up date difference between multiple dates

    And, just for fun, if you have an Excel 365 subscription:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,509

    Re: Sum up date difference between multiple dates

    Is this resolved now?

  9. #9
    Registered User
    Join Date
    01-23-2022
    Location
    U.S.
    MS-Off Ver
    Microsoft Office Professional Plus 2019
    Posts
    3

    Re: Sum up date difference between multiple dates

    Hello everyone! Thank you very much for your help!

    Ended up going with a variation of =SUMPRODUCT(--(L2:L30<>"")*(INT(L2:L30)-INT(J2:J30))) -

    Greb11: much appreciate your formula. The result of it was a bit off, possibly due to rounding, as I have several thousand lines involved in calculation. Similar was with TMS's second solution.

    Again, thank you both! It was super quick! Marked the thread as resolved!

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,509

    Re: Sum up date difference between multiple dates

    You're welcome. Thanks for the rep.

+ 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] Difference Between Dates in Days When One Date is Blank
    By Alewis06 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-10-2021, 10:16 AM
  2. Replies: 1
    Last Post: 09-21-2020, 07:35 AM
  3. Calculating Difference Between Two Dates (over multiple years via months)!
    By andyberger87 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-29-2019, 12:03 AM
  4. [SOLVED] How to calculate date difference between two dates with its related unique ID.
    By JayeshG in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-27-2018, 12:55 PM
  5. Fill series of dates with a difference of days upto a specific date
    By green369 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-28-2017, 06:07 AM
  6. Difference between two dates based on date and hour
    By cmorten82 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-25-2015, 12:09 PM
  7. Calculating difference in date between 2 columns of dates
    By DKerr in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 11-08-2010, 05:04 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