+ Reply to Thread
Results 1 to 5 of 5

Calculate Date Difference with a criteria

  1. #1
    Forum Contributor
    Join Date
    03-24-2009
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2013
    Posts
    137

    Calculate Date Difference with a criteria

    Hi
    I need some help with the following issue:
    A1 - 16-06-2013 15:00
    A2 - 20-06-2013 14:00
    A3 - Formula to calculate difference between dates taking off 10 hours to each day in period
    Result must be 56 hours but I canīt figure how to calculate that

    A little help would be fantastic
    Thank you all in advance

  2. #2
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Calculate Date Difference with a criteria

    Hello
    I make it 55, with the following formula:

    Please Login or Register  to view this content.
    Custom number format cell A3 as:
    Please Login or Register  to view this content.
    .

    Hope this helps.
    DBY

  3. #3
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Calculate Date Difference with a criteria

    Questions for DBY: there are 3 days and 23 hours difference between these two dates. Why would there be 55 hours? Am I missing something?
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,462

    Re: Calculate Date Difference with a criteria

    Quote Originally Posted by AlKey View Post
    Questions for DBY: there are 3 days and 23 hours difference between these two dates. Why would there be 55 hours? Am I missing something?
    OP asked that 10 hrs be deduced for each day in the period

    @ioncila

    Based on post #2, and with this in mind I get 45 hrs including the first and last day =A2-A1-(DATEDIF(A1,A2,"d")+1)*10/24
    or 55 if the first day is omitted for deducing the 10 hrs =A2-A1-DATEDIF(A1,A2,"d")*10/24

    ( I replaced DBY's TIME(..) part by 10/24 which is of course the same )

  5. #5
    Forum Contributor
    Join Date
    03-24-2009
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2013
    Posts
    137

    Re: Calculate Date Difference with a criteria

    Folks, my mistake. Result must be 55 hours:
    16-06-2013 15:00;17-06-2013 15:00 = 24h -10h = 14h
    17-06-2013 15:00;18-06-2013 15:00 = 24h -10h = 14h
    18-06-2013 15:00;19-06-2013 15:00 = 24h -10h = 14h
    19-06-2013 15:00;20-06-2013 14:00 = 23h -10h = 13h
    So, 14*3+13 = 55h
    DBY's formula works perfect.
    @Pepe: Thank you for your approach but DBY's targets what I want.
    Thank you all very much.

+ 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. Calculate average difference between two columns of data [if criteria is met]
    By samcdavies in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-29-2013, 04:56 AM
  2. Macro to Calculate Date Difference
    By Andrew.Trevayne in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-27-2012, 03:42 AM
  3. Calculate Difference between two Date/Time
    By Buks in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-16-2009, 03:06 AM
  4. [SOLVED] Calculate Date Difference
    By AnanthakrishnanK in forum Excel General
    Replies: 12
    Last Post: 04-20-2009, 04:55 AM
  5. Calculate Date Difference
    By vandanavai in forum Excel General
    Replies: 3
    Last Post: 12-28-2006, 10:23 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