Hi all,

Attached file has 3 tabs:
Database
Pivot
Hours

The Database is filled with the shown information in a non-sorted order. Lines will be added daily.
The Pivot is updated automatically and sorted by date.
The Hours is the one that need to be filled automatically based on the data in the Pivot table.

The result is already filled in the Hours tab (blue numbers), but I don't know how to write some VBA that would do this trick. I guess it has to do with some INDEX-MATCH formula?

Additional complication: the table in the Hours tab needs to be dynamic. It can happen that in the Database, there will be projects added to the departments. E.g I have project X added to department 2.
So the table on the Hours tab will need to show that project X as well as soon as it occurs in the Database tab.

Is there any solution on how to create this?
Really appreciate your help in this!

Kind regards,
Peter
hour registration.xlsx