+ Reply to Thread
Results 1 to 7 of 7

using mutiple entries in a calculation

Hybrid View

  1. #1
    Registered User
    Join Date
    11-28-2006
    Posts
    63

    Question using mutiple entries in a calculation

    Hi,

    I'm trying to create a workbook that will calculate times. Currently I have a worksheet that has, for example Incident #1, Date/Time In, and Date/Time Out. At the end of the row it will calculate total time in hours.

    I need to create a second worksheet that will have Incident # to correspond to the incident # on Sheet1, with Date/Time In and Out. However, on this sheet there could be more than one occurance of Incident#1, and multiple times in an out. That total will be deducted from the total of incident#1 on Sheet1.

    The easiest way to explain this would be...say for the sake of argument Sheet1 calculates the duration of a vacation in hours (lets say 168 hours). Sheet2 will calculate how much of that time was spent doing business (lets say 2 hours on day1, 3 hours on day 4). In the end I want to subtract 5 hours from 168 hours giving me 163 actual vacation hours.

    My problem is, I don't know how to go about using the values in multiple rows in Sheet2 that correspond to the row in Sheet1.

    Hopefully this makes sense to more than just me
    Soma
    Last edited by soma104; 02-20-2010 at 12:00 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: using mutiple entries in a calculation

    Could you not conduct a SUMIF on Sheet2 based on Incident # ?

    Subtract the result from your row value on Sheet1.

    (assuming you have a column on Sheet2 that's already calculating the net of the In/Out times of course)

  3. #3
    Registered User
    Join Date
    08-10-2006
    Posts
    58

    Re: using mutiple entries in a calculation

    Am I understanding that sheet 1 has the overall start and finish time, and sheet two has more detailed information, such as the duration of any breaks taken, etc.?

    It sounds like you might be able to get what you are looking for with the SUMIF formula. The arguments are (range to meet the if criteria, if criteria, range to sum). The formula would look something like this...

    =SUMIF(Worksheet2 incident ID column, =specific incident ID cell from worksheet1, Worksheet2 timelapse between in and out column)
    Depending on how your spreadsheet is set up, it will get you the amount of time that was spent either working or not working. If you can't add a column that finds the time lapse time out-time in) for logistical reasons, change the last argument to the "time out" column then in the same formula, subtract off the identical formula with the third argument referring to the "in" column.

    If this doesn't make sense, let me know. If you provide columns that the data sits in, I can make the formula more specific.

  4. #4
    Registered User
    Join Date
    11-28-2006
    Posts
    63

    Re: using mutiple entries in a calculation

    Hi again,

    I guess I'm not quite there yet. I tried the following but it won't work for me.

    =SUMIF(Sheet2!A:A,"=A1",Sheet2!F:F)


    I tried to use the formula on Sheet1 where the main data is. The formula worked when it was in Sheet2, but not in Sheet1.

    Soma

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: using mutiple entries in a calculation

    You don't need the = operator and given the reference A1 is not a literal string it should not be encased within quotations/speech marks.

    =SUMIF(Sheet2!A:A,A1,Sheet2!F:F)

  6. #6
    Registered User
    Join Date
    11-28-2006
    Posts
    63

    Thumbs up Re: using mutiple entries in a calculation

    Thank you again, I made the changes you suggested, and now it works perfectly.

    Soma

  7. #7
    Registered User
    Join Date
    11-28-2006
    Posts
    63

    Re: using mutiple entries in a calculation

    Thank you, and thank you...

    It's exactly what I needed. I am going to try and work it into my formulas. If I have any problems, I'll repost with more detail. But I'm hopeful.

    Soma

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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