+ Reply to Thread
Results 1 to 5 of 5

substract two time logs based on a string

  1. #1
    Registered User
    Join Date
    09-10-2008
    Location
    Atlanta
    Posts
    3

    Post substract two time logs based on a string

    I am trying to calculate the amount of time elapsed between two logged events. Column D has the person's ID and column O has the elapsed time. The raw data has multiple ID's but everything is in time numerical order.

    I am trying to get Excel to subtract two time stamps in column O based on the ID in column D. My formula is =SUM(O102-O101). This is assuming that line 101 and 102 is the same ID. It could be o154-o101. I have tried several ways of embedding this in if functions but can't seem to get it to recognize the string correctly or perform the sum function.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    So you want to subtract the time associated with the first occurence of the ID from the time associated with the second?

    Will there only be 2 occurences of the ID? If so try

    =SUMIF(D101:D200,A1,O101:O200)-VLOOKUP(A1,D101:O200,12,0)*2

    where your data is in rows 101 to 200 and A1 contains the ID of interest

  3. #3
    Valued Forum Contributor
    Join Date
    08-26-2008
    Location
    singapore
    Posts
    626

    See the attachment

    Here is a sample. I think it will help you to settle your problem.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    09-10-2008
    Location
    Atlanta
    Posts
    3
    Thanks, Daddylonglegs. I will give this a try.

  5. #5
    Registered User
    Join Date
    09-10-2008
    Location
    Atlanta
    Posts
    3
    Thangs SGLife. This is very helpful.

+ 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. Sorting data based on time intervals
    By moonyboy99 in forum Excel General
    Replies: 6
    Last Post: 07-22-2008, 06:23 AM
  2. Average over different time ranges
    By nasalcherry in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-03-2008, 04:10 PM
  3. Iterate thru sheets in workbook; take action based on text (string) value in cell
    By Trebormac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-02-2007, 10:18 PM
  4. Call passing variables
    By Zrx in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-17-2006, 03:44 PM
  5. Assignment overDUE PLEASE PLEASE HELP!!
    By undergrad in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-29-2006, 12:34 AM

Tags for this Thread

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