+ Reply to Thread
Results 1 to 16 of 16

GETPIVOTDATA - giving me a major headache

  1. #1
    Registered User
    Join Date
    09-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    9

    Exclamation GETPIVOTDATA - giving me a major headache

    So, I have a workbook with several tables, pivot tables, and pivot charts. The main table is for data entry, there is a pivot table that summarizes this data into weekly totals, and a second table that looks at the pivot data to do some additional calculations and charting. The second table uses the GETPIVOTDATA function, and it is here that the problem starts...it will #REF for various items (sometimes 3, sometimes 9); and I can't for the life of me figure out the rhyme or reason as to which numbers are recognized and which are not recognized. Let's say that item "3" is generating a #REF, but the pivot table has data for this item. Doing a "dummy check" and typing "=" and clicking on the cell in the pivot table gives a #REF, but when you select the formula and change the ITEM ("3") to the cell reference (A11) it works.

    Makes me think that the issue is formatting but I looked at the source data and they are whole numbers.

    GRRRRR! Thanks in advance!

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: GETPIVOTDATA - giving me a major headache

    Hi Custom63willys,

    I guess you need to first understand the getpivotdata in detail.

    GETPIVOTDATA(data_field, pivot_table, [field1, item1, field2, item2], ...)

    and you know what... you can give the references to above syntax par via a cell.

    Check the hierarchy of the data where you are getting error and you'll find the issue... thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: GETPIVOTDATA - giving me a major headache

    if your field uses custom subtotals instead of automatic you can get that error. it is unlikely to be syntax if the formula produced automatically by excel returns an error! ;-)
    Last edited by JosephP; 09-19-2012 at 10:02 AM.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  4. #4
    Registered User
    Join Date
    09-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: GETPIVOTDATA - giving me a major headache

    Thanks for the responses. DILIPandey, I am not sure I am tracking you – I understand how the function works, and routinely use it successfully. Problem restated - if I select an empty cell, type the equals symbol (“=”) and then click a cell in the pivot table, it should return that value, and auto populate the getpivotdata function. This does not work. The “item” automatically fills in as “3” but yields a #REF. if I change “3” to “A9” (in this case) it will work. So, for some reason, the “3” is not a “3.” The other anomaly is that it is not always the same number(s) that are not recognized – sometimes “3” works and “8” does not.

    ScreenHunter_55 Sep. 19 06.40.jpg

  5. #5
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: GETPIVOTDATA - giving me a major headache

    may have to eat crow here-if you replace the 3 in the formula with "3" does it work?

  6. #6
    Registered User
    Join Date
    09-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: GETPIVOTDATA - giving me a major headache

    JP,
    I wish it was that simple. Tried the quotes. See the attached image of item 2, which works without quotes.ScreenHunter_55 Sep. 19 09.00.jpg

  7. #7
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: GETPIVOTDATA - giving me a major headache

    I can see that item 2 worked without quotes-did you try them around the 3?
    if you could post a workbook it would make life a lot simpler
    if your source data were a 3 entered as text your pivot table would look like that but you would have to use "3" in the getpivotdata formula instead of 3
    Last edited by JosephP; 09-19-2012 at 12:15 PM.

  8. #8
    Registered User
    Join Date
    09-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: GETPIVOTDATA - giving me a major headache

    I did try the quotes around the 3 ("3"), and it did not work. Additionally, I cannot use quotes because they would break the original formula which uses a named cell from a table (Table26[[#This Row],[Week Number]]). Unfortunately I cannot post the workbook - it is large and the info contained is confidential. In the example the week munber is 3.

  9. #9
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: GETPIVOTDATA - giving me a major headache

    can you group that field in the pivot table or do you get a 'cannot group that selection' message?

  10. #10
    Registered User
    Join Date
    09-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: GETPIVOTDATA - giving me a major headache

    That option is not available in the values area, and it gives the error for the row label. If I change the row label to a date, it will let me group - but then the getpivotdata function would have to be redone. This would introduce a new problem, in that the workbook has to work with any start date.

    C63

  11. #11
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: GETPIVOTDATA - giving me a major headache

    if you can't group then your data-or at least some of it-is in fact text for some reason. i reckon you oughta start by checking for trailing spaces or invisible characters in the source data.

  12. #12
    Registered User
    Join Date
    09-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: GETPIVOTDATA - giving me a major headache

    I went to the source data and entered the number 3 in place of the formula that figures out the number and it did not work. The integer function should return a whole number every time...Also cleared the cache and deleted / recreated the table.

    =IF(Table13[[#This Row],[Calendar Week number]]="","",IF(Table13[[#This Row],[Entry Date]]=MinBTDate,1,INT(DAYS360(MinBTDate,Table13[[#This Row],[Entry Date]],)/7)+1))

  13. #13
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: GETPIVOTDATA - giving me a major headache

    without a workbook I'm afraid I'm out of ideas

  14. #14
    Registered User
    Join Date
    09-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: GETPIVOTDATA - giving me a major headache

    Thanks for trying, wish I could post it.

  15. #15
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: GETPIVOTDATA - giving me a major headache

    can you censor the other data and remove any unneeded sheets?

  16. #16
    Registered User
    Join Date
    09-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: GETPIVOTDATA - giving me a major headache

    Unfortunately the workbook is so interlinked it would be impossible to remove any sheets. I could fill it with dummy data, but would still have issues with intellectual property.

    That being said, I know first hand how difficult it can be to troubleshoot something you can't see or work with.

    On the positive side, I added Round() in front of INT() and now it works...now sure why the integer function was not returning a whole number, but hey I am half way out of the woods.

    C63

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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