Forum Discussion

lukesi's avatar
lukesi
Copper Contributor
Dec 27, 2025

Calculate hours using pivot table

Hi,

Im making a personell planning sheet and I want to calculute the hours each teacher is teaching using a pivot table. My data is formatted in 2 tables like this (simplified):

LessonHoursTeacher 1Teacher 2
Lesson 12Paul 
Lesson 23Pete 
Lesson 32PaulPete
TeacherMax working hours
Paul10
Pete15

Now its easy to create an overview of how many hours each teacher is teaching with one teacher collumn.

But it need to calculate the hours based on 2 collumns like this:

  • Paul -> Lesson 1 + Lesson 3 = 4 hours
  • Pete -> Lesson 2  + Lesson 3 = 5 hours

Then the next step is to use a metric or KPI to calculate if the teacher is exceeding their max working hours.

I hope someone can help me out with this...

Thanks!

1 Reply

  • An alternative could be Power Query that works in Excel 2013 and more recent versions of Excel. In the attached file you can add data to the blue dynamic tables. Then you can click in any cell of the green table and right-click with the mouse and select refresh to update the green result table.

    The data layout in the screenshot and in the attached file is for illustration. You can place the green result table in another worksheet and the blue tables horizontally.

     

Resources