• 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
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

GetPivotData formula to automate region to region and month to month |General Excel Questions & Answers|Excel Forum|My Online Training Hub

You are here: Home / GetPivotData formula to automate region to region and month to month |General Excel Questions & Answers|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
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…GetPivotData formula to automate r…
sp_PrintTopic sp_TopicIcon
GetPivotData formula to automate region to region and month to month
Avatar
MITUL PARIKH
Member
Members
Level 0
Forum Posts: 68
Member Since:
December 8, 2017
sp_UserOfflineSmall Offline
1
June 12, 2018 - 6:26 am
sp_Permalink sp_Print sp_EditHistory

                  Good morning , friend

                     How are you ?

           In workbook attached below , in DATA FOR 2015,  PIV. TAB. worksheet  like to learn  (If possible), Excel automatically change from North to South 
           for Jan, then, change automatically from Jan to Feb, and  gives amounts for both North & South for Feb  , then, change automatically from Feb to 
            Mar &  gives amounts for both  North & South.  
                           

      Before few days ,  I also sent same post from Firefox browser, but  I cannot find  that post today. .  So, I am sorry that I  am sending again
      today from Internet Explorer

       

                 Please help me out . 

               Thank you very much.

                   Have a great day.

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4443
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
2
June 13, 2018 - 2:21 pm
sp_Permalink sp_Print

Hi Mitul,

There's no easy way to write one formula you can copy down column K in the 'Data for 2015..' tab because the layout is not consistent i.e. one row has months and regions, then you have a total for the regions. Each of these requires a different syntax in the GETPIVOTDATA function. You can see this if you look at the formulas;

January North is; =GETPIVOTDATA("Sales",$J$15,"Region","North","Month","Jan")

And the Total Sales is: =GETPIVOTDATA("Sales",$J$15,"Month","Jan")

i.e. the first formula specifies a region, but the total sales doesn't.

Mynda

Avatar
MITUL PARIKH
Member
Members
Level 0
Forum Posts: 68
Member Since:
December 8, 2017
sp_UserOfflineSmall Offline
3
June 13, 2018 - 8:36 pm
sp_Permalink sp_Print sp_EditHistory

                        Hi;  Mynda;

                    Thank you for your reply.

                   In "Data for 2015..' tab how can I make  layout  consistent? Can you please do it for me ?

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4443
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
4
June 14, 2018 - 9:51 am
sp_Permalink sp_Print

Remove the totals, that makes it consistent. Then you can just modify the first formula for the whole column: =GETPIVOTDATA("Sales",$J$15,"Region","North","Month","Jan")

Reference the cells containing the region instead of the hard coded "North" etc.

Mynda

Avatar
MITUL PARIKH
Member
Members
Level 0
Forum Posts: 68
Member Since:
December 8, 2017
sp_UserOfflineSmall Offline
5
June 15, 2018 - 2:36 am
sp_Permalink sp_Print sp_EditHistory

Hello Mynda;

Thank you for your reply.

In  workbook attached below, in "Data for 2015.. " worksheet , Removed totals, that made it consistent.

Is there any way we can write GetPivotdata formula to  have  Excel change  automatically from Region "North" to "South" for each and every month?  and I had to change  reference for ROW function  from January - ROW (A1) to February ROW (A2). Is there any way to  have Excel do it automatically?

I  like to master GetPivotData formula .   

Please help me.

Thank you very much.

Have a great day.

Sincerely;

Mitul.

 

              

 

                

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4443
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
6
June 15, 2018 - 10:25 am
sp_Permalink sp_Print

Hi Mitul,

Your data structure is all wrong for copying a formula down a column. I recommend you read this tutorial on how to write formulas efficiently.

In the attached file I fixed the first 3 months and you can see the formula simply references the cell containing the region to pick up the region information.

Your source data doesn't contain dates, the months are entered as text. So you can't use ROW or COLUMN to automatically generate the month number because the PivotTable doesn't have any months/dates in it, only text values that represent months. So, for the month, I extracted the first 3 characters from the month name in column I.

Please read this tutorial on how Excel works with dates.

Mynda

Avatar
MITUL PARIKH
Member
Members
Level 0
Forum Posts: 68
Member Since:
December 8, 2017
sp_UserOfflineSmall Offline
7
June 16, 2018 - 12:55 am
sp_Permalink sp_Print

                Hello Mynda;

                    Thank you very much for help with GPD formulas. 

                     Have a great day.

 

                

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Brian Pham, drsven
Guest(s) 9
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 870
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
A.Maurizio: 202
Jessica Stewart: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
drsven
Annie Witbrod
wahab tunde
Cong Le Duc
Faisal Bashir
Ivica Cvetkovski
Blaine Cox
Shankar Srinivasan
riyepa fdgf
Hannah Cave
Forum Stats:
Groups: 3
Forums: 24
Topics: 6205
Posts: 27211

 

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

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • 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
 

Company

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

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.