+ Reply to Thread
Results 1 to 13 of 13

Refreshing Pivot table data

  1. #1
    Registered User
    Join Date
    12-28-2011
    Location
    Israel
    MS-Off Ver
    Excel 2007
    Posts
    18

    Refreshing Pivot table data

    Hi,

    I have a reoccurring problem that I can't figure out...
    I have a file with data per client per country that i wanted to setup in a pivot table that I can refresh when i insert new data. For example let's say this is the data I start with:

    client country amount
    a canada 100
    a norway 100
    b norway 100
    b sweden 100
    c greece 100
    c sweden 100
    d greece 100
    d norway 100

    Then this will be my pivot table:

    Row Labels Sum of amount
    a 200
    b 200
    c 200
    d 200
    Grand Total 800

    What happens after that is that for each client I add new countries with their amounts and update the old amounts, but when I refresh the pivot table it only updates the amounts of the original countries if they we're changed, but the new countries aren't included in the table. How come that happens and is there any way to fix it?

    Thx!

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

    Re: Refreshing Pivot table data

    Hi Yael,

    Looking at your pivot structure, the reason for this could be that you have not considered the countries for calculation purpose and only used clients. I suggest you to post a sample file with dummy results and forum will look into it. Thanks.

    Regards,
    DILIPandey

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

  3. #3
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Refreshing Pivot table data

    When you create the pivot table the range is set. When you enter new data on the main sheet, it goes beyond the original range for the pivot table.

    Take a look here and I think this will solve your problem. It is VBA but it's either this or you manually update your range everytime.

    http://mrexcel.libsyn.com/webpage/pi...o_podcast_1211

    Then you can us...


    Please Login or Register  to view this content.
    ...to update the pivot table on a refresh which happens everytime you enter an update on the main sheet. You just need to update the pivot table name.
    Last edited by jeffreybrown; 01-08-2012 at 10:45 AM.
    HTH
    Regards, Jeff

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Refreshing Pivot table data

    Hi,

    How are you referring to your data range in the Pivot Table? By cell references or by range name?
    I always prefer to give a dynamic range name to any tables of data that I use, and use the range name in the pivot table range definition, or indeed any data filtering macro.

    Regards
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Registered User
    Join Date
    12-28-2011
    Location
    Israel
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Refreshing Pivot table data

    I've attached an example of data I'm using and how I create my Pivot, the data is a report I pull from a system that I need to pull on a regular basis as the numbers change daily.
    So when I pull a new report i delete all data and paste the new report instead of it, then refresh. Then as I said before - if there's a new country in the report that wasn't there before, it would calculate it in the report, it will only update the amounts on teh already existing countries...
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    12-28-2011
    Location
    Israel
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Refreshing Pivot table data

    Sorry I meant to write: if there's a new country in the report that wasn't there before, it won't calculate it in the report

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

    Re: Refreshing Pivot table data

    Hi Yael,

    See the attached file and my comment in it.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    Attached Files Attached Files

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Refreshing Pivot table data

    Quote Originally Posted by yael View Post
    Sorry I meant to write: if there's a new country in the report that wasn't there before, it won't calculate it in the report
    Hi,

    See the attached. I've created a dynamic range name called 'Data' and added a dummy new country at the bottom. As you add new countries or clients and click refresh you'll find the Pivot Table updates automatically.

    Note that the range name relies on their being a value in every row of column C. If that won't be the case and either column B or C will always contain a value then just alter the COUNTA() bit of the range name to reflect that.

    Regards
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    12-28-2011
    Location
    Israel
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Refreshing Pivot table data

    I see that it works but I'm not sure how. When i try to repeat what you did it doesn't work for me...how did you add those new countries?

  10. #10
    Registered User
    Join Date
    12-28-2011
    Location
    Israel
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Refreshing Pivot table data

    Quote Originally Posted by yael View Post
    I see that it works but I'm not sure how. When i try to repeat what you did it doesn't work for me...how did you add those new countries?
    that was meant for DILIPandey

  11. #11
    Registered User
    Join Date
    12-28-2011
    Location
    Israel
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Refreshing Pivot table data

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    See the attached. I've created a dynamic range name called 'Data' and added a dummy new country at the bottom. As you add new countries or clients and click refresh you'll find the Pivot Table updates automatically.

    Note that the range name relies on their being a value in every row of column C. If that won't be the case and either column B or C will always contain a value then just alter the COUNTA() bit of the range name to reflect that.

    Regards
    How did you create the dynamic range though?

  12. #12
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Refreshing Pivot table data

    Look in Formulas Name Manager.

    You should get into the habit of using range names all the time, be they straightforward names covering specific cells or ranges, or as in this case a name that automatically expands as new data is added.

    Regards

  13. #13
    Registered User
    Join Date
    12-28-2011
    Location
    Israel
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Refreshing Pivot table data

    Quote Originally Posted by Richard Buttrey View Post
    Look in Formulas Name Manager.

    You should get into the habit of using range names all the time, be they straightforward names covering specific cells or ranges, or as in this case a name that automatically expands as new data is added.

    Regards
    I think I got it, thanks for your help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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