+ Reply to Thread
Results 1 to 4 of 4

Pivot Error Return Number Zero(0)

  1. #1
    Registered User
    Join Date
    12-11-2018
    Location
    Windsir, UK
    MS-Off Ver
    Windows 10
    Posts
    2

    Unhappy Pivot Error Return Number Zero(0)

    Hi All,

    I am new to this site, so hello all.

    I have recently learnt a lot more about excel, mostly via YouTube etc. I am building a semi automated reporting dashboard for my company, this is 95% complete but i have a few basis errors that maybe someone could help me solve?

    I have a weekly data dash that gets data from a pivot table, this works ok but when a week has no values inputted, e.g no complaints for Week 52 due to Christmas for example i get an error as we have nothing to reference. I have overcome this by the below formula:
    =IFERROR(GETPIVOTDATA("ID",'Customer Complaints - Weekly'!$A$6,"Week Number","52"),"0")
    This works well, but i then also want to do a 13 weeks rolling average and this causes issues. I am using this as the 13 Week RA Formula:
    =IFERROR(AVERAGE(D6:P6),"")
    But when it sees a 0 from the Get Pivot formula it doesn't count this in the average as it does not see it a number. So i could have the below numbers
    Week 40 = 1
    Week 41 = 2
    Week 42 = 2
    Week 43 = 2
    Week 44 = 0
    Week 45 = 0
    Week 46 = 2
    Week 47 = 2
    Week 48 = 1
    Week 49 = 3
    Week 50 = 0
    Week 51 = 1
    Week 52 = 0

    The formula will return an average 1.78 (16/9) of but it should be 1.23 (16/13)

    Any help would be appreciated.

    Regards

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,908

    Re: Pivot Error Return Number Zero(0)

    Just don't put the 0 in quotes:

    =IFERROR(GETPIVOTDATA("ID",'Customer Complaints - Weekly'!$A$6,"Week Number","52"),0)
    Rory

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Pivot Error Return Number Zero(0)

    The 0 in your first formula isn't a number, it's a string.

    Try changing that formula to this.

    =IFERROR(GETPIVOTDATA("ID",'Customer Complaints - Weekly'!$A$6,"Week Number","52"),0)

    PS You might also want to look at using AVERAGEIF or SUMIF/COUNTIF to handle the missing value.
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    12-11-2018
    Location
    Windsir, UK
    MS-Off Ver
    Windows 10
    Posts
    2

    Re: Pivot Error Return Number Zero(0)

    Thanks, This worked first time. Very simple but as i say i am learning as i go.

+ 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. Replies: 1
    Last Post: 02-01-2018, 01:42 PM
  2. Replies: 7
    Last Post: 12-06-2015, 05:40 PM
  3. Query date range and ref number match to return another reference number
    By 27paul0 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-09-2015, 07:31 AM
  4. [SOLVED] Return an error if text is inputted rather than a number
    By BladeAP in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-29-2014, 08:21 AM
  5. [SOLVED] How2 find number in range and return that number or if doesn't exist then the next highest
    By Crawfinator1 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-06-2014, 08:52 AM
  6. [SOLVED] To find any 4 digit number and return the same number with desired formating effect.
    By neo4u44 in forum Word Programming / VBA / Macros
    Replies: 3
    Last Post: 04-24-2012, 12:45 AM
  7. Replies: 5
    Last Post: 03-12-2010, 07:33 PM

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