My company got the timesheet of all employees in a google sheet where each employee registers their time. Each employee has his separated sheet with the same columns (Date, Time, Project and Notes) and the name of the sheet is the name of the employee.
I did a query function of all sheet to return all hours register to a project in a time period and the query returns all hours (lines) reported by the employees.
=Query({employee1!A2:F;employee2!A2:F;employee3!A2:F;employee4!A2:F};"select * where Col2 Matches '"&I1&"' and Col1>=date '" & Text (L1;"yyyy-mm-dd")&"'and Col1<=date '" & Text (M1;"yyyy-mm-dd")&"'")
But I need to also know the employee that register that time that is the sheet name. So, my question: how I add the sheet name in the query, so it returns the name of the employee that reported the time on that project? For each row I must add the employee.
Here is an example: https://docs.google.com/spreadsheets/d/1rgA1aygOhaLQ7WP8wUjr5YCEENDQqJpFR3cSXhLSvJw/edit?usp=sharing
Thanks in advance for your time and be safe.
