Percent change of 100% to show 100% in pivot table not DIV/0

Kyle775

Board Regular
Joined
Feb 16, 2005
Messages
230
Hi there, i want to make a calculation in a pivot table where a percent difference is calculated by year. The % difference from calculation does not show an increase from the previous year as 100% but a DIV/0 error. Can i make a custom formula that will use the year base field? or something like this?
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
post the formula you are using and some example data, you could use an IF statement something like

IF(iserror(formula),"100%",formula)
 
Upvote 0
Right now i have nothing as a formula, excel does the calculation on its own, but shows DIV/0, i would like to use an if statment to calculate the % difference from 2006 to 2007, but i dont know what variable to use for "base item"
Simply telling the table to use 100% for errors will not work because it needs to calculate the 100% for a total in the table.

i guess the formula would be something like this
=IF(AND(2007=0,2006=0),"0.00%",IF(AND(2007=0,2006>0),"-100.00%",(2007-2006)/ABS(2007)))

but im not sure this would calculate the subtotals and totals properly
 
Upvote 0
can you post some data please,

some actual DATA and a part of the pivot table, this way we can see how things are laid out and will be able to offer a solution easier
 
Upvote 0
here is some data from my sheet...
QSHIPBEN.xls
ABCDEFGHIJ
1SalesRepCustomerDateInvoiceShipToAddressCategroyItemCodeQuantitySalesAmount
2C001DUROXS6/29/2007102369STCATST.CATHARINES,ONT.CMCM5X1NLSBAGTI5031
3C001DUROXS6/29/2007102369STCATST.CATHARINES,ONT.TTCM1155CA121269.48
4C001DUROXS6/29/2007102369STCATST.CATHARINES,ONT.TTCM2161BC812101.64
5C001DUROXS6/29/2007102369STCATST.CATHARINES,ONT.TTCM1163TI1212111.6
6C001DUROXS6/29/2007102369STCATST.CATHARINES,ONT.TTCM2150BC825111.75
7C001DUROXS6/29/2007102369STCATST.CATHARINES,ONT.TTCM2152BB825128.75
QSHBEN06
 
Upvote 0
not sure how to post the pivot table with this html maker, i made a pdf but i dont have anywhere to post it
 
Upvote 0
You can use Excel Jeanie rather than the html maker to post pivot tables. Without the pivot table, it is really difficult to appreciate what is happening.
 
Upvote 0
wow that is a lot nicer than HTML maker! thanks for pointing that out.

Excel Workbook
ABCDEFGHIJK
3DateData
420062007
5Sales RepCustomerShip ToAddressCategroyQuantitySales Amount% Difference from PYQuantitySales Amount% Difference from PY
6C001BENGARMISCEL(blank)MP2.00-100.00%
7MISCEL Total2.00-100.00%
8(blank)(blank)MM5.00-100.00%
9MP3.00-100.00%
10(blank) Total8.00-100.00%
11BENGAR Total10.00-100.00%
12BROLANMISCEL(blank)FP25.0092.2536.00247.6244.00%
13MISCEL Total25.0092.2536.00247.6244.00%
14(blank)CAMBRIDGE, ONCB33.001,307.6111.00409.25-66.67%
15CM24,134.00141,822.3118,558.00124,514.09-23.10%
16FP15,977.0054,412.2311,739.0042,257.21-26.53%
17LM155.001,715.8272.001,877.16-53.55%
18ML5,472.0039,361.78#DIV/0!
19MM205.00944.006,212.50360.49%
20MP568.003,010.62716.004,976.1126.06%
21TT30,857.00104,598.7933,596.00119,460.958.88%
22WM45.00401.5010.00108.80-77.78%
23WS37.00104.41201.00608.00443.24%
24(blank) Total72,011.00307,373.2971,319.00339,785.85-0.96%
25BROLAN Total72,036.00307,465.5471,355.00340,033.47-0.95%
26CRANES(blank)STRATFORD, ONCP45,679.0050,389.93-100.00%
27(blank) Total45,679.0050,389.93-100.00%
28CRANES Total45,679.0050,389.93-100.00%
29DRAGNAMISCEL(blank)CM90.00585.30#DIV/0!
30MISCEL Total90.00585.30#DIV/0!
31(blank)SCARBOROUGH, ONCB591.0021,497.18454.0016,747.76-23.18%
32CM10,003.0055,651.988,869.0043,337.87-11.34%
33FP1,740.0012,441.201,245.0010,686.03-28.45%
34LM170.003,341.30173.001,849.331.76%
35MM39.0050.0028.21%
36TT5,928.009,663.321,061.005,944.27-82.10%
37(blank) Total18,471.00102,594.9811,852.0078,565.26-35.83%
38DRAGNA Total18,471.00102,594.9811,942.0079,150.56-35.35%
39DRAMISMISC(blank)MM1.00-100.00%
40TT1.00-100.00%
41MISC Total2.00-100.00%
42(blank)MISSISSAUGA, ONCB529.0018,960.39769.0027,182.6245.37%
43CM3,387.0016,792.872,669.0014,337.33-21.20%
Sheet1
 
Upvote 0
Hi

Where you have #DIV/0! that is because you have no value for the prior year and since the percentage change is given by:

=(New Value - Old Value)/Old Value

you end up with a denominator of zero (ie Old Value) and hence the error.
 
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,393
Members
449,081
Latest member
JAMES KECULAH

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