So I'm making a punch in/out dashboard in google sheets. It uses a google form to populate a sheet with my employees punches like so:
Timestamp | Name | Punch Type | Time
6/2/2020 15:09:55 | Bob | 1. Start Shift | 7:30:00 AM
6/2/2020 15:10:45 | Bob | 2. Start Lunch | 11:00:00 AM
6/2/2020 15:11:08 | Bob | 3. End Lunch | 11:30:00 AM
6/2/2020 16:01:04 | Bob | 4. End Day | 4:00:00 PM
...
I then used this source data to make a pivot table that looks like this:
AVERAGE of Time | Punch Type
Name | 1. Start Shift | 2. Start Lunch | 3. End Lunch | 4. End Day
Bob | 7:30:00 AM | 11:00:00 AM | 11:30:00 AM | 4:00:00 PM
...
In this pivot table, I want to add a column at the end that is a calculated field of
("4. End Day" - "1. Start Shift") - ("3. End Lunch" - "2. Start Lunch")
.
I'm encountering two road blocks here. First is when I go to add a calculated field in the pivot table editor panel, it creates 4 new columns instead of just one:
| Punch Type | Values
| 1. Start Shift | 2. Start Lunch | 3. End Lunch | 4. End Day
Name | AVERAGE of Time.. | AVERAGE of Time.. | AVERAGE of Time.. | AVERAGE of Time..
Bob | 7:30:00 AM | 0 | 11:00:00 AM | 0 | 11:30:00 AM | 0 | 4:00:00 PM | 0
...
I the second issue is I can't figure out of to reference the columns with the timestamps to do this calculation.
Basically my end goal is a pivot table that looks like this:
AVERAGE of Time | Punch Type
Name | 1. Start Shift | 2. Start Lunch | 3. End Lunch | 4. End Day | Total Hours
Bob | 7:30:00 AM | 11:00:00 AM | 11:30:00 AM | 4:00:00 PM | 8.0
...
Displayed below is how I have my Pivot Table settings in the Pivot Table Editor Panel, before I attempt to add the calculated field