Excel Conditional Referencing Problem

New Contributor



I have what is essentially a daily time sheet for employee's. Each sheet is for a day of the week. In one row across the top, I have a series of codes in the format of x.xx.xx. In a column on the Y axis, I have a list of employee names. Essentially, each employee could have hours in any number of codes on the same day. 


What I am trying to do is sum all of the hours worked for each individual code throughout the week in a different sheet.


The problem is that these codes and their locations in that top row change on a weekly basis. Essentially, I need something that can test each cell in that row to see what the code is, and then sum all of the hours underneath it.


I have attached a sample file below. Any help would be appreciated.



4 Replies


do you need to distinguish between RT, OT and DT, or do you just want to lump these together on the Total Hours sheet?

@Hans Vogelaar 


Just trying to lump it all together as a total hours worked for that specific code

best response confirmed by allyreckerman (Microsoft)



In B2 on the Total Hours sheet:




Fill down to B6.

You are a gentleman and a scholar. That worked perfectly. Thanks for your expertise and help.