+ Reply to Thread
Results 1 to 3 of 3

Calculate Time Difference If With Multiple Criteria

  1. #1
    Registered User
    Join Date
    04-26-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Calculate Time Difference If With Multiple Criteria

    I'm trying to calculate the difference in time between two times if certain criteria are met.
    I want to calculate the time difference between a DP Activity Status by Tom Smith and the most recent prior CF or RC activity status by anyone other than Tom Smith on the same order.

    Results would look something like this…
    4 Columns of data (A:D) – Formula in 5th column (E)
    A---------------B-------------------C--------------D---------------------E
    Order #-------Activity Status----Worked By----Time-----------------Time to DP
    80001234----AC------------------Mike Fox------1/2/14 7:53am----
    80001234----ER------------------Mike Fox-------1/2/14 9:02am----
    80001234----RP------------------Mike Fox-------1/2/14 9:15am----
    80001234----CF------------------Mike Fox-------1/2/14 10:30am----
    80001234----DP------------------Tom Smith----1/2/14 12:30pm----2:00
    80001234----AC------------------Brain Jones----1/2/14 2:21pm----
    80001234----RC------------------Brian Jones----1/2/14 2:54pm----
    80001234----DP------------------Tom Smith----1/2/14 3:35pm------0:41
    80001235----RC------------------Lisa Bond------1/5/14 9:17am----
    80001235----DP------------------Allen Miller----1/5/14 10:01am----
    80001235----RC------------------Jerry Monk----1/5/14 10:15am----
    80001235----DP------------------Tom Smith----1/5/14 10:20am----0:05
    80001235----CF------------------Mike Fox-------1/5/14 12:05pm----
    80001235----DP------------------Allen Miller----1/5/14 12:30pm----
    Last edited by gotsomekorn; 02-04-2014 at 10:58 AM. Reason: Board Member Suggestion

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Calculate Time Diff If Multiple Criteria Met - PLEASE HELP - NEED FOR WORK REPORT

    I did it with:

    E3:

    =IF(A3&B3="DPTOM",C3-LOOKUP(2,1/(($A$2:A2="CF")+($A$2:A2="RC"))*($B$2:B2<>"TOM"),$C$2:C2),"")

    But you'll need to insert spaces between the times and the meridiem. And I'd recommend changing your post title, so that it's more search engine friendly and less screamy.
    Last edited by daffodil11; 02-03-2014 at 07:07 PM.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Registered User
    Join Date
    04-26-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Calculate Time Difference If With Multiple Criteria

    Thanks for your help! I can't seem to get your formula to work.
    Last edited by gotsomekorn; 02-06-2014 at 01:06 PM.

+ 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. Replies: 0
    Last Post: 01-31-2014, 07:39 AM
  2. Replies: 2
    Last Post: 06-06-2012, 07:12 AM
  3. Calculate time diff in yyyy-mm-dd-hh:mm format
    By PooH in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-09-2011, 01:06 PM
  4. Replies: 1
    Last Post: 10-22-2009, 05:26 PM
  5. [SOLVED] aps3 calculate diff in time and cinvert into another format
    By abe in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-26-2006, 04:00 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