• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member
  • Login

GETPIVOT error when column has no data|General Excel Questions & Answers|Excel Forum|My Online Training Hub

You are here: Home / GETPIVOT error when column has no data|General Excel Questions & Answers|Excel Forum|My Online Training Hub

office scripts course

Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumGeneral Excel Questions & Answe…GETPIVOT error when column has no d…
sp_PrintTopic sp_TopicIcon
GETPIVOT error when column has no data
Avatar
roland neault

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
June 13, 2019
sp_UserOfflineSmall Offline
1
June 13, 2019 - 1:12 am
sp_Permalink sp_Print

I am working with a pivot table that represents customer satisfaction. The answer options are 1-5 and DK. The table is formatted with the questions as rows and the responses as the columns. If all columns are present this GPD formula works fine: IF(GETPIVOTDATA("Unique Identifier",$A$3,"Attribute","Overall, how satisfied are you with the Army's Warrior Transition Unit Program?","Value","3.  NEITHER SATISFIED NOR DISSATISFIED")+GETPIVOTDATA("Unique Identifier",$A$3,"Attribute","Overall, how satisfied are you with the Army's Warrior Transition Unit Program?","Value","DK/ REFUSE to ANSWER")>0,GETPIVOTDATA("Unique Identifier",$A$3,"Attribute","Overall, how satisfied are you with the Army's Warrior Transition Unit Program?","Value","3.  NEITHER SATISFIED NOR DISSATISFIED")+GETPIVOTDATA("Unique Identifier",$A$3,"Attribute","Overall, how satisfied are you with the Army's Warrior Transition Unit Program?","Value","DK/ REFUSE to ANSWER"),0)   If there are no responses for DK/ Refuse to Answer the formula returns #ref!. Any ideas on how to get this to work correctly?

sp_AnswersTopicSeeAnswer See Answer
Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4614
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
2
June 13, 2019 - 8:32 am
sp_Permalink sp_Print

Hi Roland,

The GETPIVOTDATA function can only return results if the data is present in the PivotTable, which is why it returns an error when you have no responses for a field.

You can try going into the row or column label 'Field Settings' (right-click the field in the PivotTable) and on the 'Layout & Print' tab of the dialog box choose 'Show items with no values'.

Mynda

Avatar
roland neault

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
June 13, 2019
sp_UserOfflineSmall Offline
3
June 13, 2019 - 1:11 pm
sp_Permalink sp_Print

Thank you for the response. that option is grayed out for columns and rows

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4614
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
4
June 13, 2019 - 3:11 pm
sp_Permalink sp_Print

Hi Roland,

I worked for me, see file attached. Be sure to select a cell in the column labels area before right clicking > Field Settings (not 'Value Field Settings') > Layout & Print tab > 'Show items with no data'.

Mynda

Avatar
Velouria
London or thereabouts
Moderator
Members


Trusted Members

Moderators
Level 4
Forum Posts: 688
Member Since:
November 1, 2018
sp_UserOfflineSmall Offline
5
June 13, 2019 - 6:54 pm
sp_Permalink sp_Print

You can use IFERROR to return 0 for such cases. You can also use an array of criteria and SUMPRODUCT to test multiple options in the same field - for example:

=SUMPRODUCT(IFERROR(GETPIVOTDATA("Unique Identifier",$A$4,"Attribute","Overall, how satisfied are you with the program","Value",{"4. SOMEWHAT SATISFIED","5. COMPLETELY SATISFIED"}),0))

is equivalent to:

=IF(GETPIVOTDATA("Unique Identifier",$A$4,"Attribute","Overall, how satisfied are you with the program","Value","4. SOMEWHAT SATISFIED")+GETPIVOTDATA("Unique Identifier",$A$4,"Attribute","Overall, how satisfied are you with the program","Value","5. COMPLETELY SATISFIED")>0,GETPIVOTDATA("Unique Identifier",$A$4,"Attribute","Overall, how satisfied are you with the program","Value","5. COMPLETELY SATISFIED")+GETPIVOTDATA("Unique Identifier",$A$4,"Attribute","Overall, how satisfied are you with the program","Value","4. SOMEWHAT SATISFIED"),0)

but also handles missing data.

sp_AnswersTopicAnswer
Answers Post
Avatar
roland neault

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
June 13, 2019
sp_UserOfflineSmall Offline
6
June 14, 2019 - 1:32 am
sp_Permalink sp_Print

Thank you Mynda and Velouria, both solutions work. I will be using Velouria's suggested formula.

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4614
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
7
June 14, 2019 - 8:21 am
sp_Permalink sp_Print

Nice formula, Velouria!

Avatar
Velouria
London or thereabouts
Moderator
Members


Trusted Members

Moderators
Level 4
Forum Posts: 688
Member Since:
November 1, 2018
sp_UserOfflineSmall Offline
8
June 14, 2019 - 5:58 pm
sp_Permalink sp_Print

Thanks. 🙂

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Susan VanRiper, Dominic Brosnahan
Guest(s) 9
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 880
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 237
Jessica Stewart: 219
A.Maurizio: 213
Aye Mu: 201
jaryszek: 183
Newest Members:
Herbie Key
Trevor Pindling
Stevan Kanjo
Erin Sheldon
Nikita Bhatia
Sheilah Taylor
Clare Webber
David Jenssen
Dominic Brosnahan
Young You
Forum Stats:
Groups: 3
Forums: 24
Topics: 6526
Posts: 28575

 

Member Stats:
Guest Posters: 49
Members: 32809
Moderators: 2
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel Office Scripts
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook

Sign up to our newsletter and join over 400,000
others who learn Excel and Power BI with us.

 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate
  • Sponsor Our Newsletter

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.