Use GETPIVOTDATA for grouped data












2















I have a PivotTable where the rows are values from a field called ID, which is a number, two columns: Light and Humidity, and a set of values Temp. I want to find the max value for Temp over a grouping of IDs. I grouped the IDs from number 1- 100, which encompasses all IDs in the PivotTable, leaving me a PivotTable with a single row of data. In each column I now have the maximum Temp value at a given Light and Humidity value. This is all looking good, until I try to use these max values.



I am trying to use a function like so:



=GETPIVOTDATA("Temp", Controls!$A$15, "Light", 50, "Humidity", 10)


As well as:



=GETPIVOTDATA("Temp", Controls!$A$15, "Light", 50, "Humidity", 10, "ID", "1-100")


But this gives a #REF error.



Prior to grouping the IDs into a single group, I could use a function like:



=GETPIVOTDATA("Temp", Controls!$A$15, "Light", 50, "Humidity", 10, "ID", 1)


And this would correctly return the "Temp" value for ID 1 where the column values match those given in the function.



How can I modify this query to successfully get the value by a grouping of numbers?










share|improve this question



























    2















    I have a PivotTable where the rows are values from a field called ID, which is a number, two columns: Light and Humidity, and a set of values Temp. I want to find the max value for Temp over a grouping of IDs. I grouped the IDs from number 1- 100, which encompasses all IDs in the PivotTable, leaving me a PivotTable with a single row of data. In each column I now have the maximum Temp value at a given Light and Humidity value. This is all looking good, until I try to use these max values.



    I am trying to use a function like so:



    =GETPIVOTDATA("Temp", Controls!$A$15, "Light", 50, "Humidity", 10)


    As well as:



    =GETPIVOTDATA("Temp", Controls!$A$15, "Light", 50, "Humidity", 10, "ID", "1-100")


    But this gives a #REF error.



    Prior to grouping the IDs into a single group, I could use a function like:



    =GETPIVOTDATA("Temp", Controls!$A$15, "Light", 50, "Humidity", 10, "ID", 1)


    And this would correctly return the "Temp" value for ID 1 where the column values match those given in the function.



    How can I modify this query to successfully get the value by a grouping of numbers?










    share|improve this question

























      2












      2








      2








      I have a PivotTable where the rows are values from a field called ID, which is a number, two columns: Light and Humidity, and a set of values Temp. I want to find the max value for Temp over a grouping of IDs. I grouped the IDs from number 1- 100, which encompasses all IDs in the PivotTable, leaving me a PivotTable with a single row of data. In each column I now have the maximum Temp value at a given Light and Humidity value. This is all looking good, until I try to use these max values.



      I am trying to use a function like so:



      =GETPIVOTDATA("Temp", Controls!$A$15, "Light", 50, "Humidity", 10)


      As well as:



      =GETPIVOTDATA("Temp", Controls!$A$15, "Light", 50, "Humidity", 10, "ID", "1-100")


      But this gives a #REF error.



      Prior to grouping the IDs into a single group, I could use a function like:



      =GETPIVOTDATA("Temp", Controls!$A$15, "Light", 50, "Humidity", 10, "ID", 1)


      And this would correctly return the "Temp" value for ID 1 where the column values match those given in the function.



      How can I modify this query to successfully get the value by a grouping of numbers?










      share|improve this question














      I have a PivotTable where the rows are values from a field called ID, which is a number, two columns: Light and Humidity, and a set of values Temp. I want to find the max value for Temp over a grouping of IDs. I grouped the IDs from number 1- 100, which encompasses all IDs in the PivotTable, leaving me a PivotTable with a single row of data. In each column I now have the maximum Temp value at a given Light and Humidity value. This is all looking good, until I try to use these max values.



      I am trying to use a function like so:



      =GETPIVOTDATA("Temp", Controls!$A$15, "Light", 50, "Humidity", 10)


      As well as:



      =GETPIVOTDATA("Temp", Controls!$A$15, "Light", 50, "Humidity", 10, "ID", "1-100")


      But this gives a #REF error.



      Prior to grouping the IDs into a single group, I could use a function like:



      =GETPIVOTDATA("Temp", Controls!$A$15, "Light", 50, "Humidity", 10, "ID", 1)


      And this would correctly return the "Temp" value for ID 1 where the column values match those given in the function.



      How can I modify this query to successfully get the value by a grouping of numbers?







      microsoft-excel pivot-table






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 28 at 18:09









      qwert19qwert19

      155




      155






















          1 Answer
          1






          active

          oldest

          votes


















          1














          In my test it seems that the first number of the group can be used in the GetPivotTable formula, so if the group starts with 4, this formula will return the correct result:



          =GETPIVOTDATA("temp",$H$3,"light",50,"humidity",10,"id",4)


          As an alternative, you could add a helper column to your source data and use a formula that returns the group for each respective ID.



          In the screenshot the upper pivot table uses the "Group" functionality and it is not possible to get a GetPivotData of that. The lower pivot table, however, uses the same grouping, which is achieved by the helper formula in column F.



          ="group "&CEILING([@id]/3,1)


          This allows a single value to cover the group and that single value can be used in GetPivotData.



          =GETPIVOTDATA("temp",$H$10,"light",50,"humidity",10,"group","group 2")


          enter image description here






          share|improve this answer

























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1399368%2fuse-getpivotdata-for-grouped-data%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            In my test it seems that the first number of the group can be used in the GetPivotTable formula, so if the group starts with 4, this formula will return the correct result:



            =GETPIVOTDATA("temp",$H$3,"light",50,"humidity",10,"id",4)


            As an alternative, you could add a helper column to your source data and use a formula that returns the group for each respective ID.



            In the screenshot the upper pivot table uses the "Group" functionality and it is not possible to get a GetPivotData of that. The lower pivot table, however, uses the same grouping, which is achieved by the helper formula in column F.



            ="group "&CEILING([@id]/3,1)


            This allows a single value to cover the group and that single value can be used in GetPivotData.



            =GETPIVOTDATA("temp",$H$10,"light",50,"humidity",10,"group","group 2")


            enter image description here






            share|improve this answer






























              1














              In my test it seems that the first number of the group can be used in the GetPivotTable formula, so if the group starts with 4, this formula will return the correct result:



              =GETPIVOTDATA("temp",$H$3,"light",50,"humidity",10,"id",4)


              As an alternative, you could add a helper column to your source data and use a formula that returns the group for each respective ID.



              In the screenshot the upper pivot table uses the "Group" functionality and it is not possible to get a GetPivotData of that. The lower pivot table, however, uses the same grouping, which is achieved by the helper formula in column F.



              ="group "&CEILING([@id]/3,1)


              This allows a single value to cover the group and that single value can be used in GetPivotData.



              =GETPIVOTDATA("temp",$H$10,"light",50,"humidity",10,"group","group 2")


              enter image description here






              share|improve this answer




























                1












                1








                1







                In my test it seems that the first number of the group can be used in the GetPivotTable formula, so if the group starts with 4, this formula will return the correct result:



                =GETPIVOTDATA("temp",$H$3,"light",50,"humidity",10,"id",4)


                As an alternative, you could add a helper column to your source data and use a formula that returns the group for each respective ID.



                In the screenshot the upper pivot table uses the "Group" functionality and it is not possible to get a GetPivotData of that. The lower pivot table, however, uses the same grouping, which is achieved by the helper formula in column F.



                ="group "&CEILING([@id]/3,1)


                This allows a single value to cover the group and that single value can be used in GetPivotData.



                =GETPIVOTDATA("temp",$H$10,"light",50,"humidity",10,"group","group 2")


                enter image description here






                share|improve this answer















                In my test it seems that the first number of the group can be used in the GetPivotTable formula, so if the group starts with 4, this formula will return the correct result:



                =GETPIVOTDATA("temp",$H$3,"light",50,"humidity",10,"id",4)


                As an alternative, you could add a helper column to your source data and use a formula that returns the group for each respective ID.



                In the screenshot the upper pivot table uses the "Group" functionality and it is not possible to get a GetPivotData of that. The lower pivot table, however, uses the same grouping, which is achieved by the helper formula in column F.



                ="group "&CEILING([@id]/3,1)


                This allows a single value to cover the group and that single value can be used in GetPivotData.



                =GETPIVOTDATA("temp",$H$10,"light",50,"humidity",10,"group","group 2")


                enter image description here







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Jan 28 at 19:02

























                answered Jan 28 at 18:56









                teylynteylyn

                17.3k22539




                17.3k22539






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Super User!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1399368%2fuse-getpivotdata-for-grouped-data%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Probability when a professor distributes a quiz and homework assignment to a class of n students.

                    Aardman Animations

                    Are they similar matrix