Formula to Determine Average Hours Worked per Month for People on My Team

lneidorf

Board Regular
Joined
May 20, 2004
Messages
97
Office Version
  1. 365
Platform
  1. Windows
Hi there.

I've spent way too much time on this and am probably overthinking it.

I've got raw data with individual employee time entries. Multiple entries per employee per day. Employees on my team plus employees on other teams are included. There's a column that indicates the team.

What I'm hoping to come up with is a monthly average total hours worked across my team. This way, I can determine who's putting in too many hours and who's putting in too few so that I can rebalance workload accordingly.

I'm including a screenshot with a simplified representation of the raw data and the result I'm looking for. Raw data on the left; Result on the right. Ultimately, I need a formula that yields the results in column J.

Many thanks.
 

Attachments

  • Screen Shot 2022-07-28 at 8.32.07 AM.jpg
    Screen Shot 2022-07-28 at 8.32.07 AM.jpg
    164 KB · Views: 14

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Thank you, Joe4. Unfortunately I won't be able to install this add-in.

And so the best thing I can think to do is to post the data as a table:

DateEmployeeHoursTeam
7/1/2022​
John0.8My Team
7/1/2022​
Paul0.8My Team
7/1/2022​
Mick0.8Other Team
7/1/2022​
Keith0.6Other Team
7/2/2022​
John2.3My Team
7/2/2022​
Paul1.3My Team
7/2/2022​
Mick1.4Other Team
7/2/2022​
Keith0.5Other Team
7/3/2022​
John1.6My Team
7/3/2022​
Paul0.9My Team
7/3/2022​
Mick0.4Other Team
7/3/2022​
Keith0.2Other Team
8/1/2022​
John0.9My Team
8/1/2022​
Paul0.5My Team
8/1/2022​
Mick0.3Other Team
8/1/2022​
Keith2.0Other Team
8/2/2022​
John1.9My Team
8/2/2022​
Paul0.7My Team
8/2/2022​
Mick1.0Other Team
8/2/2022​
Keith0.8Other Team
8/3/2022​
John1.1My Team
8/3/2022​
Paul0.9My Team
8/3/2022​
Mick1.1Other Team
8/3/2022​
Keith2.5Other Team
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
OK, making the following assumptions:
1. Your values in column A are valid dates.
2. You will not have two different years of the same month in the table (i.e. for July, only have July 2022 records in table and not July 2023 records).
3. Your Table name is "Table2" (adjust in formulas to suit)

Here are formulas you can use:

In cell G3:
Excel Formula:
=SUMPRODUCT(--(Table2[Team]="My Team"),--(TEXT(Table2[Date],"mmmm")=$F3),--(Table2[Employee]=G$2),Table2[Hours])
then copy to cell H3

In cell I3:
Excel Formula:
=H3+G3

In cell J3:
Excel Formula:
=AVERAGE(G3:H3)

And then copy these formulas in G3:J3 down all your rows as far as you need.

This yielded for me the exact expected values you show.
 
Upvote 0
OK, making the following assumptions:
1. Your values in column A are valid dates.
2. You will not have two different years of the same month in the table (i.e. for July, only have July 2022 records in table and not July 2023 records).
3. Your Table name is "Table2" (adjust in formulas to suit)

Here are formulas you can use:

In cell G3:
Excel Formula:
=SUMPRODUCT(--(Table2[Team]="My Team"),--(TEXT(Table2[Date],"mmmm")=$F3),--(Table2[Employee]=G$2),Table2[Hours])
then copy to cell H3

In cell I3:
Excel Formula:
=H3+G3

In cell J3:
Excel Formula:
=AVERAGE(G3:H3)

And then copy these formulas in G3:J3 down all your rows as far as you need.

This yielded for me the exact expected values you show.
Thanks so much for this, Joe4.

This is actually more than is required. I included columns G:I to show my calculations, but only care about the result column J. I need just one number per month, restricted to My Team.

I'll play around with what you showed me, but would be grateful for any thoughts you might have.

Many thanks!
 
Upvote 0
Thanks so much for this, Joe4.

This is actually more than is required. I included columns G:I to show my calculations, but only care about the result column J. I need just one number per month, restricted to My Team.

I'll play around with what you showed me, but would be grateful for any thoughts you might have.

Many thanks!
Ok, I got this almost figured out. One last wrinkle: is there a way to adapt your formula to be year-specific? At some point, I do think the raw data will span multiple years, in which case, there will be the same months across years. Thanks again!
 
Upvote 0
Ok, I got this almost figured out. One last wrinkle: is there a way to adapt your formula to be year-specific? At some point, I do think the raw data will span multiple years, in which case, there will be the same months across years. Thanks again!
You will need to include year along with month in your criteria (i.e. a text value of "July 2022" in your heading/criteria), and then amend this part:
Rich (BB code):
--(TEXT(Table2[Date],"mmmm")=$F3)
to share year too, like this:
Rich (BB code):
--(TEXT(Table2[Date],"mmmm yyyy")=$F3)
 
Upvote 0
You will need to include year along with month in your criteria (i.e. a text value of "July 2022" in your heading/criteria), and then amend this part:
Rich (BB code):
--(TEXT(Table2[Date],"mmmm")=$F3)
to share year too, like this:
Rich (BB code):
--(TEXT(Table2[Date],"mmmm yyyy")=$F3)
Fantastic. Thanks so much, @Joe4 !
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,314
Members
449,081
Latest member
tanurai

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top