Function Problems

Look Up Employee Hours by Date and Weekday in Excel

Aamir Naveed AkramAamir Naveed Akram Nov 18, 2026 869 views

Question details

Create a timesheet that returns an employee's hours for each weekday by matching the employee number and date.

Look Up Employee Hours by Date and Weekday in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
A weekly timesheet needs to display Monday through Friday hours from a separate employee-hours table.
Observed behavior
Each weekday column should show the hours recorded for the matching employee and date, or remain blank when no record exists.
Before you start

Check that your source dates are actual Excel dates without time values and that employee numbers use consistent formats. The lookup solutions assume each employee-date combination appears only once.

Solution 1Recommended

Use XLOOKUP to Return Hours for Each Weekday

Use this approach in Excel versions that support XLOOKUP, such as Microsoft 365 and Excel 2021.

1
Set up the source table

Select the source data and choose Insert > Table. Name the table Tabelle2 on the Table Design tab, and make sure its columns are named Date, employee, and hours.

2
Arrange the timesheet

Enter a Monday week-start date in A2 and an employee number in B2. Label C1 through G1 Monday through Friday.

3
Enter the lookup formula

In C2, enter =IFERROR(XLOOKUP(1,(Tabelle2[[Date]:[Date]]=$A2+COLUMN()-COLUMN($C$2))*(Tabelle2[[employee]:[employee]]=$B2),Tabelle2[[hours]:[hours]]),"").

4
Fill the weekday cells

Drag the fill handle from C2 across to G2. Add more week-start dates and employee numbers below, then fill the formulas down as needed.

Use XLOOKUP to Return Hours for Each Weekday
How the date is selected: The formula adds zero through four days to the Monday date as it is copied across. XLOOKUP returns the first matching record; a missing match produces a blank.
Build your timesheet in WPS

Calculate Weekday Employee Hours in WPS Spreadsheets

Use COUNTIFS and SUMIFS in WPS Spreadsheets to display hours for each employee and weekday, leaving unmatched dates blank.

  1. 1. Enter the source data: In WPS Spreadsheets, create a sheet named Data. Put dates in A2:A1000, employee numbers in B2:B1000, and hours in C2:C1000.
  2. 2. Set up the timesheet: On another sheet, enter the Monday date in A2 and the employee number in B2. Label C1:G1 Monday through Friday.
  3. 3. Enter the hours formula: In C2, enter =IF(COUNTIFS(Data!$A$2:$A$1000,$A2+COLUMN()-COLUMN($C$2),Data!$B$2:$B$1000,$B2)=0,"",SUMIFS(Data!$C$2:$C$1000,Data!$A$2:$A$1000,$A2+COLUMN()-COLUMN($C$2),Data!$B$2:$B$1000,$B2)).
  4. 4. Fill the timesheet: Drag the fill handle from C2 across to G2 and down for other employee-week rows. Expand the source ranges in the formula if your data extends beyond row 1000.
Calculate Monday through Friday hours from employee numbers and datesSum multiple records for the same employee and dateOpen and save Microsoft Excel XLSX filesWork with a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

Why does the lookup return a blank when hours exist?

Check that A2 is the correct Monday, the source dates do not include times, and the employee number in B2 matches the source value and format. Also check that the table and column names in the formula match your workbook.

What happens if an employee has multiple entries on the same date?

XLOOKUP and INDEX/MATCH return the first matching entry. To total multiple entries, use SUMIFS with employee and date criteria, as shown in the WPS recommendation.

Can I use the formulas for another week?

Yes. Enter that week's Monday date in column A and the employee number in column B, then copy the weekday formulas into columns C through G on the same row.

Why does the older Excel formula need Ctrl+Shift+Enter?

Some older Excel versions require that key combination to evaluate the multiplied conditions as an array. Enter the INDEX/MATCH formula in C2 and confirm it with Ctrl+Shift+Enter if ordinary Enter does not work.