Forum Discussion

OnTheRoad411370's avatar
OnTheRoad411370
Copper Contributor
Jun 25, 2022
Solved

How to get total hours worked when people are not the same on each worksheet

I am trying to figure the total hours that volunteers worked but some work both weeks and some don't. I have a sample workbook but can't figure out how to upload it. I am using Office 365.

This is sample worksheet 1

And this is sample worksheet 2

How can I get a formula to get the cumulative hours for all 6 volunteers? In my real workbook I have about 50 different volunteers and each worksheet is for a school year ((e.g.: 2017-2018, 2018-2019, etc) and obviously different people are on the different years but some overlap, that is Mary might work 2017-2018 and 2018-2019 but Joe only worked 2018-2019.

I hope my question makes sense. I really don't want to hand calculate the cumulative hours for each of the 50!

  • SergeiBaklan's avatar
    SergeiBaklan
    Jun 28, 2022

    OnTheRoad411370 

    We need to add some to the data organization.

    1) Named list of sheets which will be summed is added here

    It could be at any place of your workbook. If you expand the list don't forget to update the rage in Name Manager

    2) Since Total is in different column in different sheets I duplicated it in column AA for each sheet:

    3) With that in Cumulative sheet we may use formula to sum sheets. 

    In C3 is

    =SUMPRODUCT( SUMIF( INDIRECT("'" & sheets & "'!" & "A3:A40"), A3, INDIRECT( "'" & sheets & "'!" & "AA3:AA40") ))

    and drag it down. I used formula exactly as in https://exceljet.net/formula/3d-sumif-for-multiple-worksheets, you may check this post for the explanation how it works.

13 Replies

    • OnTheRoad411370's avatar
      OnTheRoad411370
      Copper Contributor

      SergeiBaklanThank you for helping but I still don't understand how I can get the cumulative hours for people who aren't on the same line on the two worksheets without going through and doing a XLOOKUP one at a time for each person. In my practice sample, Amy is on line 2 in Week 1 Hrs worksheet and line 3 on Week 2 Hrs worksheet. How can I XLOOKUP without going one by one to each worksheet and referencing the name?

Resources