Question

I've got the following data and pivot table:

enter image description here

The Total column in the pivot table is the sum of the following calculated field:

=start-TIME(7, 30, 0)

I know that this calculation is wrong for what I want to achieve. I need to know how much delay I have had on each day to start the work. e.g. on 1-Oct-12, assuming I should have started my work at 7:30, 8:00 - 7:30 which yields 30 minutes delay, 1 hour delay for 2-Oct-12 and 50 minutes for 3-Oct-12.
So my question is, how can I have a calculated field based on only the first row of each group in a pivot table?

Was it helpful?

Solution

I tend to avoid calculated fields and do the calculation in the source data if possible. So in this case I'd add a delay column to your source data, with a calculation that sums the difference only for the first row for each date:

=IF(COUNTIF($A$2:$A2,$A2)=1,B2-TIME(7,30,0),0)

enter image description here

Then you can pivot on the sum of delay. Format the delay pivot field like [h]:mm.

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top