+ Reply to Thread
Results 1 to 7 of 7

GETPIVOTDATA - Can you reference subtotals?

  1. #1
    Registered User
    Join Date
    09-12-2016
    Location
    California
    MS-Off Ver
    2013 (15.0.4719.1002)
    Posts
    8

    Question GETPIVOTDATA - Can you reference subtotals?

    Hi there, I hope I can explain this well... I've attached a portion of a Pivot table I have below. For the purpose of confidentiality, I've blurred out quite a bit but I believe there is enough there you'll be able to understand what I'm trying to do.

    The first tab in my workbook is the pivot. I have a second tab that is essentially a copy of my raw data with "AccountName" in column A. In the next column I want to pull the "Total Sum of Premium Estimated" for that "AccountName" where at least one LineStatusCode is "NEW" within that "AccountName" - I'm perfectly fine getting a result of "#REF" if that particular AccountName doesn't have a "LineStatusCode" of "NEW" but if it DOES have that line status, then I need it to show the TOTAL "Sum of PremiumEstimated" (NOT the Sum for that particular line status). Is this possible?? (I have a very basic understanding of Excel, so please be gentle)

    Referring to my sample data, if my second tab has A1 showing the Account Name of "Ra", I want A2 to pull in "$09.06" in such a way that I can just copy the formula down. So for "As" it would pull in #REF because there is no LineStatusCode of "NEW" for that Account.

    Attachment 480004
    Attached Images Attached Images
    Last edited by Cortney306; 09-12-2016 at 07:42 PM. Reason: Wrong attachment

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: GETPIVOTDATA - Can you reference subtotals?

    Hi,

    Using the layout from your picture, where the first instance of Ra is in A5, your formula might be

    =IF(ISERROR(GETPIVOTDATA("Sum of Premiumestimated",$A$4,"Accountname",A5,"lookupcode",B5,"linestatuscode","NEW")),"",GETPIVOTDATA("Sum of Premiumestimated",$A$4,"Accountname",A5,"lookupcode",B5))
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Registered User
    Join Date
    09-12-2016
    Location
    California
    MS-Off Ver
    2013 (15.0.4719.1002)
    Posts
    8

    Re: GETPIVOTDATA - Can you reference subtotals?

    Thanks for the response! Unfortunately it isn't working. But I'm fairly certain that's because I'm not correctly updating the formula to account for the results coming into a different tab.

    What I mean by that is I have a second tab with headers: A1 is "AccountName" and B1 is "Total Account Premium" - The formula in B2 should be looking for A2's match in the pivot and returning the Sum of PremiumEstimated where it finds a LineStatusCode of "NEW". If there is NOT a LineStatusCode of "NEW" it can return #REF, I'm not worried so much about the IFERROR portion.

    At this point, an acceptable but not as effective alternative would be to bring in the Sum of PremiumEstimated for that LineStatusCode, rather than the Subtotal for that AccountName.

    Knowing the two tab issue, what would the formula look like? Pivot tab is "More than 50k" and the tab where the formula will reside is "Account List"
    Attached Images Attached Images

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: GETPIVOTDATA - Can you reference subtotals?

    Assuming the same pivot layout as suggested by your first picture

    =IF(ISERROR(GETPIVOTDATA("Sum of Premiumestimated",'More than 50k'!$A$4,"Accountname",A2,"linestatuscode","NEW")),"",GETPIVOTDATA("Sum of Premiumestimated",'More than 50k'!$A$4,"Accountname",A2))

    However I do feel a sample workbook would remove much of the guesswork.

  5. #5
    Registered User
    Join Date
    09-12-2016
    Location
    California
    MS-Off Ver
    2013 (15.0.4719.1002)
    Posts
    8

    Re: GETPIVOTDATA - Can you reference subtotals?

    I figured out my alternative: =GETPIVOTDATA("PremiumEstimated",'More than 50k'!A3,"LineStatusCode","NEW","AccountName",A2)

    Now how can I adjust this formula to make it pull in the AccountName Subtotal, rather than the PremiumEstimated for that LineStatusCode only?

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: GETPIVOTDATA - Can you reference subtotals?

    Try my last suggestion. It appears it should work from your latest formula.

  7. #7
    Registered User
    Join Date
    09-12-2016
    Location
    California
    MS-Off Ver
    2013 (15.0.4719.1002)
    Posts
    8

    Thumbs up Re: GETPIVOTDATA - Can you reference subtotals?

    Yes, it worked! Thank you!!!

+ 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 to reference cell
    By ARayburn in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 07-12-2013, 06:31 AM
  2. Cell Reference of GetPivotData
    By bulldawg15 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-08-2007, 05:33 AM
  3. GETPIVOTDATA() with relative reference
    By Sune Fibaek in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-11-2006, 10:50 AM
  4. [SOLVED] GETPIVOTDATA using a reference for field name
    By Rayo K in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-16-2006, 05:25 PM
  5. [SOLVED] GETPIVOTDATA - return cell reference, not value
    By Slider in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 PM
  6. GETPIVOTDATA - return cell reference, not value
    By Slider in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 09:05 AM
  7. GETPIVOTDATA - return cell reference, not value
    By Slider in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 AM
  8. GETPIVOTDATA - return cell reference, not value
    By Slider in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM

Tags for this Thread

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