Using punch clock data, I am trying to count how many employees are clocked in during each specified hour. Don't want just a total count by hour, need it very granular in order to pivot/report off of the data to analyze shift times, by manager.
The problem I have is that the data varies by employee. Some have 1 punch in, 1 out. Some have 2-3 punches in/out. Some have 2 in, 1 out. I am trying to run a formula on each row of data which represents one day of punches for a specific employee, and have it give me an 1 in a column corresponding with each hour of the day, and that can handle empty cells. Here's what I have so far:
In N2, I have the following formula: =IF(OR(AND(N$1>=HOUR($B2),N$1<=HOUR($D2)),AND(N$1>=HOUR($F2),N$1<=HOUR($H2)),AND(N$1>=HOUR($J2),N$1<=HOUR($L3)),1,"")
It counts most of the data correctly, but I am still getting random 1's in columns that don't meet the criteria, and not in others that do.
I tried the solutions described here and here, but I'm not sure how to format them for multiple ranges, or to account properly for empty cells.
I don't know how to get there without either an unwieldy formula or an array, and either way, I am flummoxed. Please help!![]()
Bookmarks