Pivot table - SUMIFS Issue

subrahmanyam85

New Member
Joined
Aug 26, 2014
Messages
20
Hi,

I have pivot table and have to show the data from into another sheet as Report format.
Format should not change.We are having only 4 categories.We have to show the catergory values as Header in Report (as shown below)

By using Excel macros once the pivot table get refresh I am bringing distinct values of Year,R_Year,Code,Currency in to Report sheet.

I have done the calculations by using SUMIFS.When the pivot table rows are increasing calculations are repeating and taking long time.

Can we do it without using SUMIFS?

Please suggest me the best way to achive it.Below is format of my data.

Pivot Table
==========
[TABLE="width: 423"]
<tbody>[TR]
[TD]Year[/TD]
[TD]R_Year[/TD]
[TD]Code[/TD]
[TD]Currency[/TD]
[TD]Category[/TD]
[TD]Amount[/TD]
[/TR]
[TR]
[TD]1993[/TD]
[TD]RY-2011[/TD]
[TD]A1[/TD]
[TD]GBP[/TD]
[TD]Cat-1[/TD]
[TD="align: right"]-29.01[/TD]
[/TR]
[TR]
[TD]1993[/TD]
[TD]RY-2011[/TD]
[TD]A1[/TD]
[TD]GBP[/TD]
[TD]Cat-3[/TD]
[TD="align: right"]-45.24[/TD]
[/TR]
[TR]
[TD]1993[/TD]
[TD]RY-2011[/TD]
[TD]AG[/TD]
[TD]GBP[/TD]
[TD]Cat-2[/TD]
[TD="align: right"]-125.81[/TD]
[/TR]
[TR]
[TD]1993[/TD]
[TD]RY-2011[/TD]
[TD]AG[/TD]
[TD]AUD[/TD]
[TD]Cat-4[/TD]
[TD="align: right"]-7.91[/TD]
[/TR]
[TR]
[TD]1993[/TD]
[TD]RY-2012[/TD]
[TD]AH[/TD]
[TD]AUD[/TD]
[TD]Cat-4[/TD]
[TD="align: right"]1,568.01[/TD]
[/TR]
[TR]
[TD]1993[/TD]
[TD]RY-2012[/TD]
[TD]AH[/TD]
[TD]AUD[/TD]
[TD]Cat-1[/TD]
[TD="align: right"]223.93[/TD]
[/TR]
[TR]
[TD]1993[/TD]
[TD]RY-2012[/TD]
[TD]AG[/TD]
[TD]USD[/TD]
[TD]Cat-3[/TD]
[TD="align: right"]-196.26[/TD]
[/TR]
[TR]
[TD]1993[/TD]
[TD]RY-2012[/TD]
[TD]AG[/TD]
[TD]USD[/TD]
[TD]Cat-1[/TD]
[TD="align: right"]-12.34[/TD]
[/TR]
[TR]
[TD]1993[/TD]
[TD]RY-2013[/TD]
[TD]AG[/TD]
[TD]USD[/TD]
[TD]Cat-2[/TD]
[TD="align: right"]2,446.10[/TD]
[/TR]
</tbody><colgroup><col><col><col><col><col><col></colgroup>[/TABLE]


Report Layout
=========
[TABLE="width: 595"]
<tbody>[TR]
[TD]Year
[/TD]
[TD]R_Year
[/TD]
[TD]Code
[/TD]
[TD]Currency
[/TD]
[TD]Cat-1
[/TD]
[TD]Cat-2
[/TD]
[TD]Cat-3
[/TD]
[TD]Cat-4
[/TD]
[/TR]
[TR]
[TD]1993
[/TD]
[TD]RY-2011
[/TD]
[TD]A1
[/TD]
[TD]GBP
[/TD]
[TD]-29.01
[/TD]
[TD][/TD]
[TD]-45.24
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1993
[/TD]
[TD]RY-2011
[/TD]
[TD]AG
[/TD]
[TD]GBP
[/TD]
[TD][/TD]
[TD]-125.81
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1993
[/TD]
[TD]RY-2011
[/TD]
[TD]AG
[/TD]
[TD]AUD
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]-7.91
[/TD]
[/TR]
[TR]
[TD]1993
[/TD]
[TD]RY-2012
[/TD]
[TD]AH
[/TD]
[TD]AUD
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]1,568.01
[/TD]
[/TR]
[TR]
[TD]1993
[/TD]
[TD]RY-2012
[/TD]
[TD]AG
[/TD]
[TD]USD
[/TD]
[TD]-12.34
[/TD]
[TD][/TD]
[TD]-196.26
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1993
[/TD]
[TD]RY-2013
[/TD]
[TD]AG
[/TD]
[TD]USD
[/TD]
[TD][/TD]
[TD]2,446.10
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Why not use GETPIVOTDATA? That's what it's for. ;)
 
Upvote 0
Thanks for your reply RoryA and Andrew.

I shouldn't change the format of Report Layout.That's why I am proceeding with GETPIVOTDATA function.
Pivot table is in another sheet, I have to show those values in another sheet.

To get the value of Cat-1,I am writing syntax in my Report Layout Sheet like below.But it is giving some reference error.

Amount,Year,R_Year are from pivot table.

=GETPIVOTDATA("Amount",PivotTable!F3,"Year",A2,"R_Year","B2")

Please refer Pivot Table and Report Layout.
 
Upvote 0
Here's a pivot table that looks like your report:


Excel 2010
ABCDEFGH
4YearR_YearCodeCurrencyCat-1Cat-2Cat-3Cat-4
51993RY-2011A1GBP-29.01-45.24
61993RY-2011AGAUD-7.91
71993RY-2011AGGBP-125.81
81993RY-2012AGUSD-12.34-196.26
91993RY-2012AHAUD223.931568.01
101993RY-2013AGUSD2446.1
Sheet4


Your macro can create it and convert it to values using Copy/Paste Special.
 
Upvote 0
I am not good in Macros Andrew,Thats why I am using GetPivotdata function.

Can we refer a Pivot table from another sheet in GetPivotdata?

I have already googled about this but I didn't get proper answere any where.

In on site they suggetsted the syntax like below. Its not working.

=GETPIVOTDATA("Amount",PivotTable!F3,"Year",A2,"R_Year","B2")
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top