+ Reply to Thread
Results 1 to 7 of 7

How do I sum up multiple items for the same field using cell references in GETPIVOTDATA?

  1. #1
    Registered User
    Join Date
    01-02-2014
    Location
    Los Angeles
    MS-Off Ver
    Excel 2013
    Posts
    14

    How do I sum up multiple items for the same field using cell references in GETPIVOTDATA?

    Hi everyone,

    I hope someone here can help me. I want to sum up data for two periods (4&5) from a pivot table using GETPIVOTDATA formula. I've only been successful when I manually type the period values 4 and 5 as is shown below:

    =IFERROR((SUM(GETPIVOTDATA("Amount",'Transaction Pivot'!$J$3,"Period",{4,5},"Project",$A7,"Category","T&M"))),0)

    However, I cannot get the formula to work when I substitute cell references for the period values 4 and 5. Therefore, the following formula does not work:

    =IFERROR((SUM(GETPIVOTDATA("Amount",'Transaction Pivot'!$J$3,"Period",{E5,E6},"Project",$A7,"Category","T&M"))),0) where E5 has 4 in the cell and E6 has 5.

    How can I fix this?

    Thanks!

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,873

    Re: How do I sum up multiple items for the same field using cell references in GETPIVOTDAT

    Are the values in E5/E6 proper numbers, whereas they are text values in your data (or vice versa)?

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    01-02-2014
    Location
    Los Angeles
    MS-Off Ver
    Excel 2013
    Posts
    14

    Re: How do I sum up multiple items for the same field using cell references in GETPIVOTDAT

    I tried both number format and general format. But the thing is if I just refer to one cell, the formula works. However, when I try to sum up the two periods, it does not.

  4. #4
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: How do I sum up multiple items for the same field using cell references in GETPIVOTDAT

    welcome to the forum vanbasten. try SUMPRODUCT.
    =IFERROR(SUMPRODUCT(GETPIVOTDATA("Amt",'Transaction Pivot'!$J$3,"Period",$E$5:$E$6,"Project",A7,"Category","T&M")),0)

    you could also use SUM, but you would need to press CTRL + SHIFT + ENTER to confirm the formula as it is an array formula when you have more than 1 criteria. and by the way, you could upload a sample excel file next time. i had to create a simulation to test & i'm not sure if it's exactly the same.

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  5. #5
    Registered User
    Join Date
    01-02-2014
    Location
    Los Angeles
    MS-Off Ver
    Excel 2013
    Posts
    14

    Re: How do I sum up multiple items for the same field using cell references in GETPIVOTDAT

    Thanks very much! The formula does work. I will definitely post an example next time.

  6. #6
    Registered User
    Join Date
    12-03-2014
    Location
    Delaware
    MS-Off Ver
    2010
    Posts
    2

    Re: How do I sum up multiple items for the same field using cell references in GETPIVOTDAT

    Hello, I am trying to create the same formula discussed in this thread but taking it a step further. I want to reference a specific sub set of "periods" in a list entered on a different tab instead of $e$5:$e$6. I've given the sub-set list a range name called "fixedincome". I've tried replacing $E$5:$e$6 with the range name but cannot get it to work. Is there a way to reference a list on another tab or range name instead of actually listing specific cells on the same sheet with the "GETPIVOTDATA" formula?

    Thanks,
    Brian

  7. #7
    Registered User
    Join Date
    12-03-2014
    Location
    Delaware
    MS-Off Ver
    2010
    Posts
    2

    Re: How do I sum up multiple items for the same field using cell references in GETPIVOTDAT

    Never mind, I figured it out. The "IFERROR" was causing it. The pivot table I was referencing did not have one of the items in my sub-set list so it was returning zero. The range name worked once I changed my range.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. GETPIVOTDATA all or none items in a field
    By tompope84 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-23-2013, 12:38 PM
  2. Excel 2007 : GETPIVOTDATA cell references
    By dblum in forum Excel General
    Replies: 0
    Last Post: 09-28-2011, 11:25 AM
  3. Cell references in GETPIVOTDATA
    By Nekkidbuns in forum Excel General
    Replies: 4
    Last Post: 03-19-2009, 08:50 AM
  4. [SOLVED] getpivotdata having multiple items
    By RoboStat in forum Excel General
    Replies: 1
    Last Post: 05-09-2006, 10:20 PM
  5. Field Bottons & Multiple Items
    By JorgeU in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-29-2005, 03:16 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1