Oct 30 2021 03:58 PM - edited Oct 30 2021 04:00 PM
Hello,
I'm having trouble getting GETPIVOTDATA to work with Time values.
First, pivot table doesn't recognize time values so I needed to convert them to general format in my data source and base my pivot table on that.
I have got 9 different time values starting from 08:00 to 16:00
08:00 doesnt work and 09:00 does work. I don't know why. Can you help me out?
I'm attaching a dummy template.
Thanks.
Oct 31 2021 12:45 AM
Solution@kheldar The data you provided is full with #REF errors, probably referring to real employee names that you deleted (though they still show up when you try to filter the pivot table) and replaced by "Employee 1", "Employee 2" etc. None of these fake employees seem to have time records in the span from 8-16, so I changed some of the #REFs to "Employee 1". And to make the GETPIVOTDATA to work, I changed the timestamps in "hours1" to texts with formula:
=TEXT([@hours],"00")&":00"
Then, I also changed the time labels in A4:A12 in the "Morning" table to plain text. This is the result:
The numbers, obviously make no sense because I just picked some time entries for each hour and assigned those to Employee 1. But the formula works.
Having done all that, I just wonder why you don't use one or more pivot tables to do the summarisations for you, without complicated formula. A simple PT (with a filter on the time stamp) could result in this:
Same result, just looking a bit different. Up to you.
Oct 31 2021 12:45 AM
Solution@kheldar The data you provided is full with #REF errors, probably referring to real employee names that you deleted (though they still show up when you try to filter the pivot table) and replaced by "Employee 1", "Employee 2" etc. None of these fake employees seem to have time records in the span from 8-16, so I changed some of the #REFs to "Employee 1". And to make the GETPIVOTDATA to work, I changed the timestamps in "hours1" to texts with formula:
=TEXT([@hours],"00")&":00"
Then, I also changed the time labels in A4:A12 in the "Morning" table to plain text. This is the result:
The numbers, obviously make no sense because I just picked some time entries for each hour and assigned those to Employee 1. But the formula works.
Having done all that, I just wonder why you don't use one or more pivot tables to do the summarisations for you, without complicated formula. A simple PT (with a filter on the time stamp) could result in this:
Same result, just looking a bit different. Up to you.